Skip to content
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

[BUG] Management of GPG keys fails without error #62129

Closed
1 of 6 tasks
tuaris opened this issue Jun 1, 2022 · 0 comments · Fixed by #63162
Closed
1 of 6 tasks

[BUG] Management of GPG keys fails without error #62129

tuaris opened this issue Jun 1, 2022 · 0 comments · Fixed by #63162
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@tuaris
Copy link

tuaris commented Jun 1, 2022

Description
I am following the instructions https://docs.saltproject.io/en/latest/ref/states/all/salt.states.gpg.html#management-of-the-gpg-keychains. The GPG state for salt.states.gpg.present is not adding keys even though it says it's successful.

Setup
Example state for adding the GPG keys for RVM under the ubuntu user:

rvm-gpg:
  gpg.present:
    - name: rvm-gpg-keys
    - keys:
      - 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
      - 409B6B1796C275462A1703113804BB82D39DC0E3
    - user: ubuntu
    - keyserver: pool.sks-keyservers.net
    - trust: fully

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD

Steps to Reproduce the behavior
Try to apply the sample state above, run state.apply, observe successful result:

----------
          ID: rvm-gpg
    Function: gpg.present
        Name: rvm-gpg-keys
      Result: True
     Comment: Adding rvm-gpg-keys to GPG keychain
              Set trust level for 7D2BAF1CF37B13E2069D6956105BD0E739499BDB to fully
              Adding rvm-gpg-keys to GPG keychain
              Set trust level for 409B6B1796C275462A1703113804BB82D39DC0E3 to fully
     Started: 08:41:40.428047
    Duration: 20168.769 ms
     Changes:   

The keys however are not present:

~$ gpg --list-keys
<no output>

Expected behavior
The GPG keys should be present for the user and trusted

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3004.1
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
      dateutil: 2.7.3
     docker-py: Not Installed
         gitdb: 2.0.6
     gitpython: 3.0.7
        Jinja2: 2.10.1
       libgit2: 1.1.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.20
      pycrypto: Not Installed
  pycryptodome: 3.6.1
        pygit2: 1.6.1
        Python: 3.8.10 (default, Mar 15 2022, 12:22:08)
  python-gnupg: 0.4.5
        PyYAML: 5.3.1
         PyZMQ: 18.1.1
         smmap: 2.0.5
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.2
 
System Versions:
          dist: ubuntu 20.04 focal
        locale: utf-8
       machine: x86_64
       release: 5.11.0-1025-aws
        system: Linux
       version: Ubuntu 20.04 focal

Additional context
Found some similar issues that have no ultimate solution #36771 and #46414

Logs on the minion show:

2022-06-01 08:40:59,418 [gnupg            :1004][WARNING ][610776] gpg returned a non-zero error code: 2
2022-06-01 08:41:09,537 [gnupg            :1004][WARNING ][610776] gpg returned a non-zero error code: 2
2022-06-01 08:41:19,622 [gnupg            :1004][WARNING ][610776] gpg returned a non-zero error code: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant