outline-server icon indicating copy to clipboard operation
outline-server copied to clipboard

Setup script fails while installing Docker: "because the public key is not available: NO_PUBKEY ..."

Open fortuna opened this issue 5 years ago • 13 comments

The installation fails on some systems. Oddly enough, it doesn't fail on DigitalOcean or GCP.

This is what the failure looks like:

$ sudo bash -c "$(wget -qO- https://raw.githubusercontent.com/Jigsaw-Code/outline-server/master/src/server_manager/install_scripts/install_server.sh)"
> Verifying that Docker is installed .......... NOT INSTALLED
> Would you like to install Docker? This will run 'curl https://get.docker.com/ | sh'. [Y/n] 
> Installing Docker ........................... Docker installation failed, please visit https://docs.docker.com/install for instructions.

Last error: # Executing docker install script, commit: 93d2499759296ac1f9c510605fef85052a2c32be
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg
gpg: WARNING: unsafe ownership on homedir '/home/fortuna/.gnupg'
+ sh -c echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu bionic stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
W: GPG error: https://download.docker.com/linux/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
E: The repository 'https://download.docker.com/linux/ubuntu bionic InRelease' is not signed.

Sorry! Something went wrong. If you can't figure this out, please copy and paste all this output into the Outline Manager screen, and send it to us, to see if we can help you.
Full log: /tmp/outline_logqBP

The file /usr/share/keyrings/docker-archive-keyring.gpg is created. However it seems apt-get can't read the key, resulting in failure, even though it's running as root (why??).

$ ls -l /usr/share/keyrings/docker-archive-keyring.gpg
-rw-rw---- 1 root root 2760 Jan  6 17:45 /usr/share/keyrings/docker-archive-keyring.gpg

$ sudo apt-get update -qq
W: GPG error: https://download.docker.com/linux/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
E: The repository 'https://download.docker.com/linux/ubuntu bionic InRelease' is not signed.

Changing the permission to a+r fixes the problem:

$ sudo chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg

$ ls -l /usr/share/keyrings/docker-archive-keyring.gpg
-rw-rw-r-- 1 root root 2760 Jan  6 17:45 /usr/share/keyrings/docker-archive-keyring.gpg

$ sudo apt-get update -qq

$ (no errors)

Original complaint on Reddit: https://www.reddit.com/r/outlinevpn/comments/oxn9hx/cannot_install_outline_server_to_ubuntu_20042_lts/

fortuna avatar Aug 06 '21 23:08 fortuna

It doesn't work on Ubuntu 18.04.4/5 either. I tried many ways to register Public key for docker repository or whatever, but eventually it does not work. It seems it is not the problem of Outline, though. Maybe fix will be out soon... hopefully.

cadenzah avatar Aug 14 '21 08:08 cadenzah

curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh

This helped me install Docker on aws lightsail. And then, install Outline Server

mayavolt avatar Aug 17 '21 16:08 mayavolt

We've investigated this a bit and believe it's an issue with the PGP key not getting updated in time. Our recommendation is to, as @IrishVoltik suggests, install Docker directly and run the script again.

cjhenck avatar Aug 17 '21 18:08 cjhenck

curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh

This helped me install Docker on aws lightsail. And then, install Outline Server

It doesn't work on Ubuntu 20.04 with aws lightsail or ec2. image

wzhonggo avatar Aug 26 '21 06:08 wzhonggo

curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh This helped me install Docker on aws lightsail. And then, install Outline Server

It doesn't work on Ubuntu 20.04 with aws lightsail or ec2. image

I guess this will work on 18 version of ubuntu.

warengonzaga avatar Sep 01 '21 11:09 warengonzaga

It doesn't work on Ubuntu 20.04 with aws lightsail or ec2.

I also work with Ubuntu 20.04 and Lightsail instance. You can try do this with new clean Lightsail instance

mayavolt avatar Sep 01 '21 20:09 mayavolt

It doesn't work on Ubuntu 20.04 with aws lightsail or ec2.

I also work with Ubuntu 20.04 and Lightsail instance. You can try do this with new clean Lightsail instance

I solved it by doing sudo apt-get install docker.io and it works like a charm.

warengonzaga avatar Sep 01 '21 20:09 warengonzaga

@WarenGonzaga I has create another outline server with Digital Ocean, it very easy to create.

wzhonggo avatar Sep 06 '21 10:09 wzhonggo

@WarenGonzaga I has create another outline server with Digital Ocean, it very easy to create.

I'm aware, I just want to use AWS.

warengonzaga avatar Sep 06 '21 10:09 warengonzaga

I hear it may be an issue with the default umask, and that this can also fix the problem:

sudo chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg

From https://stackoverflow.com/questions/60137344/docker-how-to-solve-the-public-key-error-in-ubuntu-while-installing-docker/68764068#68764068

/cc @bemasc

fortuna avatar Oct 07 '21 17:10 fortuna

@fortuna solution fixed the issue

mnlsrv avatar Oct 24 '21 03:10 mnlsrv

I fixed it by importing the key:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 7EA0A9C3F273FCD8

koola avatar Jan 06 '22 15:01 koola

Fixed by https://github.com/Jigsaw-Code/outline-server/pull/1029

fortuna avatar Jan 06 '22 18:01 fortuna