I didn't see an opinion on the approach to take so I went ahead and
formed-up the more comprehensive fix as PR #2334 (
https://github.com/Gnucash/gnucash/pull/2334 )
I found more significance than just a noisy warning on macOS. GnuCash
actually provides no means to update the stored password once set the first
time.  I fixed that.

Cheers,

Noah


On Sun, Oct 4, 2026 at 4:06 PM Noah <[email protected]> wrote:

> Hey again,
>
> On macOS, opening a SQL-backed book logs this to the .trace on every open:
>
> ```
> WARN <gnc.gui> [gnc_keyring_set_password()] OS X keychain error: (null)
> WARN <gnc.gui> [gnc_keyring_set_password()] The user will be prompted for
> a password again next time.
> ```
>
> No prompt ever appears and nothing breaks, so it's misleading. (The
> `(null)` is a separate display bug corrected in PR #2322. The real status
> is `errSecDuplicateItem`.)
>
> Root cause of the Warnings: `gnc_post_file_open()` re-stores the
> connection password in the keyring on every open, even when it hasn't
> changed; macOS's add-only `SecKeychainAddInternetPassword` then fails with
> `errSecDuplicateItem`. (On libsecret/gnome-keyring the same re-store
> silently succeeds — redundant but harmless.)
>
> Two ways to fix it:
>
> 1. **Minimal, macOS-only** — have the macOS store look up and update an
> existing item instead of a blind add, so it stops erroring.
> 2. **Comprehensive** — do the check once in `gnc_keyring_set_password` for
> all backends: look up the stored value and write only when it's missing or
> actually changed. No platform re-writes needlessly, macOS updates-or-adds,
> and the function reads more clearly. Draft of this approach:
> https://github.com/Noerr/gnucash/commit/20094e52c8
>
> Was the unconditional re-store on every open intentional? If not, I lean
> toward (2) and will open a PR based on my drafted commit.
>
> Thanks,
> Noah
>
>
_______________________________________________
gnucash-devel mailing list
[email protected]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to