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

Build Error ( Sail up / Sail Build ): "gpg: keyserver receive failed: Server indicated a failure." #383

Closed
dmmiguel opened this issue Apr 12, 2022 · 18 comments · Fixed by #384
Labels

Comments

@dmmiguel
Copy link

  • Sail Version: 1.13.9
  • Laravel Version: 9.8.0
  • PHP Version: 8.1.
  • OS: Windows w/ WSL2

Description:

Build failure, appears to happen when attempting "sail up" or "sail build". The issue happens at line 21 in the dockerfile for the 8.1 runtime. A warning also appears stating that apt-key is deprecated.

Line: 21 in /vendor/laravel/sail/runtimes/8.1/Dockerfile
&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \

Error:
gpg: keyserver receive failed: Server indicated a failure

Temporary Solution (Workaround): I was able to get this working by modifying line 21 to the following value. (Not sure if this is the right thing to do but it worked)

  • changed from "hkps" -> hkp, I think this just changes the protocol
  • added ":80" to the end of "ubuntu.com" to change default port
  • added 0x to the beginning of the "14AA40EC0831756756D7F66C4F4EA0AAE5267A6C", no clue why this works but it was suggested on stack overflow. I noticed if I go here "https://keyserver.ubuntu.com/" and search for "14AA40EC0831756756D7F66C4F4EA0AAE5267A6C" nothing comes back. but if I search for: 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C a result comes back.

Disclaimer: I understand docker and docker compose fairly well but I only vaguely understand the modifications I made other than changing the protocol and adding something I found on stack overflow about adding a 0x to get things working.

&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \

Other solutions attempted:

  • Factory reset docker: failed
  • Shut down and restart WSL: failed
  • Reinstall docker: failed
  • Reinstall WSL: failed

Steps To Reproduce:

Run "sail up" or "sail build" on wsl terminal

@eaydogan
Copy link

Hi @dmmiguel
Can you please try these commands before docker build.

 docker system prune --force
 docker volume prune --force

Warning: These commands will erase your existing volumes.

@dmmiguel
Copy link
Author

dmmiguel commented Apr 13, 2022

@eaydogan

Thanks for the suggestion. I have tried that and still gotten the same error. It only appears to work when I modify the Docker file with the settings I listed.

@driesvints
Copy link
Member

Try sail build --no-cache

@dmmiguel
Copy link
Author

@driesvints

Thanks. I Attempted that as well. using both sail and regular docker-compose / docker-compose --no-cache and still the same error, Also tried docker system prune --force, docker volume prune --force before running the build command with no cache.

All my other docker-compose configurations work fine just not any sail projects (Without the modification).

I have also tried updating composer, creating a new Laravel app. and still get the same error. I think it the issue is with line 21 ,specifically as the dockerfile. It builds up to that point and dies when it receives no response from the gpg key server.

@driesvints
Copy link
Member

Thanks, I attempted a PR here: #384

@dmmiguel
Copy link
Author

Sweet thanks for the help guys :)

@cdterry87
Copy link

@driesvints I'm having the same or a similar issue, so I'm not sure if the issue is fully resolved. I manually updated the vendor/laravel/sail/runtimes/8.1/Dockerfile with the changes in PR #384, but I'm still receiving the error regarding apt-key below when running ./vendor/bin/sail up:

#0 68.66 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
#0 68.67 Executing: /tmp/apt-key-gpghome.ML0xqbW7am/gpg.1.sh --homedir /root/.gnupg --keyserver hkps://keyserver.ubuntu.com --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C
#0 78.69 gpg: keyserver receive failed: Server indicated a failure

@dmmiguel
Copy link
Author

@cdterry87 try editing to this and see if it works:

&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \

  • change hkps:// to hkp://
  • add ':80' to the end of the domain "ubuntu.com"
  • make sure you have 0x in front of key value

can you verify it works? my coworker had the same issue and it fixed it for him as well

see the original info. should get you going at least. till it's fixed.

  • Sail Version: 1.13.9
  • Laravel Version: 9.8.0
  • PHP Version: 8.1.
  • OS: Windows w/ WSL2

Description:

Build failure, appears to happen when attempting "sail up" or "sail build". The issue happens at line 21 in the dockerfile for the 8.1 runtime. A warning also appears stating that apt-key is deprecated.

Line: 21 in /vendor/laravel/sail/runtimes/8.1/Dockerfile && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \

Error: gpg: keyserver receive failed: Server indicated a failure

Temporary Solution (Workaround): I was able to get this working by modifying line 21 to the following value. (Not sure if this is the right thing to do but it worked)

  • changed from "hkps" -> hkp, I think this just changes the protocol
  • added ":80" to the end of "ubuntu.com" to change default port
  • added 0x to the beginning of the "14AA40EC0831756756D7F66C4F4EA0AAE5267A6C", no clue why this works but it was suggested on stack overflow. I noticed if I go here "https://keyserver.ubuntu.com/" and search for "14AA40EC0831756756D7F66C4F4EA0AAE5267A6C" nothing comes back. but if I search for: 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C a result comes back.

Disclaimer: I understand docker and docker compose fairly well but I only vaguely understand the modifications I made other than changing the protocol and adding something I found on stack overflow about adding a 0x to get things working.

&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \

Other solutions attempted:

  • Factory reset docker: failed
  • Shut down and restart WSL: failed
  • Reinstall docker: failed
  • Reinstall WSL: failed

Steps To Reproduce:

Run "sail up" or "sail build" on wsl terminal

@cdterry87
Copy link

@dmmiguel The fixes you suggested do work for me. Thanks so much for that!

@dmmiguel
Copy link
Author

@dmmiguel The fixes you suggested do work for me. Thanks so much for that!

Glad I could help. Take care my good sir.

@ifkas
Copy link

ifkas commented Apr 19, 2022

I can confirm that this also worked for me too! Thank you very much!
As info, I am on Windows 10 (Ubuntu 20.04 WSL) and the latest Docker 4.7.1

@imadyaici
Copy link

@dmmiguel I can confirm this solves the problem for me too.
The changes made on this PR doesn't solve the issue, is there a way to inform the maintainers about this? @driesvints

@driesvints
Copy link
Member

Can anyone send in a PR?

@ocorvu
Copy link

ocorvu commented Apr 22, 2022

  • Sail Version: 1.13.9
  • Laravel Version: 9.8.0
  • PHP Version: 8.1.
  • OS: Windows w/ WSL2

Description:

Build failure, appears to happen when attempting "sail up" or "sail build". The issue happens at line 21 in the dockerfile for the 8.1 runtime. A warning also appears stating that apt-key is deprecated.

Line: 21 in /vendor/laravel/sail/runtimes/8.1/Dockerfile && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \

Error: gpg: keyserver receive failed: Server indicated a failure

Temporary Solution (Workaround): I was able to get this working by modifying line 21 to the following value. (Not sure if this is the right thing to do but it worked)

  • changed from "hkps" -> hkp, I think this just changes the protocol
  • added ":80" to the end of "ubuntu.com" to change default port
  • added 0x to the beginning of the "14AA40EC0831756756D7F66C4F4EA0AAE5267A6C", no clue why this works but it was suggested on stack overflow. I noticed if I go here "https://keyserver.ubuntu.com/" and search for "14AA40EC0831756756D7F66C4F4EA0AAE5267A6C" nothing comes back. but if I search for: 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C a result comes back.

Disclaimer: I understand docker and docker compose fairly well but I only vaguely understand the modifications I made other than changing the protocol and adding something I found on stack overflow about adding a 0x to get things working.

&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \

Other solutions attempted:

  • Factory reset docker: failed
  • Shut down and restart WSL: failed
  • Reinstall docker: failed
  • Reinstall WSL: failed

Steps To Reproduce:

Run "sail up" or "sail build" on wsl terminal

Work here.
Win10
WSL2
Ubuntu 22.04LTS

@umutphp
Copy link

umutphp commented Apr 23, 2022

@cdterry87 try editing to this and see if it works:

&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \

  • change hkps:// to hkp://
  • add ':80' to the end of the domain "ubuntu.com"
  • make sure you have 0x in front of key value

can you verify it works? my coworker had the same issue and it fixed it for him as well

see the original info. should get you going at least. till it's fixed.

  • Sail Version: 1.13.9
  • Laravel Version: 9.8.0
  • PHP Version: 8.1.
  • OS: Windows w/ WSL2

Description:

Build failure, appears to happen when attempting "sail up" or "sail build". The issue happens at line 21 in the dockerfile for the 8.1 runtime. A warning also appears stating that apt-key is deprecated.
Line: 21 in /vendor/laravel/sail/runtimes/8.1/Dockerfile && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \
Error: gpg: keyserver receive failed: Server indicated a failure
Temporary Solution (Workaround): I was able to get this working by modifying line 21 to the following value. (Not sure if this is the right thing to do but it worked)

  • changed from "hkps" -> hkp, I think this just changes the protocol
  • added ":80" to the end of "ubuntu.com" to change default port
  • added 0x to the beginning of the "14AA40EC0831756756D7F66C4F4EA0AAE5267A6C", no clue why this works but it was suggested on stack overflow. I noticed if I go here "https://keyserver.ubuntu.com/" and search for "14AA40EC0831756756D7F66C4F4EA0AAE5267A6C" nothing comes back. but if I search for: 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C a result comes back.

Disclaimer: I understand docker and docker compose fairly well but I only vaguely understand the modifications I made other than changing the protocol and adding something I found on stack overflow about adding a 0x to get things working.
&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \
Other solutions attempted:

  • Factory reset docker: failed
  • Shut down and restart WSL: failed
  • Reinstall docker: failed
  • Reinstall WSL: failed

Steps To Reproduce:

Run "sail up" or "sail build" on wsl terminal

@dmmiguel your suggestion solved my problem too.

@ethanclevenger91
Copy link

Ran into this issue as well, with the update from @driesvints's PR applied.

Swapping to the unencrypted keyserver endpoint worked. Not sure why the request to the encrypted keyserver is failing vs the unencrypted one. I could certainly put in a PR, but that feels like an upstream problem to me. Don't know if there are other opinions on that.

@jamsilver
Copy link

  • Sail Version: 1.13.9
  • Laravel Version: 9.8.0
  • PHP Version: 8.1.
  • OS: Windows w/ WSL2

Description:

Build failure, appears to happen when attempting "sail up" or "sail build". The issue happens at line 21 in the dockerfile for the 8.1 runtime. A warning also appears stating that apt-key is deprecated.

Line: 21 in /vendor/laravel/sail/runtimes/8.1/Dockerfile && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \

Error: gpg: keyserver receive failed: Server indicated a failure

Temporary Solution (Workaround): I was able to get this working by modifying line 21 to the following value. (Not sure if this is the right thing to do but it worked)

  • changed from "hkps" -> hkp, I think this just changes the protocol
  • added ":80" to the end of "ubuntu.com" to change default port
  • added 0x to the beginning of the "14AA40EC0831756756D7F66C4F4EA0AAE5267A6C", no clue why this works but it was suggested on stack overflow. I noticed if I go here "https://keyserver.ubuntu.com/" and search for "14AA40EC0831756756D7F66C4F4EA0AAE5267A6C" nothing comes back. but if I search for: 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C a result comes back.

Disclaimer: I understand docker and docker compose fairly well but I only vaguely understand the modifications I made other than changing the protocol and adding something I found on stack overflow about adding a 0x to get things working.

&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \

Other solutions attempted:

  • Factory reset docker: failed
  • Shut down and restart WSL: failed
  • Reinstall docker: failed
  • Reinstall WSL: failed

Steps To Reproduce:

Run "sail up" or "sail build" on wsl terminal

I'm following the instructions at https://laravel.com/docs/9.x/installation to have a play with Laravel and can confirm that tweaking this line fixed this issue for me today.

@dmmiguel
Copy link
Author

@Evertt Thanks for putting in the PR and getting this fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants