Docker snap is stuck. Cannot use or remove

Bug #1834997 reported by Karl Stenerud
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
docker
New
Undecided
Unassigned
snapd
Triaged
High
Unassigned
docker (Ubuntu)
Confirmed
Undecided
Tianon Gravi

Bug Description

The docker snap is completely stuck on my machine (ubuntu 18.04). I can't use it, and I can't remove it:

karl@tp-main:~$ docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

karl@tp-main:~$ snap list
Name Version Rev Tracking Publisher Notes
core 16-2.39.3 7270 stable canonical✓ core
core18 20190611 1013 stable canonical✓ base
docker 18.06.1-ce 372 stable canonical✓ -
gimp 2.10.12 189 stable snapcrafters -
gtk-common-themes 0.1-16-g2287c87 1198 stable canonical✓ -
lxd 3.14 10972 stable canonical✓ -
multipass 0.7.1 908 beta canonical✓ classic
sublime-text 3207 58 stable snapcrafters classic

karl@tp-main:~$ snap remove docker
error: cannot perform the following tasks:
- Stop snap "docker" services ([--root / is-enabled snap.docker.dockerd.service] failed with exit status 1: Failed to get unit file state for snap.docker.dockerd.service: No such file or directory
)
- Remove data for snap "docker" (372) (remove /var/snap/docker/common: device or resource busy)

karl@tp-main:~$ snap list
Name Version Rev Tracking Publisher Notes
core 16-2.39.3 7270 stable canonical✓ core
core18 20190611 1013 stable canonical✓ base
docker 18.06.1-ce 372 stable canonical✓ disabled
gimp 2.10.12 189 stable snapcrafters -
gtk-common-themes 0.1-16-g2287c87 1198 stable canonical✓ -
lxd 3.14 10972 stable canonical✓ -
multipass 0.7.1 908 beta canonical✓ classic
sublime-text 3207 58 stable snapcrafters classic

karl@tp-main:~$ docker ps
bash: /snap/bin/docker: No such file or directory

karl@tp-main:~$ sudo snap enable docker
docker enabled

karl@tp-main:~$ docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Rebooting doesn't help.

description: updated
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This bug seems to have two parts:

1) snapd cannot reliably remove a snap
2) docker snap doesn't work correctly

I'd like to split this bug so that only issue 1) is addressed here. Issue 2) was relayed to the maintainer of the snap. I expect him to update the bug report with appropriate tracking information for 2).

As such I'm marking this bug as triaged with the understanding that only 1) is tracked here.

Changed in snapd:
status: New → Triaged
importance: Undecided → High
Changed in docker (Ubuntu):
assignee: nobody → Tianon Gravi (tianon)
Revision history for this message
Tianon Gravi (tianon) wrote :

From the Docker perspective, it sounds like there's a process stuck somewhere. I'd recommend checking the system for any leftover "docker" processes (dockerd, containerd, shim processes, etc) via something like "ps faux | grep docker" (and/or "containerd", "runc", "shim", etc).

The "dockerd" service logs might also have some clues, and I believe "journalctl -u snap.docker.dockerd.service" is the right way to access those in Snappy?

Revision history for this message
Spencer Seidel (jsseidel) wrote :

FYI -- found this after running into the same problem. This fixed it for me:

journalctl -u snap.docker.dockerd.service

I saw many of these:

docker.dockerd[1475]: failed to start daemon: pid file found, ensure docker is not running or delete /var/snap/docker/471/run/docker.pid

Stopped the docker snap (snap stop docker) Deleted the stale pid, restarted docker (snap start docker) and all was well.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in docker (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.