Comments (21)
Hi,
I was having the same problem even though I followed @ebouchut's workaround. Turns out my problem was the permissions on the ~/.ssh/config file. After doing chmod 600 ~/.ssh/config
it worked properly without an issue. Hope this helps in case anyone is still having the problem after the workaround.
from obsidian-git.
Issue
obsidian-git
attempts to push commits to the remote repository.
git-error.js:33 Uncaught (in promise) Error: Pushing to [email protected]:ebouchut/obsidian-eric.git
ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory
no such identity: /Users/eric/.ssh/ids/github.com/id_rsa: No such file or directory
[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.
Cause
Here is my understanding of the problem.
As Obsidian is not launched from the shell but as a UI program, whose parent is launchd
it does not benefit from the environment variables appropriately set by the shell hence it does not find the keys in your ssh-agent
.
In fact, it searches for keys in launchd
's keystore.
Workaround
✅ The workaround is to install a program named ssh-askpass
thatobsidian-git
uses to popup a small window asking you to enter your keystore's passphrase and adds the key in launchd's keystore.
Here is how I solved this issue:
- Install
ssh-askpass
brew tap theseal/ssh-askpass
brew install ssh-askpass
sudo ln -s /usr/local/bin/ssh-askpass /usr/X11R6/bin/ssh-askpass
- Log out then log back in.
- Edit
~/.ssh/config
and add the 2 linesAddKeysToAgent yes
andUseKeychain yes
to theHost github.com
section, so that you are not asked for the passphrase each timeobdisian-git
pushes to the remote.
Host github.com
User git
Hostname github.com
#
# use only the publickey authentication method
# Default is publickey,password,keyboard-interactive,hostbased
# PreferredAuthentications publickey
#
IdentityFile ~/.ssh/id_rsa
# Use only the key specified in IdentityFile,
# ignoring the keys already loaded in ssh-agent
IdentitiesOnly yes
AddKeysToAgent yes # <===
UseKeychain yes # <===
from obsidian-git.
Hi, I'm encountering this issue as well for just the past few days.
Latest versions of Obsidian Git, Obsidian, System, ect.
Running Obsidian via the flathub flatpak build, on Fedora 33.
Obsidian Git used to pop up a box asking for me to enter my ssh key password, and now just fails to push.
Confirmed push works via command line and server is reachable.
Update: I ran the commands listed here: #23 (comment) and that fixed it.
from obsidian-git.
Yup, still bothers me to enter password each and every time, and also I have to input it twice for some reason? I'm very lost, this is my ~/.ssh/config file just in case:
Host gitlab.com
Hostname gitlab.com
#
# use only the publickey authentication method
# Default is publickey,password,keyboard-interactive,hostbased
# PreferredAuthentications publickey
#
IdentityFile ~/.ssh/id_ed25519
# Use only the key specified in IdentityFile,
# ignoring the keys already loaded in ssh-agent
IdentitiesOnly yes
AddKeysToAgent yes # <===
IgnoreUnknown UseKeychain
UseKeychain yes # <===
from obsidian-git.
chmod 600 ~/.ssh/config
worked for me
from obsidian-git.
Setting the branch using the command palette under Obsidian Git: Switch branch
worked for me. Somehow it got unset, IDK when and stopped working. Setting it again fixed it.
from obsidian-git.
For future generations about what was the reason of the issue and how I fixed it. I have arch with latest obsidian from AUR.
Steps that led me to this error:
- I tried to clone an obsidian repo from github.com
- Git asked me if I trust the remote server
- I said yes
- It added record to ~/.ssh/known_hosts
- I successfully used obsidian with this plugin to work with this repo folder locally
At some moment I deleted ~/.ssh/known_hosts and then tried to use obsidian with obsidian-git plugin enabled.
It didn't work because during automatic pull at the start git was showing that confirmation dialog again and the plugin wasn't able to handle it correctly.
Step to fix the error:
- Open the terminal
- Go to your repo folder
- run
git pull
simply to invoke this "do you trust the remote server" dialog - answer yes
- restart obsidian
Now the error will go away
from obsidian-git.
+1
Running on Windows 10, ssh key set up for github.com. Can push manually with git cli.
from obsidian-git.
+1
Running on linux, ssh key also set up and also correctly pushing via CLI.
from obsidian-git.
+1 but able to resolve after disable and reinstall the plugin again on Windows 10.
from obsidian-git.
If anyone is encountering this issue, make sure you have the Disable Push
setting toggled off
(see the screenshot) and restart Obsidian
from obsidian-git.
When I'm not using Obsidian (writing, editing, etc.) it works fine, but when I use it is when the error appears. I think that it is somewhat similar to the error that appears in the file explorer when you try to move or rename a file while it's still open.
from obsidian-git.
Hello, I'm on linux and tried replicating the steps outlined by #39 (comment) but the UseKeychain yes
property seems to be a MacOS thing, and I can't get it working. I'm on Linux and installed obsidian from the AUR (https://aur.archlinux.org/packages/obsidian/). At the moment I'm prompted for my passphrase whenever obsidian-git tries to backup, this is pretty annoying so I'm turning off the "backup every X mins" option for the time being, tho i'd love to use it. I have my keychain properly setup and everything so, any help on getting obsidian to access it?
from obsidian-git.
Hi @ zkwinkle
Try adding this to ~/.ssh/config
:
IgnoreUnknown UseKeychain
This will prevent errors about UseKeychain
not being recognized on Linux.
If it keeps bothering you to enter the password each and every time you push we will dig on the cache side.
from obsidian-git.
@zkwinkle Has the ssh key a passphrase and if so, do you have to enter it when you use it via command line?
from obsidian-git.
I tend to forget the steps for setting up and configuring ssh until I start working with it again. In my case, I just needed to open the .git/config
inside the root directory and after installing this plugin and setting up my github client. I already had ssh configured with ssh-agent and globally to use my ssh key with github so better refer to another doc for this. But once you open that file change the url from https to ssh. You can grab it from your github repo under the code dropdown.
example but substitute your info so best to copy from github.
~/.ssh/config
but remember to reference another document on doing this like one.
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
then at /Users/aricode0/Documents/Obsidian Vaults/Testing-Github/.git/config
from
[remote "origin"]
url = https://github.com/ar-to/Testing-Github.git
fetch = +refs/heads/*:refs/remotes/origin/*
to
[remote "origin"]
url = [email protected]:ar-to/Testing-Github.git
fetch = +refs/heads/*:refs/remotes/origin/*
now no worries and all works.
from obsidian-git.
chmod 600 ~/.ssh/config
Did you solve the problem? I have the same problem and have not been able to solve it.
from obsidian-git.
For the ~/.ssh/config file, the GitHub Docs state you should add:
Host *.github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519 (changing the SSH key file to match your setup)
I found that this was actually the problem after looking at @ar-to comment.
Changing the Host to * or github.com fixed the problem. So it should read
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
OR
Host github.com (or whatever repository you are using)
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
from obsidian-git.
chmod 600 ~/.ssh/config
worked for me
This also did the trick for me in Linux. I was getting the following error before:
node:internal/process/task_queues:96 Uncaught (in promise) Error: Bad owner or permissions on /home/<user>/.ssh/config fatal: Could not read from remote repository.
from obsidian-git.
Setting the branch using the command palette under
Obsidian Git: Switch branch
worked for me. Somehow it got unset, IDK when and stopped working. Setting it again fixed it.
thanks!
from obsidian-git.
Setting the branch using the command palette under
Obsidian Git: Switch branch
worked for me. Somehow it got unset, IDK when and stopped working. Setting it again fixed it.
thanks from me too, fixed my issue!
from obsidian-git.
Related Issues (20)
- [Bug]: Git pull for Git submodules fail when no upstream remote repo defined HOT 2
- [Feature]: Force pull / reset --hard HEAD HOT 6
- [Feature]: Multiple Repository
- [Bug]: plugin is not installing HOT 1
- [Bug]: Android: "%%%%%" on left of each line in source mode HOT 2
- using another git lib on android HOT 3
- [Enhancement] Multiple remotes support HOT 1
- [Bug]: Obsidian freezing from having any setting enabled HOT 1
- Feature request: Support Git move HOT 1
- [Bug]: GPG doesn`t work when program is .sh file or with ~/
- [Feature]: Make Auto Backup commits amendable HOT 1
- [Bug]: Git init doesn't work properly when a custom git-dir value is set through the 'Custom Git directory path' setting HOT 1
- [Bug]: git obsidian error: TypeError [ERR_INVALID_ARG_VALUE]: The argument 'args[6]' must be a string without null bytes HOT 1
- [Proposal]: Rename the plugin to "Git Backup" HOT 1
- [Feature Request]: Push on Close HOT 1
- [Bug]: wrong order in git backup HOT 3
- [Bug]: Freshly installed plugin renders Obsidian unusable! HOT 4
- [Bug]: Persistent Authentication Requests HOT 2
- [Enhancement Suggestion]: Make .git folder outside of value folder by default HOT 2
- [Bug]: Plugin causes Micro lags
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obsidian-git.