sail: Build Error ( Sail up / Sail Build ): "gpg: keyserver receive failed: Server indicated a failure."
- 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
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 9
- Comments: 18 (3 by maintainers)
@cdterry87 try editing to this and see if it works:
&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C \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.
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.
Glad I could help. Take care my good sir.
Try
sail build --no-cache