obsidian-git
obsidian-git copied to clipboard
[Bug]: passphrase is missing for gpg key
Describe the bug
Issue
when using global git configs on linux gpg fails to run properly.
- Expected result:
- Git repo signs files properly without extra local settings
- Actual result:
- Obsidian git fails to sign the files and doesnt detect changes as a result
Relevant errors (if available)
VM110:78 Uncaught (in promise) Error: error: gpg failed to sign the data
fatal: failed to write commit object
at Object.action (eval at <anonymous> (app.js:1), <anonymous>:2120:29)
at PluginStore.exec (eval at <anonymous> (app.js:1), <anonymous>:2155:29)
at eval (eval at <anonymous> (app.js:1), <anonymous>:2594:43)
at new Promise (<anonymous>)
at GitExecutorChain.handleTaskData (eval at <anonymous> (app.js:1), <anonymous>:2592:16)
at GitExecutorChain.eval (eval at <anonymous> (app.js:1), <anonymous>:2576:44)
at Generator.next (<anonymous>)
at fulfilled (eval at <anonymous> (app.js:1), <anonymous>:2496:28)
Steps to reproduce
Steps to reproduce
- Have obsidian installed on linux either flatpak or appimage
- configure globally for git to sign files using your yubikey or other smartcard
- attempt to push changes to repo with obsidian git
Steps to solve temporarily
- Import global configs into local config
- attempt to backup using obsidian git
- watch it work properly
Expected Behavior
I am expecting it to work with global configurations.
Addition context
Relavent information
install type: flatpak (linux)
os: fedora silverblue
pgp setup: stored on yubikey
git version: 2.31.1
gpg version: 2.2.27
Git configs
Global (ommiting personal data)
[user]
signingKey = [REDACTED]
email = [REDACTED]
name = arouzing
[commit]
gpgsign = true
[init]
defaultBranch = master
[credential]
helper = store
[gpg]
program = /usr/bin/gpg
Local (ommitting personal data)
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = [email protected]:[REDACTED]
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[user]
email = [REDACTED]
name = arouzing
Operating system
Linux
After some more tinkering It seams that It s very inconsistent when dealing with gpg on linux. even after setting the local config it seams to not work corrently. willing to do any tests needed to sort this out.
I don't think this is an issue with global/local setting. Instead, the passphrase is missing to use the key.
I just hit this issue but in my case only flatpak installaton (of Obsidian) is affected. I tried to use official AppImage and auto / manual commit with signing works without issue.
Let me know if there is way how to help with debugging (I have zero knowledge of how flatpaks work so I am not promising to be helpful). I am fine with using AppImage until it is fixed so I am not rushing you, just sharing info. Thank you for your work.
- OS: Fedora 36 (Kernel: x86_64 Linux 5.19.16-200.fc36.x86_64)
- GIT: 2.38.1
- GPG: gpg (GnuPG) 2.3.7; libgcrypt 1.10.1-unknown
- Obsidian: 1.0.3 (both flatpak and AppImage)
- Obsidian Git: 2.9.4
- User details (name, email, signingkey) are defined in global
.gitconfig
; using local config doesn't fix this issue.
It doesn't work for me on Windows either.
- OS: Windows 10
- GIT: 2.38.1
- GPG: 2.3.6
- Obsidian: 1.0.3
- Obsidian Git: 2.13.0
When using the commandline everything works fine, I'm prompted for my ssh-passphrase and git does its thing, but Obsidian Git complains about "permission denied (publickey). fatal: could not read from remote repository."
A solution for simple-git could be to add an option that is something like "Needs Passphrase" with a yes / no switch in the plugin options, and if it is set to yes then query the passphrase on startup and incorporate it like shown here (npmjs.com)
Same issue on MacOS.
- OS: MacOS 12.6.2
- GIT: 2.37.1
- GPG: 2.3.8
- Obsidian: 1.1.9
- Obsidian Git: 2.16.0
GPG settings are defined in global .gitconfig. GPG keychain is setup and works for me when setting up commits outside of obsidian git. The workaround of putting GPG settings into the local config works for me.
Same issue on Pop! OS.
- OS: Pop!_OS 22.04 LTS x86_64
- Git: 2.34.1
- GPG:
gpg (GnuPG) 2.2.27 libgcrypt 1.9.4
- Obsidian: 1.1.5
- Obsidian Installer: 1.1.9
- Obsidian Git: 2.16.0
Tried what @skullbunnygalaxy mentioned about adding GPG info to local config, that didn't work either.
@cybersholt How did you install Obsidian? In case you re using Flatpak, try AppImage.
same here on mac
this also seems to be happening to me.
I use below to bypass it
git config --local commit.gpgsign false
# Read local (if never set, can be an empty value)
git config --local commit.gpgsign ```
I use below to bypass it
git config --local commit.gpgsign false # Read local (if never set, can be an empty value) git config --local commit.gpgsign ```
does not help a lot when you actually want to authenticate with it..
I use below to bypass it
git config --local commit.gpgsign false # Read local (if never set, can be an empty value) git config --local commit.gpgsign ```
does not help a lot when you actually want to authenticate with it..
Anyway, it backed up automatically now