argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18.07k stars 5.53k forks source link

argo-repo-server issue: gpg ... --gen-key failed exit status 2 #9809

Open nice-pink opened 2 years ago

nice-pink commented 2 years ago

Checklist:

Describe the bug

After upgrading argo-cd from version v2.3.5 to v.2.4.3 the argo-repo-server stopped working with the logs:

argocd-repo-server time="2022-06-28T16:18:42Z" level=info msg="Generating self-signed gRPC TLS certificate for this session"                                                     │
│ argocd-repo-server time="2022-06-28T16:18:42Z" level=info msg="Initializing GnuPG keyring at /app/config/gpg/keys"                                                               │
│ argocd-repo-server time="2022-06-28T16:18:42Z" level=info msg="gpg --no-permission-warning --logger-fd 1 --batch --gen-key /tmp/gpg-key-recipe301546403" dir= execID=f1898       │
│ argocd-repo-server time="2022-06-28T16:18:48Z" level=error msg="`gpg --no-permission-warning --logger-fd 1 --batch --gen-key /tmp/gpg-key-recipe301546403` failed exit status 2" │
│ argocd-repo-server time="2022-06-28T16:18:48Z" level=info msg=Trace args="[gpg --no-permission-warning --logger-fd 1 --batch --gen-key /tmp/gpg-key-recipe301546403]" dir= opera │
│ argocd-repo-server time="2022-06-28T16:18:48Z" level=fatal msg="`gpg --no-permission-warning --logger-fd 1 --batch --gen-key /tmp/gpg-key-recipe301546403` failed exit status 2" │

This leads to Argo CD UI showing error:

rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 10.3.43.220:8081: connect: connection refused"

To Reproduce

For me it was just the upgrade.

Expected behavior

argo-repo-server starts up without errors.

Screenshots

Version

argocd: v2.1.3+d855831.dirty
  BuildDate: 2021-09-30T22:11:24Z
  GitCommit: d855831540e51d8a90b1006d2eb9f49ab1b088af
  GitTreeState: dirty
  GoVersion: go1.17.1
  Compiler: gc
  Platform: darwin/amd64
argocd-server: v2.4.3+471685f
mohahmed13 commented 10 months ago

Just in case it helps anyone in the future. We were running into this issue on only a couple of nodes where the repo server was being deployed. I saw this https://github.com/argoproj/argo-cd/issues/9888#issuecomment-1383684675 which hinted at a Docker version discrepancy. After upgrading Docker to latest version things started to work without any workarounds.

docker://20.10.17 was failing, docker://20.10.18 and higher is working.

julian-waibel commented 8 months ago

@mohahmed13: Thanks for the info! I will also document my case for the community, note the Docker version details:

My case

Deploying "official" Argo CD Helm chart v6.7.2, which uses Argo CD v2.10.3, to on-prem RKE1 (Rancher Kubernetes Engine) based Kubernetes clusters.

❌ Cluster/node setup not working out-of-the-box

Version: v1.24.17
OS: Ubuntu 20.04.2 LTS
Container Runtime:  Docker 20.10.7

Needs the seccompProfile: type: Unconfined fix described above to work, so that the Argo CD repo server pods stop keeping crashing.

✅ Cluster/node setup working out-of-the-box

Version: v1.24.17
OS: Ubuntu 20.04.4 LTS
Container Runtime:  Docker 20.10.14