Rails and Sidekiq are amassing gpg-agent processes
Summary
Import operations on GPG keys start and never kill gpg-agent processes.
Steps to reproduce
On a new omnibus installation on Debian 9: import a GPG key via the web interface. After that four gpg-agent processes are running.
What is the current bug behavior?
More and more gpg-agent processes run in the context of both the rail and the sidekiq service.
Gitlab does via GPGME:
- Import key, this starts the agent as gpg wants to know if there is a private key.
- List key to get UID, fingerprint and subkeys.
What is the expected correct behavior?
No gpg-agent processes running.
Relevant logs and/or screenshots
git 16021 0.0 0.0 43096 2720 ? Ss 18:13 0:00 gpg-agent --homedir /tmp/d20180202-15920-74bvm --use-standard-socket --daemon
git 16032 0.0 0.0 43096 2640 ? Ss 18:13 0:00 gpg-agent --homedir /tmp/d20180202-15920-1cmueza --use-standard-socket --daemon
git 16045 0.0 0.0 43096 2688 ? Ss 18:13 0:00 gpg-agent --homedir /tmp/d20180202-15920-xxh4mx --use-standard-socket --daemon
git 16064 0.0 0.0 43096 2744 ? Ss 18:13 0:00 gpg-agent --homedir /tmp/d20180202-15920-1aurq5b --use-standard-socket --daemon
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Debian 9.3 Current User: git Using RVM: no Ruby Version: 2.3.6p384 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.3.0 Redis Version: 3.2.11 Git Version: 2.14.3 Sidekiq Version:5.0.5 Go Version: unknownGitLab information Version: 10.4.2 Revision: b1c501c Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://35.204.72.250 HTTP Clone URL: https://35.204.72.250/some-group/some-project.git SSH Clone URL: git@35.204.72.250:some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 5.11.0 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ...GitLab Shell version >= 5.11.0 ? ... OK (5.11.0) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... can't check, you have no projects Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Reply by email is disabled in config/gitlab.yml Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... can't check, you have no projects Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.3.6) Git version >= 2.7.3 ? ... yes (2.14.3) Git user has default SSH configuration? ... yes Active users: ... 1
Checking GitLab ... Finished
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)