Lando with Drupal 8: Docker not starting

Hello, I’m trying to run Lando with the Drupal 8 recipe (lando init).
I already had installed Docker from official repos, then installed Lando (not git version) from AUR.
When trying to lando start an app in the directory containing my code, I first got this error:

Unhandled rejection Error: Could not automatically start the Docker Daemon. Please manually start it to continue.                                         
    at /snapshot/lando/build/cli/lib/daemon.js                               
    From previous event:                                                         
    at LandoDaemon.up (/snapshot/lando/build/cli/lib/daemon.js)              
    at Object.eventWrapper (/snapshot/lando/build/cli/lib/router.js)         
    at Engine.engineCmd (/snapshot/lando/build/cli/lib/engine.js)            
    at Engine.list (/snapshot/lando/build/cli/lib/engine.js)                 
    at AsyncEvents.<anonymous> (/snapshot/lando/build/cli/plugins/lando-core/app.js)                                                                      
    at AsyncEvents.handle (/snapshot/lando/build/cli/lib/events.js)          
    at /snapshot/lando/build/cli/lib/events.js                               
    From previous event:                                                         
    at AsyncEvents.emit (/snapshot/lando/build/cli/lib/events.js)            
    at /snapshot/lando/build/cli/lib/app.js                                  
    From previous event:                                                         
    at App.init (/snapshot/lando/build/cli/lib/app.js)                       
    at /snapshot/lando/build/cli/bin/lando.js                                
    From previous event:                                                         
    at Object.<anonymous> (/snapshot/lando/build/cli/bin/lando.js)           
    at Module._compile (pkg/prelude/bootstrap.js:1320:22)                    
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:10)
    at Module.load (internal/modules/cjs/loader.js:984:32)                   
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)         
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1375:12)            
    at internal/main/run_main_module.js:17:47                                

    Unhandled rejection Error: Could not automatically start the Docker Daemon. Please manually start it to continue.                                         
    at /snapshot/lando/build/cli/lib/daemon.js                               
    From previous event:                                                         
    at LandoDaemon.up (/snapshot/lando/build/cli/lib/daemon.js)              
    at Object.eventWrapper (/snapshot/lando/build/cli/lib/router.js)         
    at Engine.engineCmd (/snapshot/lando/build/cli/lib/engine.js)            
    at Engine.list (/snapshot/lando/build/cli/lib/engine.js)                 
    at AsyncEvents.<anonymous> (/snapshot/lando/build/cli/plugins/lando-core/app.js)                                                                      
    at AsyncEvents.handle (/snapshot/lando/build/cli/lib/events.js)          
    at /snapshot/lando/build/cli/lib/events.js                               
    From previous event:                                                         
    at AsyncEvents.emit (/snapshot/lando/build/cli/lib/events.js)            
    at /snapshot/lando/build/cli/lib/app.js                                  
    From previous event:                                                         
    at App.init (/snapshot/lando/build/cli/lib/app.js)                       
    at /snapshot/lando/build/cli/bin/lando.js                                
    From previous event:                                                         
    at Object.<anonymous> (/snapshot/lando/build/cli/bin/lando.js)           
    at Module._compile (pkg/prelude/bootstrap.js:1320:22)                    
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:10)
    at Module.load (internal/modules/cjs/loader.js:984:32)                   
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)         
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1375:12)            
    at internal/main/run_main_module.js:17:47

I started docker: sudo systemctl start docker and tried lando restart again:

Stopping and restarting your app...Shiny!
WARN ==> docker is not running! 
Starting docker up before we begin... please wait...
[sudo] Passwort für ben: 
ERROR ==> Could not automatically start the Docker Daemon. Please manually start it to continue.

To check on Docker, I did

[ben@paul-mnj cms-intro]$ sudo systemctl status docker
docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
     Active: active (running) since Tue 2020-10-06 20:14:55 CEST; 19min ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 26358 (dockerd)
      Tasks: 13
     Memory: 120.9M
     CGroup: /system.slice/docker.service
             └─26358 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Okt 06 20:14:55 paul-mnj dockerd[26358]: time="2020-10-06T20:14:55.393887216+02:00" level=warning msg="Your kernel does not support cgroup blkio weight"
Okt 06 20:14:55 paul-mnj dockerd[26358]: time="2020-10-06T20:14:55.393892779+02:00" level=warning msg="Your kernel does not support cgroup blkio weight_device"
Okt 06 20:14:55 paul-mnj dockerd[26358]: time="2020-10-06T20:14:55.394062733+02:00" level=info msg="Loading containers: start."
Okt 06 20:14:55 paul-mnj dockerd[26358]: time="2020-10-06T20:14:55.483291380+02:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --b>
Okt 06 20:14:55 paul-mnj dockerd[26358]: time="2020-10-06T20:14:55.518274091+02:00" level=info msg="Loading containers: done."
Okt 06 20:14:55 paul-mnj dockerd[26358]: time="2020-10-06T20:14:55.577697834+02:00" level=warning msg="Not using native diff for overlay2, this may cause degraded performance for building >
Okt 06 20:14:55 paul-mnj dockerd[26358]: time="2020-10-06T20:14:55.577934282+02:00" level=info msg="Docker daemon" commit=48a66213fe graphdriver(s)=overlay2 version=19.03.12-ce
Okt 06 20:14:55 paul-mnj dockerd[26358]: time="2020-10-06T20:14:55.578271231+02:00" level=info msg="Daemon has completed initialization"
Okt 06 20:14:55 paul-mnj systemd[1]: Started Docker Application Container Engine.
Okt 06 20:14:55 paul-mnj dockerd[26358]: time="2020-10-06T20:14:55.598784111+02:00" level=info msg="API listen on /run/docker.sock"

So yeah, Docker is runnning, but Lando thinks it isn’t… what gives?

It is maybe obvious and you probably already taken care of it, but is the user that runs the lando command allowed to use docker?

I was actually not thinking about that since I thought sudo should take care of that… no?
It is actually the first time I’m trying to make use of Docker, and it hasn’t crossed my mind that other applications wouldn’t be allowed to use it when it’s running.
You’d think this type of thing would come up quickly in an internet search (it hasn’t, for me), or my web dev professor would know about it (he doesn’t)… He just recommended to not use distro packages but download everything from the website, which is supposed to make official instructions apply correctly to what I’m seeing on the screen. They all tend to do that when something isn’t working in Linux: don’t make us of Linux-specific ressources.

  • Any pointers how to allow Lando into Docker?

I now did this:

[ben@paul-mnj ~]$ sudo usermod -aG docker $USER

[ben@paul-mnj cms-intro]$ cat /etc/group | grep docker
docker:x:963:ben

Still getting:

[ben@paul-mnj cms-intro]$ lando start
...
Let's get this party started! Starting app cms-oppermann...
WARN ==> docker is not running! 
Starting docker up before we begin... please wait...
ERROR ==> Could not automatically start the Docker Daemon. Please manually start it to continue.

after having started Docker manually.
Is there a difference between Lando being allowed to start the Docker service and being allowed to use it?

Yes of course. Only root can start a system service thru systemd. Using docker can everyone that is in the docker group.

After you added yourself to the docker group, did you locked out and in again or did you do a reboot. This is required.

Just to be sure, reboot your system now. After that check if the docker service is running

systemctl status docker 

If not start it. You might want to enable docker, this means docker start automatically. Please run all systemctl commands without sudo, if the command requires root permissions it will promt for a password.

systemctl start docker 

or

systemctl enable --now docker 

which enables and starts the service.

After that try the hello-world docker.

docker run hello-world

If that works try something more advance.

For example Drupal 8 | Lando

mkdir  ~/landotest
cd ~/landotest
lando init \
  --source remote \
  --remote-url https://ftp.drupal.org/files/projects/drupal-8.9.0.tar.gz \
  --remote-options="--strip-components 1" \
  --recipe drupal8 \
  --webroot . \
  --name my-first-drupal8-app
lando start

I tried it in a VM and it worked perfectly with the AUR lando package.


edit: please do not use sudo with any command I posted.

1 Like

The systemctl commands don’t work without sudo, do they?
I rebooted and reinstalled Lando downloading it from their site (docs.lando.dev/ basics/ installation.html#arch).
I now definitely got beyond the Docker issue, Lando seems to be making use of it and is downloading big things now:

Sure they do: they will prompt for authentication if they need elevated permissions.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.