Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: gpg failed to sign the data #214

Open
ligi opened this issue Feb 13, 2025 · 5 comments
Open

error: gpg failed to sign the data #214

ligi opened this issue Feb 13, 2025 · 5 comments

Comments

@ligi
Copy link

ligi commented Feb 13, 2025

I am seeing this when trying challenge-0-simple-nft challenge-0-simple-nft

ligi@ligi-tp ~/t/ocd> npx [email protected] -e challenge-0-simple-nft challenge-0-simple-nft

 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Create Scaffold-ETH 2 app |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+



✔ 📁 Create project directory /home/ligi/tmp/ocd/challenge-0-simple-nft
✔ 🚀 Creating a new Scaffold-ETH 2 app in challenge-0-simple-nft with the scaffold-eth/se-2-challenges:challenge-0-simple-nft
  extension
✔ 📦 Installing dependencies with yarn, this could take a while
✔ 🪄 Formatting files
✖ Failed to initialize git repository
ERROR Error occurred Error: Failed to initialize git repository
    at createFirstGitCommit (file:///home/ligi/.npm/_npx/ef1264485657bf6a/node_modules/create-eth/dist/cli.js:621:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Task.run (file:///home/ligi/.npm/_npx/ef1264485657bf6a/node_modules/listr2/dist/index.js:2058:11) {
  [cause]: 'error: gpg failed to sign the data:\n' +
    '[GNUPG:] KEY_CONSIDERED 9E3F59F72C5225B2C2B73A918E81894010ABF23D 2\n' +
    '[GNUPG:] BEGIN_SIGNING H10\n' +
    '[GNUPG:] PINENTRY_LAUNCHED 13130 gnome3 1.2.1 - xterm-256color :1 - 1000/1000 -\n' +
    'gpg: signing failed: Operation cancelled\n' +
    '[GNUPG:] FAILURE sign 83886179\n' +
    'gpg: signing failed: Operation cancelled\n' +
    '\n' +
    'fatal: failed to write commit object'
}
Uh oh! 😕 Sorry about that! Exiting...

@carletex
Copy link
Collaborator

Hey Ligi! Thanks for reporting

It seems like the issue is related to your git setup.

Could you try doing the usual git workflow in a test folder? git init, git add -A, git commit -m "test" and see if it works?

@ligi
Copy link
Author

ligi commented Feb 13, 2025

yes - this works perfectly - I use git every day
But I used signed commits - guess this is the complication that breaks things here?

@carletex
Copy link
Collaborator

https://github.com/scaffold-eth/create-eth/blob/main/src/tasks/create-first-git-commit.ts

These are the commands being executed. Could you try these CDing into thechallenge-0-simple-nft folder?

@ligi
Copy link
Author

ligi commented Feb 13, 2025

when I executing the commit on the CLI it works fine. It asks my gpg password in the process - guess this is what fails here.

@ligi
Copy link
Author

ligi commented Feb 13, 2025

I can workaround it by doing:

[commit]
        gpgsign = false

in my gitconfig.

But it feels a bit bad. Maybe a git config --local commit.gpgsign false in create-first-git-commit.ts could remove this stone and not having much damage in the process?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants