-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix(git): fix gpg commit signing (#32483) #32543
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a link to any docs describing why this is necessary? Eg was it a change of GPG version from Ubuntu 20 to 24?
Hi @rarkins. GPG was upgraded from 2.2.19 to 2.4.4. After digging more into this to answer your question, I have a reason why this is happening. The overlooked bit in the error message was "WARNING: key xxx contains preferences for unavailable algorithms". Whether a change in gpg itself or in Ubuntu's configured algorithms I'm not sure, but there is a difference in supported algorithms between the 2 renovate images:
vs
It would appear that my gpg key contains some now-unsupported algorithms (IDEA, 3DES, CAST5 specifically) in its preferences. This appears to be only a warning, since if they key is imported (via adding these 2 flags), it is still able to be used to sign (as it also contains preferences for still-supported ciphers). If I try and import this key within a tty, gpg will automatically enter into an interactive, preferences update mode:
This is what's causing the TTY error when invoked from Renovate. It is in fact the
So, to wrap up... |
🎉 This PR is included in version 39.18.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Changes
After upgrading to Renovate 39, committing using GPG keys began failing with the error message
cannot open '/dev/tty': No such device or address
.This change adds the
--no-tty
and--batch
commands to thegpg
import of the private key.These flags are described in the manpage as:
I am not sure that
--batch
is strictly necessary to fix this issue, but it does seem to be recommended in this usage.Context
This references discussion #32483.
I have not been able to build renovate here to test these exact changes. I did however override the
gpg
command in the docker image to insert the 2 flags into the command, and this did solve the issue.Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: