Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Authentification fails with multiple SSH setup #776

Open
in-touch-with-health opened this issue Sep 23, 2024 · 4 comments
Open

[Bug]: Authentification fails with multiple SSH setup #776

in-touch-with-health opened this issue Sep 23, 2024 · 4 comments
Labels
awaiting response Cannot work on issue until response from an author of an issue desktop support This issue is probably not an actual issue in the plugin, but the user needs help with their setup.

Comments

@in-touch-with-health
Copy link

Describe the bug

My system is setup for ssh with multiple keys and github accounts as described here:
https://gist.github.com/oanhnn/80a89405ab9023894df7
This works fine with git command line on the git directory, but git plugin fails to properly authenticate.

This may be due to not using the alias, which was setup for the secondary git ssh key.

from .git/config

[remote "origin"]
	url = git@github-bashuss:SOMEADDRESS

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

Uncaught (in promise) Error: [email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

    at Object.action (plugin:obsidian-git:104:10649)
    at zF.exec (plugin:obsidian-git:104:10960)
    at eval (plugin:obsidian-git:103:6654)
    at new Promise (<anonymous>)
    at Xf.handleTaskData (plugin:obsidian-git:103:6543)
    at Xf.eval (plugin:obsidian-git:103:6169)
    at Generator.next (<anonymous>)
    at a (plugin:obsidian-git:100:11259)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Steps to reproduce

  1. Use MAC
  2. Setup new repository on github
  3. Setup and test ssh key for github, but with an host alias as described here: https://gist.github.com/oanhnn/80a89405ab9023894df7
  4. Checkout the repository with the host alias
  5. Open the folder as vault with obsidian, add Git and other plugins, some notes
  6. Try to push the changes to the repository using Git plugin.

Expected Behavior

This is how it worked with command line:

Checkout process

$ git clone git@github-bashuss:SOMEADDRESS TARGETPATH 
Cloning into 'TARGETPATH'...
remote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 22 (delta 5), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (22/22), 7.86 KiB | 7.86 MiB/s, done.
Resolving deltas: 100% (5/5), done.
$ cd TARGETPATH
$ git config user.email MYACCOUNTEMAIL
$ git config user.name MYACCOUNTNAME

At this point I added some content and then tried to use git plugin in obsidian to Git: commit & sync.
The result was the error message above.

Commit process

$ git add .
$ git commit -m "Initial commit"
On branch dev
Your branch is ahead of 'origin/dev' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
$ git push
Enumerating objects: 23, done.
Counting objects: 100% (23/23), done.
Delta compression using up to 14 threads
Compressing objects: 100% (19/19), done.
Writing objects: 100% (22/22), 35.17 KiB | 7.03 MiB/s, done.
Total 22 (delta 0), reused 0 (delta 0), pack-reused 0
To github-bashuss:SOMEADDRESS
   d35f94e..882675f  dev -> dev

Addition context

No response

Operating system

macOS

Installation Method

None

Plugin version

2.27.0

@in-touch-with-health in-touch-with-health added the bug Something isn't working label Sep 23, 2024
@Vinzent03
Copy link
Owner

Vinzent03 commented Nov 25, 2024

Please try again with the latest version v2.30.0

@Vinzent03 Vinzent03 added desktop support This issue is probably not an actual issue in the plugin, but the user needs help with their setup. and removed bug Something isn't working labels Nov 25, 2024
@Vinzent03 Vinzent03 added the awaiting response Cannot work on issue until response from an author of an issue label Dec 28, 2024
@pcuellar
Copy link

Experiencing the same issue here with the same setup as @in-touch-with-health . I tried v.2.30.0 and all the subsequent releases to no avail. This is the full copy of the error on the console when I do Git: Push:

plugin:obsidian-git:347 obsidian-git: Pushing....
plugin:obsidian-git:347 obsidian-git: Error: Pushing to github.com:pcuellar/Obsidian.git
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

    at Object.action (plugin:obsidian-git:104:11303)
    at QP.exec (plugin:obsidian-git:104:11799)
    at eval (plugin:obsidian-git:103:7026)
    at new Promise (<anonymous>)
    at $h.handleTaskData (plugin:obsidian-git:103:6915)
    at $h.eval (plugin:obsidian-git:103:6541)
    at Generator.next (<anonymous>)
    at a (plugin:obsidian-git:100:11187)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
displayError @ plugin:obsidian-git:347
push @ plugin:obsidian-git:336
processTicksAndRejections @ node:internal/process/task_queues:95
await in processTicksAndRejections
processTicksAndRejections @ node:internal/process/task_queues:95
await in processTicksAndRejections
eval @ plugin:obsidian-git:210
handleTask @ plugin:obsidian-git:209
addTask @ plugin:obsidian-git:209
callback @ plugin:obsidian-git:210
X_ @ app.js:1
t.onChooseItem @ app.js:1
t.onChooseSuggestion @ app.js:1
t.selectSuggestion @ app.js:1
e.useSelectedItem @ app.js:1
(anonymous) @ app.js:1
e.handleKey @ app.js:1
(anonymous) @ app.js:1

@pcuellar
Copy link

pcuellar commented Jan 9, 2025

@Vinzent03 Just tagging you for visibility since @in-touch-with-health has not replied to your question

@bashuss
Copy link

bashuss commented Jan 9, 2025

@in-touch-with-health is currently completely buried in work. Please do not expect an answer soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Cannot work on issue until response from an author of an issue desktop support This issue is probably not an actual issue in the plugin, but the user needs help with their setup.
Projects
None yet
Development

No branches or pull requests

4 participants