gphotos-uploader-cli: Keychain backend not working on macOS

Describe the bug The keychain backend is not working on macOS.

To Reproduce Steps to reproduce the behavior:

  1. brew install gphotosuploader/tap/gphotos-uploader-cli
  2. Run gphotos-uploader-cli init
  3. Edit config.hjson and set SecretsBackendType to keychain.
  4. Run gphotos-uploader-cli push

Expected behavior Be able to run the program without further user interaction whilst having the Google Photos credentials safely stored in the macOS keychain.

Actual behavior

gphotos-uploader-cli push
[info]   Reading configuration from '~/.gphotos-uploader-cli/config.hjson'
[error]  Token manager could not be started, err: Specified keyring backend not available
[fatal]  token manager could not be started, type:keychain, err: Specified keyring backend not available

Desktop & Client versions (please complete the following information):

  • Operating System: macOS Catalina 10.15.7
  • Version gphotos-uploader-cli v3.1.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

FYI, after upgrading golang.org/x/term, the keychain secrets backend also works for my own compilation. Do you think that this will also fix the issue for the binary that is distributed through homebrew?

As a temporary workaround, you can add the passphrase manually to the macOS keychain.

Then set GPHOTOS_CLI_TOKENSTORE_KEY environment variable, with the output of security find-generic-password -a $USER -s name_of_item -w in a wrapper script before calling gphotos-uploader-cli push.