Skip to content

[BUG] 'BadAuthentication' when trying to sync for the first time #157

@DDzwiedziu

Description

@DDzwiedziu

Describe the bug

Trying to sync a Google Keep note for the first time.

To Reproduce

  1. Have an app password,
  2. put the app password in pass,
  3. use the following command line: GKEEP_USERNAME='${Google_username}@gmail.com' tw_gkeep_sync -v --confirm --passwd-pass-path='Google/${Google_username}/gkeepapi_pw' -k '${Note_name}' -t Google_Keep --tw-project '${Project_Name}'
  4. after confirming the configuration an exception is raised.

Expected Behavior

Syncing the note.

📸 Screenshots Logs

❯ GKEEP_USERNAME='${Google_username}@gmail.com' tw_gkeep_sync -v --confirm --passwd-pass-path='Google/${Google_username}/gkeepapi_pw' -k '${Note_name}' -t Google_Keep --tw-project '${Project_Name}'
14:32:47.74 | DEBUG     | Initialising...
14:32:47.74 | DEBUG     | Initialising preferences manager -> /home/dzwiedziu/.config/syncall
14:32:47.74 | INFO      | Loading preferences...
14:32:47.74 | DEBUG     | Loading cached configuration - ${Note_name_spaces_changed_to_%20}____${Project_Name}__Google_Keep.yaml
14:32:47.74 | INFO      |

Configuration:
===============

  - TW Filter        :
  - TW Tags          : ('Google_Keep',)
  - TW Project       : ${Project_Name}
  - TW Sync All Tasks: False
  - Google Keep Note : ${Note_name}



Continue [Y/n] ? y
14:32:49.16 | DEBUG     | Reading the gkeep username from environment variable...
14:32:49.16 | DEBUG     | Attempting to read Google/${Google_username}/gkeepapi_pw from UNIX Password Store...
14:32:51.41 | DEBUG     | Attempting to read gkeepapi/token from UNIX Password Store...
14:32:51.42 | DEBUG     | Initializing Taskwarrior instance using config file: /home/dzwiedziu/.config/task/taskrc
14:32:51.42 | DEBUG     | Using a custom configuration file ... -> ${Note_name_spaces_changed_to_%20}____${Project_Name}__Google_Keep.yaml
14:32:51.42 | DEBUG     | Initialising preferences manager -> /home/dzwiedziu/.config/syncall
14:32:51.42 | INFO      | Loading preferences...
14:32:51.42 | DEBUG     | Connecting to Google Keep...
'Keep.resume' has been renamed to 'Keep.authenticate'. Please update your code
'Keep.login' is deprecated. Please use 'Keep.authenticate' instead
Exception was raised during program execution.

  File "/home/dzwiedziu/.local/bin/tw_gkeep_sync", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/dzwiedziu/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dzwiedziu/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/dzwiedziu/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dzwiedziu/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dzwiedziu/.local/lib/python3.12/site-packages/syncall/scripts/tw_gkeep_sync.py", line 198, in main
    with Aggregator(
  File "/home/dzwiedziu/.local/lib/python3.12/site-packages/syncall/aggregator.py", line 136, in __enter__
    self.start()
  File "/home/dzwiedziu/.local/lib/python3.12/site-packages/syncall/aggregator.py", line 219, in start
    self._side_A.start()
  File "/home/dzwiedziu/.local/lib/python3.12/site-packages/syncall/google/gkeep_todo_side.py", line 44, in start
    super().start()
  File "/home/dzwiedziu/.local/lib/python3.12/site-packages/syncall/google/gkeep_side.py", line 48, in start
    self._keep.login(self._gkeep_user, self._gkeep_passwd)
  File "/home/dzwiedziu/.local/lib/python3.12/site-packages/gkeepapi/__init__.py", line 708, in login
    auth.login(email, password, device_id)
  File "/home/dzwiedziu/.local/lib/python3.12/site-packages/gkeepapi/__init__.py", line 58, in login
    raise exception.LoginException(res.get("Error"), res.get("ErrorDetail"))


('BadAuthentication', None)
14:32:51.96 | ERROR     | Application failed; Below you can find the error message and stack trace. If you think this is a bug, attach this stack trace to create a new issue -> [https://github.com/bergercookie/syncall/issues].
NoneType: None

Versions

OS Version (cat /etc/*-release; uname -a)

❯ \cat /etc/*-release; uname -a
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=22.2
DISTRIB_CODENAME=zara
DISTRIB_DESCRIPTION="Linux Mint 22.2 Zara"
NAME="Linux Mint"
VERSION="22.2 (Zara)"
ID=linuxmint
ID_LIKE="ubuntu debian"
PRETTY_NAME="Linux Mint 22.2"
VERSION_ID="22.2"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=zara
UBUNTU_CODENAME=noble
cat: /etc/upstream-release: Is a directory
Linux redstripe 6.8.0-87-generic #88-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 09:28:41 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Python version (python --version; python3 --version)

❯ python --version; python3 --version
Python 3.12.3
Python 3.12.3

--version of your executable

❯ tw_gkeep_sync --version
tw_gkeep_sync, version 1.8.8

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions