# Error during provision on local vm - Add Nginx APT key

**URL:** https://discourse.roots.io/t/error-during-provision-on-local-vm-add-nginx-apt-key/21506
**Category:** trellis
**Tags:** trellis, nginx
**Created:** 2021-10-01T15:32:33Z
**Posts:** 6

## Post 1 by @Mirko_Picaro — 2021-10-01T15:32:34Z

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](https://nginx.org/keys/nginx_signing.key) --recv ABF5BD827BD9BF62”, “msg”: “Error fetching key ABF5BD827BD9BF62 from keyserver: [https://nginx.org/keys/nginx\_signing.key](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](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](https://nginx.org/keys/nginx_signing.key) --recv ABF5BD827BD9BF62”]}

How can i fix this?

---

## Post 2 by @vburlak — 2021-10-01T21:03:45Z

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

---

## Post 3 by @erit — 2021-10-02T06:30:46Z

I found [this issue](https://github.com/roots/trellis/issues/1213) 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 )

---

## Post 4 by @lukasz-gorski — 2021-10-02T07:34:11Z

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

---

## Post 5 by @mariusmateoc — 2021-10-02T22:32:32Z

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?

---

## Post 6 by @Mirko_Picaro — 2021-10-04T08:03:54Z

> [@erit](#):
>
> `nginx_keyserver: "http://nginx.org/keys/nginx_signing.key"`

this solution works on local vm.

---

## Post 7 by @system — 2021-11-12T15:33:33Z

This topic was automatically closed after 42 days. New replies are no longer allowed.
