Repository navigation
gpg: signing failed: Inappropriate ioctl for device #83
Description
Activity
If remove Configure GPG Key step,logs:
creating settings.xml with server-id: hengyu; environment variables: username=$MAVEN_USERNAME, password=$MAVEN_CENTRAL_TOKEN, and gpg-passphrase=$MAVEN_GPG_PASSPHRASE writing /home/runner/.m2/settings.xml importing private key ##[error]The process '/usr/bin/gpg' failed with exit code 2Hello @hengboy ,
As stated in #43 and #91, all you have to do to solve theioctlissue is to add this configuration to Maven GPG plugin in your POM.
Also, you don't need your 'Configure GPG Key' step since this action now deals with it.Link is broken, FTR here's the piece of configuration to add to the Maven GPG plugin:
<configuration> <!-- Prevent gpg from using pinentry programs --> <gpgArguments> <arg>--pinentry-mode</arg> <arg>loopback</arg> </gpgArguments> </configuration>Reacted by Simone B., Mahdi Mohammadi, Sina Madani and leo jamesHello, everyone. I'm closing this issue, because documentation was updated in terms of this pull request. If you have any concerns feel free to reopen the issue.
Thanks @bissim @bjansen for help with providing solution and related links.Reacted by feechReacted by Bastien Jansen and Simone B.My noggin can't get this to work for one of my project, I have added the config above and my gpg plugin in the pom looks like this:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> <configuration> <gpgArguments> <arg>--pinentry-mode</arg> <arg>loopback</arg> </gpgArguments> </configuration> </plugin>And my gpg workflow step like this:
steps: - uses: actions/checkout@v2 - name: Set up Repository uses: actions/setup-java@v1 with: java-version: 15 server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD gpg-private-key: GPG_PRIVATE_KEY gpg-passphrase: GPG_PASSPHRASE env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}GPG_PRIVATE_KEY I exported with gpg --armor --export-secret-keys
All I ever get is "Error: The process '/usr/bin/gpg' failed with exit code 2" no matter how I twist and turn thisReacted by Sina Madani and JeremyDid you try not using an env variable for the GPG_PRIVATE_KEY ?
Like so :- uses: actions/checkout@v2 - name: Set up Repository uses: actions/setup-java@v1 with: java-version: 15 server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: GPG_PASSPHRASE env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}Reacted by Abdul Raheman Syed and Sina MadaniAh thanks! That did the work :)
Reacted by Abdul Raheman Syed- added a commit that references this issue
on May 12, 2021 Did you try not using an env variable for the GPG_PRIVATE_KEY ? Like so :
- uses: actions/checkout@v2 - name: Set up Repository uses: actions/setup-java@v1 with: java-version: 15 server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: GPG_PASSPHRASE env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}This is working
Thanks @bessonm
I encountered a problem like the title.
plugin config in
pom.xml