question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remote SSH - Git: gpg failed to sign the data

See original GitHub issue

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.59.0

  • OS Version:

    Version: 1.59.0 (user setup)
    Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8
    Date: 2021-08-04T23:13:12.822Z
    Electron: 13.1.7
    Chrome: 91.0.4472.124
    Node.js: 14.16.0
    V8: 9.1.269.36-electron.0
    OS: Windows_NT x64 10.0.19043
    

Steps to Reproduce:

I’m using Remote - SSH from Windows 10 to Ubuntu 20.04 LTS.

  1. Add the following code to ~/.profile

    export GPG_TTY=$(tty)
    
  2. Configure git

    git config --global commit.gpgsign true
    git config --global --unset gpg.program
    git config --global --add gpg.program /usr/bin/gpg
    
  3. Enable Commit Signing

    image

  4. Commit

    image

  5. Open Git Log

    > git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - -S
    error: gpg failed to sign the data
    fatal: failed to write commit object
    > git config --get-all user.name
    > git config --get-all user.email
    
  6. Show Command Output

    > git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - -S
    error: gpg failed to sign the data
    fatal: failed to write commit object
    

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:16
  • Comments:29

github_iconTop GitHub Comments

10reactions
swills1commented, Oct 20, 2021

Same issue here. I am on Windows10 using SSH and developing on Fedora. The following gets it to work, but the steps must be repeated every time you re-open VSCode.

  1. Manually run export GPG_TTY=$(tty)
  2. Run echo "test" | gpg2 --clearsign enter password
  3. You can now perform signed commits using the Terminal and VSCode GUI. (If code signing is enabled / setup)

If you don’t do step 1 and go straight to step 2, you get this error;

gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device
7reactions
its-DomeEcommented, Sep 10, 2021

I can confirm the problem. I am using remote SSH from a Windows machine developing on a Linux machine. I have export GPG_TTY=$(tty) in my .profile. But I have to manually export it in the console and sign something once in the console (e.g. echo "test" | gpg2 --clearsign) to be able to use VSCode to use signed git commits.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Git: gpg failed to sign the data' in visual studio code
What I have noticed is that after committing without signing, it will work immediately after: I get prompted for my key passphrase the...
Read more >
GPG signing commits over ssh - Waylon Walker
This is the error message I was seeing. gpg failed to sign the data ssh. The fix. The fix ended up ...
Read more >
gpg failed to sign the data · Yubikey Handbook - Rui Marinho
This means you have blocked the normal PIN due to many incorrect attempts. The third PIN represents the retry counter for the Admin...
Read more >
Sign commits with GPG keys | IntelliJ IDEA Documentation
Download and install the Gpg4Win package and make sure that git config gpg.program points to the gpg.exe file from the package by doing...
Read more >
GPG | Tower Help
Enable signing either in the GPG section of the repository settings or the global git config in the application preferences and make sure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found