obsidian-git
obsidian-git copied to clipboard
[Bug]: Uncaught (in promise) Error: Host key verification failed. fatal: Could not read from remote repository.
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
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?
I am not sure I have done that or not, the plugin UI doesn't show it anymore. Where can I find the settings?
It's under Advanced in the plugin settings.
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.
Then what about fixing the ssh config in windows instead of wsl? You are currently using the windows installed git.
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?
But have you run them in wsl or windows?
I ran on windows Powershell
That's the terminal, but did you enter wsl in that powsershell? Can you push in the powershell, without wsl?
I didn't enter wsl in powershell. I have no problem doing git push directly in powershell without wsl.