Rootless Docker Install: Failed to start docker.service

Hi, I’m trying to install Rootless Docker on a shared cluster (to work with Slurm). However, I repeatedly ran into Failed to start docker.service issue. This persists after a fresh installation of Docker (after uninstalling Docker). Any help would be very valuable!

$ dockerd-rootless-setuptool.sh install
[WARNING] File already exists, skipping: /afs/.../.config/systemd/user/docker.service
[INFO] starting systemd service docker.service
+ systemctl --user start docker.service
Failed to start docker.service: Unit docker.service not found.
+ set +x
[ERROR] Failed to start docker.service. Run `journalctl -n 20 --no-pager --user --unit docker.service` to show the error log.
[ERROR] Before retrying installation, you might need to uninstall the current setup: `/usr/bin/dockerd-rootless-setuptool.sh uninstall -f ; /usr/bin/rootlesskit rm -rf /afs/.../.local/share/docker`
No journal files were opened due to insufficient permissions.

Hi

It seems like the uninstall you made didnt uninstall the service, you can try and delete the file it says its skipping in line 2 and retry the script

Thanks! Unfortunately, this didn’t solve the problem:

[INFO] Creating /afs/home/.config/systemd/user/docker.service
[INFO] starting systemd service docker.service
+ systemctl --user start docker.service
Failed to start docker.service: Unit docker.service not found.
+ set +x
[ERROR] Failed to start docker.service. Run `journalctl -n 20 --no-pager --user --unit docker.service` to show the error log.
[ERROR] Before retrying installation, you might need to uninstall the current setup: `/usr/bin/dockerd-rootless-setuptool.sh uninstall -f ; /usr/bin/rootlesskit rm -rf /afs/home/.local/share/docker`
No journal files were opened due to insufficient permissions.

Did you run the above commands?

Yes, but the problem persisted after this as well :confused:

Just want to follow up on the thread. In the end, it seems like placing docker.service in /etc/systemd/user (via sudo) instead of ~/.config/systemd/user/docker.service would work.

However, re-running the dockerd-rootless-setuptool.sh again ran into another problem:

[INFO] Creating [path removed for brevity]
[INFO] starting systemd service docker.service
+ systemctl --user start docker.service
Job for docker.service failed because the control process exited with error code.
See "systemctl --user status docker.service" and "journalctl --user -xe" for details.
+ set +x
[ERROR] Failed to start docker.service. Run `journalctl -n 20 --no-pager --user --unit docker.service` to show the error log.
[ERROR] Before retrying installation, you might need to uninstall the current setup: `/usr/bin/dockerd-rootless-setuptool.sh uninstall -f ; /usr/bin/rootlesskit rm -rf /afs/csail.mit.edu/u/h/hanguo/.local/share/docker`
No journal files were opened due to insufficient permissions.

Following the suggestion, I ran the journalctl command,

$ journalctl -n 20 --no-pager --user --unit docker.service
Hint: You are currently not seeing messages from the system.
      Users in groups 'adm', 'systemd-journal' can see all messages.
      Pass -q to turn off this notice.
No journal files were opened due to insufficient permissions.

Adding sudo,

$ sudo journalctl -n 20 --no-pager --user --unit docker.service
No journal files were found.

If this is helpful, here’s the status output

$ systemctl --user --no-pager --full status docker.service
● docker.service - Docker Application Container Engine (Rootless)
     Loaded: loaded (/etc/xdg/systemd/user/docker.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2024-04-04 17:43:09 EDT; 7min ago
       Docs: https://docs.docker.com/go/rootless/
    Process: 1705080 ExecStart=/usr/bin/dockerd-rootless.sh (code=exited, status=1/FAILURE)
   Main PID: 1705080 (code=exited, status=1/FAILURE)
        CPU: 379ms

Do you have any insights regarding how I should proceed from that? Thanks again for the help!

No, but if the installer creates files under your home, I wouldn’t create the file somewhere else. I never had problem with the installer, so I don’t know what could go wrong.

Got it, thanks anyway!

Hey my attempt running the rootless install script failed with the same messages. In the end it turned out my version of slirp4netns was too old.
I got the newest one (v1.3.0) from here, moved the old one from /usr/bin/slirp4netns to /usr/bin/slirp4netns.old and placed the new one there.
After that the install script worked!