docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.97k forks source link

[google] Unable to locate package docker-ce-rootless-extras #4881

Closed asticode closed 3 years ago

asticode commented 3 years ago

Hi,

I'm experiencing issues when trying to create machines with the google driver starting 2 days ago. I'm getting Unable to locate package docker-ce-rootless-extras.

If I'm not posting this issue at the correct place, please tell me and I will close this issue.

Here's my command and its output :

$ docker-machine --debug create --driver google --google-username docker --google-project myproject --google-zone europe-west1-b --google-machine-type n1-highcpu-2 --google-machine-image debian-cloud/global/images/debian-9-stretch-v20210217 --google-disk-size 20 --google-disk-type pd-standard test

Docker Machine Version:  0.16.0, build 702c267f
Found binary path at /usr/local/bin/docker-machine
Launching plugin server for driver google
Plugin server listening at address 127.0.0.1:50617
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
(flag-lookup) Calling .GetCreateFlags
Found binary path at /usr/local/bin/docker-machine
Launching plugin server for driver google
Plugin server listening at address 127.0.0.1:50623
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(test) Calling .GetMachineName
(test) Calling .DriverName
(test) Calling .GetCreateFlags
(test) Calling .SetConfigFromFlags
Reading certificate data from /Users/myuser/.docker/machine/certs/ca.pem
Decoding PEM data...
Parsing certificate...
Reading certificate data from /Users/myuser/.docker/machine/certs/cert.pem
Decoding PEM data...
Parsing certificate...
Running pre-create checks...
(test) Calling .PreCreateCheck
(test) Check that the project exists
(test) Check if the instance already exists
(test) Calling .GetConfigRaw
Creating machine...
(test) Calling .Create
(test) Generating SSH Key
(test) Creating host...
(test) Opening firewall ports
(test) Creating instance
(test) Waiting for Instance
(test) DBG | Operation "operation-1617868808619-5bf716fa18620-e91cd32d-2b7fb087" status: RUNNING
(test) DBG | Operation "operation-1617868808619-5bf716fa18620-e91cd32d-2b7fb087" status: RUNNING
(test) DBG | Operation "operation-1617868808619-5bf716fa18620-e91cd32d-2b7fb087" status: RUNNING
(test) DBG | Operation "operation-1617868808619-5bf716fa18620-e91cd32d-2b7fb087" status: RUNNING
(test) DBG | Operation "operation-1617868808619-5bf716fa18620-e91cd32d-2b7fb087" status: RUNNING
(test) DBG | Operation "operation-1617868808619-5bf716fa18620-e91cd32d-2b7fb087" status: RUNNING
(test) DBG | Operation "operation-1617868808619-5bf716fa18620-e91cd32d-2b7fb087" status: RUNNING
(test) DBG | Operation "operation-1617868808619-5bf716fa18620-e91cd32d-2b7fb087" status: DONE
(test) Uploading SSH Key
(test) DBG | Operation "operation-1617868820908-5bf71705d07f7-a7b7596f-8a8cb78a" status: RUNNING
(test) DBG | Operation "operation-1617868820908-5bf71705d07f7-a7b7596f-8a8cb78a" status: RUNNING
(test) DBG | Operation "operation-1617868820908-5bf71705d07f7-a7b7596f-8a8cb78a" status: RUNNING
(test) DBG | Operation "operation-1617868820908-5bf71705d07f7-a7b7596f-8a8cb78a" status: DONE
(test) Calling .GetConfigRaw
(test) Calling .DriverName
(test) Calling .DriverName
Waiting for machine to be running, this may take a few minutes...
(test) Calling .GetState
Detecting operating system of created instance...
Waiting for SSH to be available...
Getting to WaitForSSH function...
(test) Calling .GetSSHHostname
(test) Calling .GetSSHPort
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /Users/myuser/.docker/machine/machines/test/id_rsa (-rw-------)
&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null docker@34.77.140.194 -o IdentitiesOnly=yes -i /Users/myuser/.docker/machine/machines/test/id_rsa -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
exit 0
SSH cmd err, output: <nil>:
Detecting the provisioner...
(test) Calling .GetSSHHostname
(test) Calling .GetSSHPort
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /Users/myuser/.docker/machine/machines/test/id_rsa (-rw-------)
&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null docker@34.77.140.194 -o IdentitiesOnly=yes -i /Users/myuser/.docker/machine/machines/test/id_rsa -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
cat /etc/os-release
SSH cmd err, output: <nil>: PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Couldn't set key VERSION_CODENAME, no corresponding struct field found
found compatible host: debian
Provisioning with debian...
No storagedriver specified, using overlay2

installing sudo
(test) Calling .GetSSHHostname
(test) Calling .GetSSHPort
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /Users/myuser/.docker/machine/machines/test/id_rsa (-rw-------)
&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null docker@34.77.140.194 -o IdentitiesOnly=yes -i /Users/myuser/.docker/machine/machines/test/id_rsa -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
if ! type sudo; then apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y sudo; fi
SSH cmd err, output: <nil>: sudo is /usr/bin/sudo

setting hostname
(test) Calling .GetMachineName
(test) Calling .GetSSHHostname
(test) Calling .GetSSHPort
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /Users/myuser/.docker/machine/machines/test/id_rsa (-rw-------)
&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null docker@34.77.140.194 -o IdentitiesOnly=yes -i /Users/myuser/.docker/machine/machines/test/id_rsa -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
sudo hostname test && echo "test" | sudo tee /etc/hostname
SSH cmd err, output: <nil>: test

(test) Calling .GetSSHHostname
(test) Calling .GetSSHPort
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /Users/myuser/.docker/machine/machines/test/id_rsa (-rw-------)
&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null docker@34.77.140.194 -o IdentitiesOnly=yes -i /Users/myuser/.docker/machine/machines/test/id_rsa -p 22] /usr/bin/ssh <nil>}
About to run SSH command:

        if ! grep -xq '.*\stest' /etc/hosts; then
            if grep -xq '127.0.1.1\s.*' /etc/hosts; then
                sudo sed -i 's/^127.0.1.1\s.*/127.0.1.1 test/g' /etc/hosts;
            else
                echo '127.0.1.1 test' | sudo tee -a /etc/hosts;
            fi
        fi
SSH cmd err, output: <nil>: 127.0.1.1 test

installing base packages
(test) Calling .GetSSHHostname
(test) Calling .GetSSHPort
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /Users/myuser/.docker/machine/machines/test/id_rsa (-rw-------)
&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null docker@34.77.140.194 -o IdentitiesOnly=yes -i /Users/myuser/.docker/machine/machines/test/id_rsa -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
sudo apt-get update
SSH cmd err, output: <nil>: Get:1 http://security.debian.org stretch/updates InRelease [53.0 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://packages.cloud.google.com/apt cloud-sdk-stretch InRelease [6,779 B]
Get:5 http://deb.debian.org/debian stretch-backports InRelease [91.8 kB]
Hit:6 http://deb.debian.org/debian stretch Release
Get:7 http://packages.cloud.google.com/apt google-compute-engine-stretch-stable InRelease [5,525 B]
Get:8 http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-stretch InRelease [5,555 B]
Get:9 http://security.debian.org stretch/updates/main Sources [342 kB]
Get:10 http://security.debian.org stretch/updates/main amd64 Packages [666 kB]
Get:11 http://security.debian.org stretch/updates/main Translation-en [306 kB]
Get:12 http://packages.cloud.google.com/apt cloud-sdk-stretch/main amd64 Packages [155 kB]
Get:14 http://packages.cloud.google.com/apt google-compute-engine-stretch-stable/main amd64 Packages [1,593 B]
Get:15 http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-stretch/main amd64 Packages [396 B]
Fetched 1,727 kB in 0s (1,944 kB/s)
Reading package lists...

package: action=install name=curl
(test) Calling .GetSSHHostname
(test) Calling .GetSSHPort
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /Users/myuser/.docker/machine/machines/test/id_rsa (-rw-------)
&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null docker@34.77.140.194 -o IdentitiesOnly=yes -i /Users/myuser/.docker/machine/machines/test/id_rsa -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y  curl
SSH cmd err, output: <nil>: Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (7.52.1-5+deb9u13).
0 upgraded, 0 newly installed, 0 to remove and 23 not upgraded.

installing docker
(test) Calling .GetSSHHostname
(test) Calling .GetSSHPort
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /Users/myuser/.docker/machine/machines/test/id_rsa (-rw-------)
&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null docker@34.77.140.194 -o IdentitiesOnly=yes -i /Users/myuser/.docker/machine/machines/test/id_rsa -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
if ! type docker; then curl -sSL https://get.docker.com | sh -; fi
SSH cmd err, output: exit status 100: bash: line 0: type: docker: not found
# Executing docker install script, commit: 7cae5f8b0decc17d6571f9f52eb840fbc13b2737
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sudo -E sh -c curl -fsSL "https://download.docker.com/linux/debian/gpg" | apt-key add -qq - >/dev/null
Warning: apt-key output should not be parsed (stdout is not a terminal)
+ sudo -E sh -c echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" > /etc/apt/sources.list.d/docker.list
+ sudo -E sh -c apt-get update -qq >/dev/null
+ [ -n  ]
+ sudo -E sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7, <> line 3.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
+ [ -n 1 ]
+ sudo -E sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce-rootless-extras >/dev/null
E: Unable to locate package docker-ce-rootless-extras

Error creating machine: Error running provisioning: error installing docker:
notifying bugsnag: [Error creating machine: Error running provisioning: error installing docker: ]

Thanks in advance

asticode commented 3 years ago

Replying to my own question here.

It seems this is caused by newer versions of Docker, I don't know which ones exactly, that needs this new package. My guess is that it's not yet available in GCP apt-get packages, hence the error.

I was previously working with v19.03.15 of Docker which was working fine. Therefore I've forked the machine project, added an engine-version flag that I need to set to 19.03.15 so that when executing the script located at https://get.docker.com/ it adds an environment variable VERSION=19.03.15.

You can find the fork here if you ever need the same fix. However I hope the docker-ce-rootless-extras package will soon be available.

Cheers