geerlingguy / ansible-role-php

Ansible Role - PHP
https://galaxy.ansible.com/geerlingguy/php/
MIT License
492 stars 442 forks source link

CI Tests started failing with 'gpg: [don't know]: invalid packet (ctb=0a)' #332

Closed geerlingguy closed 3 years ago

geerlingguy commented 3 years ago

Since Ansible 4.0.0's release, I've been seeing the following error in CI runs:

TASK [Add Ondrej Sury's apt key (Debian).] *************************************
fatal: [instance]: FAILED! => {"changed": false, "msg": "Unable to extract key from '-'", "stderr": "gpg: directory '/root/.gnupg' created\ngpg: keybox '/root/.gnupg/pubring.kbx' created\ngpg: WARNING: no command supplied.  Trying to guess what you mean ...\ngpg: [don't know]: invalid packet (ctb=0a)\ngpg: /root/.gnupg/trustdb.gpg: trustdb created\n", "stderr_lines": ["gpg: directory '/root/.gnupg' created", "gpg: keybox '/root/.gnupg/pubring.kbx' created", "gpg: WARNING: no command supplied.  Trying to guess what you mean ...", "gpg: [don't know]: invalid packet (ctb=0a)", "gpg: /root/.gnupg/trustdb.gpg: trustdb created"], "stdout": "pub:-:3072:1:B188E2B695BD4743:1552904095:1708072967::-:\nuid:::::::::DEB.SURY.ORG Automatic Signing Key <deb@sury.org>:\nsub:-:3072:1:B214EAC28059B8AC:1552904095:1708073009:::\n", "stdout_lines": ["pub:-:3072:1:B188E2B695BD4743:1552904095:1708072967::-:", "uid:::::::::DEB.SURY.ORG Automatic Signing Key <deb@sury.org>:", "sub:-:3072:1:B214EAC28059B8AC:1552904095:1708073009:::"]}

Formatted error:

gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
gpg: [don't know]: invalid packet (ctb=0a)
gpg: /root/.gnupg/trustdb.gpg: trustdb created

So... not sure what's causing it, but I couldn't reproduce with Ansible 3.x, only with 4.x.

The task in question:

    - name: Add Ondrej Sury's apt key (Debian).
      apt_key:
        url: https://packages.sury.org/php/apt.gpg
        state: present
      when: ansible_distribution == "Debian"
geerlingguy commented 3 years ago

Looks like a bug: https://github.com/ansible/ansible/issues/74770

geerlingguy commented 3 years ago

It looks like this could take a month or two to make it into a released version of Ansible (e.g. 4.0.1). sigh

SchizoDuckie commented 3 years ago

Looks to me like #74770 does not fix this. I am still experiencing this on ansible-core 2.11.1

stale[bot] commented 3 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

geerlingguy commented 3 years ago

Tests have been passing, so I think I can close this now.