obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

[Bug]: Uncaught (in promise) Error: Host key verification failed. fatal: Could not read from remote repository.

Open niuers opened this issue 2 years ago • 10 comments

Describe the bug

It has been working well since installed, but recently I found it's not automatically pushing the changes to github.com. Opened the console, and found following errors. Tried to use ssh-keygen -R github.com and ssh-keyscan -t ed25519 github.com to update .ssh/known_hosts, but all failed to solve the issue. I am using Windows 11, the above commands were run on WSL ubuntu. One question is which know_hosts file is used in Obsidian Git, the one in /mnt/c/Users/username or /home/wsl_user_name? ` plugin:obsidian-git:26502 Uncaught (in promise) Error: Host key verification failed. 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:26502:25)
at PluginStore.exec (plugin:obsidian-git:26527:25)
at eval (plugin:obsidian-git:24032:43)
at new Promise (<anonymous>)
at GitExecutorChain.handleTaskData (plugin:obsidian-git:24030:16)
at GitExecutorChain.eval (plugin:obsidian-git:24014:44)
at Generator.next (<anonymous>)
at fulfilled (plugin:obsidian-git:22859:24)

action @ plugin:obsidian-git:26502 exec @ plugin:obsidian-git:26527 eval @ plugin:obsidian-git:24032 handleTaskData @ plugin:obsidian-git:24030 eval @ plugin:obsidian-git:24014 fulfilled @ plugin:obsidian-git:22859

`

Relevant errors (if available)

No response

Steps to reproduce

Open Obsidian, check Console output.

Expected Behavior

No response

Addition context

No response

Operating system

Windows

Installation Method

None

Plugin version

2.19.1

niuers avatar Apr 25 '23 02:04 niuers

I don't know which ssh config it uses. Does it use the wsl git version? E.g. have you set the custom git binary path in the plugin settings?

Vinzent03 avatar Apr 25 '23 10:04 Vinzent03

I am not sure I have done that or not, the plugin UI doesn't show it anymore. Where can I find the settings?

niuers avatar Apr 25 '23 11:04 niuers

It's under Advanced in the plugin settings.

Vinzent03 avatar Apr 25 '23 12:04 Vinzent03

The "Custom Git binary path" field shows "git" in grey. I don't think I set to use WSL git as I don't know how to use the path from WSL in windows. Is there any place that log the settings? I think the changes came from GITHUB's leaking of private key.

niuers avatar Apr 26 '23 00:04 niuers

Then what about fixing the ssh config in windows instead of wsl? You are currently using the windows installed git.

Vinzent03 avatar Apr 26 '23 05:04 Vinzent03

I think that's what I did:

ssh-keygen -R github.com \.ssh\known_hosts
ssh-keyscan -t ed25519 github.com >> \.ssh\known_hosts

Did I miss anything?

niuers avatar Apr 27 '23 00:04 niuers

But have you run them in wsl or windows?

Vinzent03 avatar Apr 27 '23 06:04 Vinzent03

I ran on windows Powershell

niuers avatar Apr 27 '23 17:04 niuers

That's the terminal, but did you enter wsl in that powsershell? Can you push in the powershell, without wsl?

Vinzent03 avatar May 02 '23 19:05 Vinzent03

I didn't enter wsl in powershell. I have no problem doing git push directly in powershell without wsl.

niuers avatar May 05 '23 15:05 niuers