canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.51k stars 632 forks source link

Error Launching instances: timed out waiting for initialization to complete. #3536

Open ManitejaDev opened 1 month ago

ManitejaDev commented 1 month ago

Describe the bug Describe what your problem is. Multipass throwing errors when trying to launch the instance from CLI. Tried to launch two instances of docker. Got the same error both times, however I was able to exec into second instance. I believe the cloud-init is taking a long time to finish.

To Reproduce How, and what happened? $ multipass launch docker --name manager launch failed: The following errors occurred: manager: timed out waiting for response

$ multipass exec manager -- lsb_release -a exec failed: ssh connection failed: 'Timeout connecting to 127.0.0.1'

$ multipass launch docker --name worker1 launch failed: The following errors occurred: timed out waiting for initialization to complete

$ multipass exec worker1 -- lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy

Expected behavior What did you expect to happen? Instances to initialize properly without timeout errors.

Other information: Was not able to properly launch new instances, even if I was able to ssh into them. I was not able to make one as docker worker node out of them. The docker swarm join is failing.

andrei-toterman commented 1 month ago

Hey, @ManitejaDev! Indeed the cloud-init of the docker blueprint might take too long to complete. You can try passing a longer timeout to the launch command using launch --timeout 1000 which will hopefully give it enough time (1000 seconds in this case).

ricab commented 1 month ago

Also, @ManitejaDev, the initialization continues in the background, even after that Multipass timeout. So if you wait for a little while longer, your instance should eventually finish setting up. When it does, it will have this file: /var/lib/cloud/instance/boot-finished.

ManitejaDev commented 1 month ago

I tried using timeout flag, but still have the trouble. $ multipass launch docker --name manager --timeout 1000 launch failed: The following errors occurred: manager: timed out waiting for response

$ multipass exec manager -- bash exec failed: ssh connection failed: 'Timeout connecting to 127.0.0.1'

$ multipass ls Name State IPv4 Image manager Running N/A Ubuntu 22.04 LTS

andrei-toterman commented 1 month ago

What OS are you running? Could you also give us the output of multipass get local.driver?

ManitejaDev commented 1 month ago

I use Windows. $ multipass get local.driver virtualbox

andrei-toterman commented 3 weeks ago

Hey, @ManitejaDev! Sorry for the late reply. One thing you could try is to use VirtualBox directly to see if the instances boot up correctly. You will need psexec for that. Once you get that in your PATH, run the following command in an Administrator shell (of course, change the VirtualBox location if you have it installed somewhere else):

psexec.exe -s -i "C:\Program Files\Oracle\VirtualBox\VirtualBox.exe"

This should bring up the VirtualBox GUI. From there, you can open up an instance and see its boot sequence. If it eventually arrives at a login screen, it means that the instance should've started correctly.

ricab commented 3 days ago

Hi @ManitejaDev, did you get a chance to try what @andrei-toterman suggested? Any new findings?