Vinzent03 / obsidian-git

Integrate Git version control with automatic backup and other advanced features in Obsidian.md
MIT License
6.58k stars 272 forks source link

Pull Failed: No such device or address #23

Closed Bejasc closed 3 years ago

Bejasc commented 3 years ago

Hi there,

I'm getting this error in my console when launching Obsidian, and when toggling the plugin on and off.

Uncaught (in promise) Error: bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No such file or directory

    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)

I am unable to access the configuration options for the plugin with this issue occurring. No actual pull occurs. No other functionality works (automatic push)

Vinzent03 commented 3 years ago

Did you set your email and username for git? See https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address#setting-your-commit-email-address-in-git and https://docs.github.com/en/github/using-git/setting-your-username-in-git#setting-your-git-username-for-every-repository-on-your-computer

bnonn commented 3 years ago

I seem to be getting the same problem.

Although this may be related to https://github.com/kemayo/sublime-text-git/issues/176, my suspicion is that it's a Flatpak issue. I have Obsidian installed on Pop_OS via the Pop Store, which uses Flatpak. As I understand it, Flatpak runs in some kind of sandbox, and perhaps this is preventing it from having access to the normal Git credentials? If I simply run git pull on a terminal in my vault directory, it works fine. I was using Bryan Jenks' git setup (bash script + cron job) before trying this plugin, but I'd like to be able to integrate git with Obsidian more directly, as it means less technical setup to have to remember.

Vinzent03 commented 3 years ago

I am using it with Flatpak on KDE neon and it works fine. Flathub changed some configs, why I suggest running the following:

$ flatpak update md.obsidian.Obsidian
$ flatpak override --reset md.obsidian.Obsidian
$ flatpak run md.obsidian.Obsidian

https://github.com/flathub/md.obsidian.Obsidian/issues/5#issuecomment-736974662

And if you run git push in the console, do you have to enter username, password or similar?

bnonn commented 3 years ago

Ah, perfect, thank you. Running Obsidian through flatpak presented me a login prompt for Github, and after entering my credentials there it is working correctly.

I think it would be a good idea to have some kind of message somewhere prominent with these instructions for other folks in my situation? Would save you some bug reports :)

Vinzent03 commented 3 years ago

I already added some instructions, but maybe it's a good idea to add this solution for users, who already installed Obsidian with Flatpak a while ago.

jesuslencina commented 3 years ago

flatpak run md.obsidian.Obsidian

Hey there. Thank you for this solution. I did have the latest flatpak version, but running with flatpak run md.obsidian.Obsidian allowed me to pull the repo by typing my credentials in the terminal.

However, looks like I have to do so for every pull/push, which is really unpractical, specially considering I've set it to backup every 30 minutes. Is there any fix to this? I'm not looking at the terminal while I write my notes.

By the way, I'm on the latest stable elementaryOS, with Obsidian installed from flatpak (as mentioned above)

Vinzent03 commented 3 years ago

I guess you are using https to authenticate. The only way would be to cache the credentials from the terminal. Or you use ssh and add it to the ssh-agent

ghost commented 3 years ago

i fixed it with this thread: https://stackoverflow.com/questions/35942754/how-to-save-username-and-password-in-git

it works perfectly fine now

Vinzent03 commented 3 years ago

Closing because of no response of @Bejasc .

Komi7 commented 1 year ago

if you are arch user than download pacman version (not AUR version)