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.

The process '/usr/bin/gpg' failed with exit code 2

See original GitHub issue

Describe the bug

setup-swift fails on ubuntu-latest with The process '/usr/bin/gpg' failed with exit code 2. This looks like #77 reappeared. Full logs can be found below.

Workflow configuration (please complete the following information):

  • Platform (runs-on): ubuntu-latest
  • Swift version (swift-version): any, see 5.0 as example in logs below.
Run fwal/setup-swift@v1.11.0
  with:
    swift-version: 5.0
/usr/bin/gpg --import /home/runner/work/_temp/6f3cd87a-c90d-48ae-a6a4-9509bc4160d0
gpg: directory '/home/runner/.gnupg' created
gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
gpg: /home/runner/.gnupg/trustdb.gpg: trustdb created
gpg: key D441C977412B37AD: public key "Swift Automatic Signing Key #1 <swift-infrastructure@swift.org>" imported
gpg: key 9F597F4D21A56D5F: public key "Swift 2.2 Release Signing Key <swift-infrastructure@swift.org>" imported
gpg: key 63BC1CFE91D306C6: public key "Swift 3.x Release Signing Key <swift-infrastructure@swift.org>" imported
gpg: key EF5430F071E1B235: public key "Swift 4.x Release Signing Key <swift-infrastructure@swift.org>" imported
gpg: key 7638F1FB2B2B08C4: public key "Swift Automatic Signing Key #2 <swift-infrastructure@swift.org>" imported
gpg: key 925CC1CCED3D1561: public key "Swift 5.x Release Signing Key <swift-infrastructure@swift.org>" imported
gpg: key FAF6989E1BC16FEA: public key "Swift Automatic Signing Key #3 <swift-infrastructure@swift.org>" imported
gpg: key 925CC1CCED3D1561: "Swift 5.x Release Signing Key <swift-infrastructure@swift.org>" 1 new signature
gpg: key F167DF1ACF9CE069: public key "Swift Automatic Signing Key #4 <swift-infrastructure@forums.swift.org>" imported
gpg: Total number processed: 9
gpg:               imported: 8
gpg:         new signatures: 1
/usr/bin/gpg --keyserver hkp://pool.sks-keyservers.net --refresh-keys Swift
gpg: refreshing 8 keys from hkp://pool.sks-keyservers.net
gpg: keyserver refresh failed: No name
Warning: An error occurred when trying to refresh keys from hkp://pool.sks-keyservers.net: Error: The process '/usr/bin/gpg' failed with exit code 2
/usr/bin/gpg --keyserver ha.pool.sks-keyservers.net --refresh-keys Swift
gpg: refreshing 8 keys from hkp://ha.pool.sks-keyservers.net
gpg: keyserver refresh failed: No name
Warning: An error occurred when trying to refresh keys from ha.pool.sks-keyservers.net: Error: The process '/usr/bin/gpg' failed with exit code 2
/usr/bin/gpg --keyserver keyserver.ubuntu.com --refresh-keys Swift
gpg: refreshing 8 keys from hkp://keyserver.ubuntu.com
gpg: key F167DF1ACF9CE069: "Swift Automatic Signing Key #4 <swift-infrastructure@forums.swift.org>" not changed
gpg: key FAF6989E1BC16FEA: "Swift Automatic Signing Key #3 <swift-infrastructure@swift.org>" not changed
gpg: key 925CC1CCED3D1561: "Swift 5.x Release Signing Key <swift-infrastructure@swift.org>" not changed
gpg: key 7638F1FB2B2B08C4: "Swift Automatic Signing Key #2 <swift-infrastructure@swift.org>" not changed
gpg: key EF5430F071E1B235: "Swift 4.x Release Signing Key <swift-infrastructure@swift.org>" not changed
gpg: key 63BC1CFE91D306C6: "Swift 3.x Release Signing Key <swift-infrastructure@swift.org>" not changed
gpg: key 9F597F4D21A56D5F: "Swift 2.2 Release Signing Key <swift-infrastructure@swift.org>" not changed
gpg: key D441C977412B37AD: "Swift Automatic Signing Key #1 <swift-infrastructure@swift.org>" not changed
gpg: Total number processed: 8
gpg:              unchanged: 8
/usr/bin/gpg --verify /home/runner/work/_temp/e10b5e90-937d-4a19-a17b-03c60e7bbdd5 /home/runner/work/_temp/7a6475e2-2771-4bf1-a368-ed6196ce9cd6
gpg: no valid OpenPGP data found.
gpg: the signature could not be verified.
Please remember that the signature file (.sig or .asc)
should be the first file given on the command line.
Error: Unexpected error, unable to continue. Please report at https://github.com/fwal/setup-swift/issues
The process '/usr/bin/gpg' failed with exit code 2
Stacktrace:
Error: The process '/usr/bin/gpg' failed with exit code 2
    at ExecState._setResult (/home/runner/work/_actions/fwal/setup-swift/v1.11.0/dist/index.js:995:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/fwal/setup-swift/v1.11.0/dist/index.js:978:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/fwal/setup-swift/v1.11.0/dist/index.js:872:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:210:5)
    at Pipe.<anonymous> (net.js:659:12)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
Samasaur1commented, Feb 7, 2022

Turns out this fails on Swift 4.2.x, 5.0.x, and 5.1.x, on ubuntu-latest. I don’t understand GPG enough to explain why these are the only ones that don’t work, but if you can figure out how to view the GitHub Actions log here: https://github.com/Samasaur1/SwiftIP/actions/runs/1804797343 it may be userful

0reactions
fwalcommented, Feb 10, 2022

Fix released in 1.12.0 👍🏻

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Actions : How to resolve : "The process '/usr/bin/gpg ...
Someone know how we can fix this The process '/usr/bin/gpg' failed with exit code 2 for actions/setup-java@v3 ? java · maven · github-actions ......
Read more >
exit status - What does gpg error code 2 ...
Largely used GPF codes are of three types : 0 is success (all other values indicate a failure). 2 is usually used for...
Read more >
Failed to delete key · Issue #251 · actions/setup-java - GitHub
Removing private key from keychain Error: Failed to remove private key due to: The process '/usr/bin/gpg' failed with exit code 2 Cache hit...
Read more >
Debugging "Make Failed with Exit Code 2" Error - CodeForGeek
The “Make Failed with Exit Code 2” error occurs during the node modules installation. We see lots of stack trace including the one...
Read more >
running /usr/bin/gpg-agent failed (exitcode=2): general error ...
I spun up three Ubuntu 18 LTS VMs in Virtual Box. Connected the compute-node (master) to the other two compute-00 and compute-01. Linked...
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