denolehov / obsidian-git

Backup your Obsidian.md vault with git
MIT License
6.12k stars 251 forks source link

[Bug]: Persistent Authentication Requests #721

Closed Ate329 closed 2 months ago

Ate329 commented 2 months ago

Describe the bug

When utilizing the Obsidian Git plugin, an authentication window consistently appears upon startup or upon clicking the Pull and Push buttons. Despite previously caching GitHub credentials in Git using both the GitHub CLI and Git Credential Manager, the authentication prompt persists. It's worth noting that it allows the Backup button to function correctly without having to authenticate again, the Pull and Push buttons remain non-functional until authentication is completed.

Upon encountering this issue, despite successfully entering credentials, the authentication prompt reappears upon restarting Obsidian.

Upon encountering this issue, closing the authentication window displays the following error:

Error Image

The authentication window appears as follows:

Authentication Window

This issue occurs on Fedora with KDE Plasma 5.

Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)

plugin:obsidian-git:44758 Pushing....
plugin:obsidian-git:45237 git obsidian error: Pushing to https://github.com/Ate329/MyObsidianNotes.git
/usr/local/bin/git-credential-manager get: line 1: /usr/local/bin/git-credential-manager: No such file or directory
error: unable to read askpass response from '/app/libexec/openssh/ssh-askpass'
fatal: could not read Username for 'https://github.com': No such device or address

plugin:obsidian-git:29441 Uncaught (in promise) Error: Pushing to https://github.com/Ate329/MyObsidianNotes.git
/usr/local/bin/git-credential-manager get: line 1: /usr/local/bin/git-credential-manager: No such file or directory
error: unable to read askpass response from '/app/libexec/openssh/ssh-askpass'
fatal: could not read Username for 'https://github.com': No such device or address

    at Object.action (plugin:obsidian-git:29441:25)
    at PluginStore.exec (plugin:obsidian-git:29466:25)
    at eval (plugin:obsidian-git:26971:43)
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (plugin:obsidian-git:26969:16)
    at GitExecutorChain.eval (plugin:obsidian-git:26953:44)
    at Generator.next (<anonymous>)
    at fulfilled (plugin:obsidian-git:25798:24)

Steps to reproduce

  1. Start Obsidian.
  2. Click on the Pull or Push buttons in the Obsidian Git plugin.
  3. Observe the authentication window appearing.

Expected Behaviour

The Backup, Pull, and Push buttons should perform their respective Git operations without prompting for authentication each time, especially if credentials have been previously cached.

Actual Behaviour

Despite caching GitHub credentials using both the GitHub CLI and Git Credential Manager, Obsidian Git plugin continues to prompt for authentication upon startup or upon using the Pull and Push buttons. While the Backup button functions correctly without authentication (but the authentication window still pops up), the Pull and Push buttons remain non-functional until authentication is completed. Additionally, upon restarting Obsidian, the authentication prompt reappears despite previously entering credentials.

Addition context

Operating system

Linux

Installation Method

Flatpak

Plugin version

2.24.1

Vinzent03 commented 2 months ago

So your remote url uses the ssh protocol and it asks for your ssh key passphrase. Are you using the same remote and repository when working from the terminal with git or the github cli? Do you have to enter your password there as well every session, system start or never?

Ate329 commented 2 months ago

Yes I am using the same remote and repository when using the terminal and when I try to push or pull in the terminal it works as normal. But I think I just found the issue. it might be caused by the fact that I am using GPG key to secure my Github credentials so I need to unlock the GPG key by entering my passphrase to allow the softwares to access it and somehow this pop-up window to enter my passphrase is not triggered normally for some weird reasons. Therefore, I don't think it's a issue caused by the plugin. Thanks for your time.