Roots Discourse

Error during provision on local vm - Add Nginx APT key

Hey Guys,
When i try to provision on my local virtual machine, the task “Add Nginx APT key” return this error and I don’t understand why

TASK [nginx : Add Nginx APT key] ***********************************************
fatal: [default]: FAILED! => {“changed”: false, “cmd”: “/usr/bin/apt-key adv --no-tty --keyserver https://nginx.org/keys/nginx_signing.key --recv ABF5BD827BD9BF62”, “msg”: “Error fetching key ABF5BD827BD9BF62 from keyserver: https://nginx.org/keys/nginx_signing.key”, “rc”: 2, “stderr”: “Warning: apt-key output should not be parsed (stdout is not a terminal)\ngpg: keyserver receive failed: General error\n”, “stderr_lines”: [“Warning: apt-key output should not be parsed (stdout is not a terminal)”, “gpg: keyserver receive failed: General error”], “stdout”: “Executing: /tmp/apt-key-gpghome.VLVIKFTtJi/gpg.1.sh --no-tty --keyserver https://nginx.org/keys/nginx_signing.key --recv ABF5BD827BD9BF62\n”, “stdout_lines”: [“Executing: /tmp/apt-key-gpghome.VLVIKFTtJi/gpg.1.sh --no-tty --keyserver https://nginx.org/keys/nginx_signing.key --recv ABF5BD827BD9BF62”]}

How can i fix this?

+1
Same for me using a fresh Trellis 1.8.0 install with Ansible 2.9.10

I found this issue regarding Ubuntu 16, but the fix also works for Ubuntu 20.
add:
nginx_keyserver: "http://nginx.org/keys/nginx_signing.key"
to your group_vars/all/main file.

( changes it to http instead of https )

2 Likes

Confirm, having the same issue form yesterday.
@erit answer is fixing the issue.

Same here following official documentation using Trellis-CLI.
I’ve tried to use the latest bento-ubuntu-20.04 v202107.28.0 but getting the same error.
You can use the solution from @erit to provision local vm. Did anyone try on a remote server?

this solution works on local vm.