obsidian-git
obsidian-git copied to clipboard
Pushing not working
I've installed this plugin, but I'm unable to push or pull commits. Whenever I push, the plugin creates a commit, but fails on pushing with this error (from the console). I have access rights to the repository, and I can push from the command line, so I'm not sure what the problem is. I'm on Ubuntu 20.04, and ssh-askpass
is installed. I connect to my repository using SSH, not username/password.
The error and stack in question:
Uncaught (in promise) Error: Pushing to github.com:NicholasMamo/xyz.git
ssh_askpass: exec(/usr/libexec/ssh-askpass): 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.
at GitExecutorChain.onFatalException (eval at <anonymous> (app.js:1), <anonymous>:2536:85)
at GitExecutorChain.eval (eval at <anonymous> (app.js:1), <anonymous>:2527:28)
at Generator.throw (<anonymous>)
at rejected (eval at <anonymous> (app.js:1), <anonymous>:2482:65)
Hmm, could you try starting Obsidian from command line (using Obsidian AppImage) and see if the problem persists? If you're using flatpak:
/home/$USER/.local/share/flatpak/app/md.obsidian.Obsidian/current/active/files/obsidian
Thanks for the quick reply. It worked when launching the app from the command-line, but it doesn't work when I launch it from dash. Any idea why that is?
I am not entirely sure, but most likely it is related to the fact that Obsidian instance that you're launching from dash is sandboxed, and it doesn't "see" your $PATH
. I didn't pinpoint the issue yet, but it seems like an emerging pattern given other, similar issues some people have.
Got it. Let me know if I can help in any way! :)
As a workaround, you could try adding AppImage to dash manually.
same issue using flatpack.
The workaround is: flatpak run --socket=ssh-auth md.obsidian.Obsidian
but this requires to confirm host authenticity each time
An update from 2 days ago seems to have fixed this issue for me. I'm not sure what update it was because the Obsidian version hasn't changed (it's been at version 0.9.17 for a few days now). Maybe it was an update to this plugin.
~~Automatic push doesn't seem to work for me either (I set it to 5 minutes intervals), I'm on macOS with Obsidian v0.10.1, any way I can debug this to fix it?~~
Seems to work after changing the timings a few times and restarting the app. Not sure if just a setting got messed up?
@NicholasMamo Can I close this now?
@NicholasMamo Can I close this now?
Not yet, I'm afraid. It hasn't worked for at least a month now. When I push, I get the error: "git: push failed to github.com:username/vault.git bad owner or permissions on vault.git".
When you push changes from the command prompt. Do you have to type in some password or similar?
No, I use SSH to push changes. Pushing from the command prompt works flawlessly.
FYI, take a look at this. https://github.com/denolehov/obsidian-git/issues/39#issuecomment-798955390
This is what worked for me: https://github.com/denolehov/obsidian-git/issues/39#issuecomment-812216390
I'm now trying to summarize auth methods here
One possible solution is to create a simple script
# Change to your project directory
cd /path/to/vault
# Add all changes
git add .
# Commit changes with a message
git commit -m "Automated commit"
# Push changes to the remote repository (change to master if needed)
git push origin main
then set a cron job to execute it for every 10 min let's say */10 * * * * /path/to/script P.S. you should set your access token from your gh