gpg failed to sign the data
Fabian Blechschmidt
I was doing some work, when suddenly my git failed to commit changed.
error: gpg failed to sign the data
fatal: failed to write commit object
I dig a little around, asked StackOverflow but it didn’t help. Finally when running the commit manually and not through PHPStorm I got a proper error:
-> % git -c core.quotepath=false -c log.showSignature=false commit -m"Remove unused label config"
error: gpg failed to sign the data:
[GNUPG:] KEYEXPIRED 1740054190
[GNUPG:] KEY_CONSIDERED 284B8D92EFA372D24E87504F9642FF72DD74A248 3
gpg: skipped "0x9642FF72DD74A248": Unusable secret key
[GNUPG:] INV_SGNR 9 0x9642FF72DD74A248
[GNUPG:] FAILURE sign 54
gpg: signing failed: Unusable secret key
fatal: failed to write commit object
Ah! The key is expired! Got it.
Did you know you can extend a GPG key? I did 😀
I quote the answer here, thanks Sauce McBoss !
Yes, you can renew it at any time. Here’s how to do it:
gpg --list-keys
gpg --edit-key (key id)
Now you’re in the gpg console. (By default, you’re working on the primary key.) If you need to update a sub-key:
gpg> key 1
Now you can set the expiration for the selected key:
gpg> expire
(follow prompts)
gpg> save
Now that you’ve updated your key, you can send it out:
gpg --keyserver pgp.mit.edu --send-keys (key id)
And, yes, having an expiration date for your keys is a very good idea. You should never really have a key with no expiration date. If it’s compromised, it could be used forever.
Other articles from this category
ENABLE_SERVICES: the Shopware env var that quietly installs apps on your shop
I was grepping through vendor/shopware/core for the hidden-gems series and stumbled over Shopware\Core\Service\AllServiceInstaller. Two-argument constructor, twelve lines of logic, @internal. Nothing dramatic — until I read what it actually does: it installs apps on your shop. By itself. In production. Once a day. Unless you told it not to. So this one isn’t going to […]
Shopware 6 Hidden Gems #24: Lightning round — ten small gems that didn’t need their own post
Twenty-three parts into this series, my research folder still has a stack of finds that are real, useful, undocumented — and about two paragraphs big. Instead of stretching each into a full post, here’s the lightning round. One problem, one gem, one file reference. Go. 1. rawUrl() — URLs for mail templates that actually work […]
Shopware 6 Hidden Gems #23: Why your sitemap silently stopped updating (and sitemap:generate –force)
A slow-burn bug report, verbatim from memory: „Google Search Console shows our sitemap is three months old. New categories aren’t in it.“ Three months. No errors in the log worth noticing, the scheduled task looks healthy, and regenerating „worked“ — or seemed to. The cause turned out to be a mechanism that’s completely reasonable and […]