I’ve installed Docker using Snap. Recently running containers have been getting stopped on their own. This happens say 2-3 times in the space of ~8-10 hours. I’ve been trying to find a root cause without much success. Relevant information below. Let me know if I can provide more information to help.
$ docker --version
Docker version 19.03.13, build cd8016b6bc
$ dmesg -T
[Tue Sep 14 20:31:37 2021] aufs aufs_fill_super:918:mount[18200]: no arg
[Tue Sep 14 20:31:37 2021] overlayfs: missing 'lowerdir'
[Tue Sep 14 20:31:43 2021] br-6c6facc1a891: port 5(veth4c212a4) entered disabled state
[Tue Sep 14 20:31:43 2021] device veth4c212a4 left promiscuous mode
[Tue Sep 14 20:31:43 2021] br-6c6facc1a891: port 5(veth4c212a4) entered disabled state
[Tue Sep 14 20:31:45 2021] br-6c6facc1a891: port 1(veth1c95aae) entered disabled state
[Tue Sep 14 20:31:45 2021] device veth1c95aae left promiscuous mode
[Tue Sep 14 20:31:45 2021] br-6c6facc1a891: port 1(veth1c95aae) entered disabled state
[Tue Sep 14 20:31:45 2021] br-6c6facc1a891: port 4(veth1dfd80e) entered disabled state
[Tue Sep 14 20:31:45 2021] device veth1dfd80e left promiscuous mode
[Tue Sep 14 20:31:45 2021] br-6c6facc1a891: port 4(veth1dfd80e) entered disabled state
[Tue Sep 14 20:31:46 2021] br-6c6facc1a891: port 2(veth8e48cf4) entered disabled state
[Tue Sep 14 20:31:46 2021] device veth8e48cf4 left promiscuous mode
[Tue Sep 14 20:31:46 2021] br-6c6facc1a891: port 2(veth8e48cf4) entered disabled state
[Tue Sep 14 20:31:46 2021] br-6c6facc1a891: port 3(veth534c1d3) entered disabled state
[Tue Sep 14 20:31:46 2021] device veth534c1d3 left promiscuous mode
[Tue Sep 14 20:31:46 2021] br-6c6facc1a891: port 3(veth534c1d3) entered disabled state
[Tue Sep 14 20:31:47 2021] br-6c6facc1a891: port 6(veth316fdd7) entered disabled state
[Tue Sep 14 20:31:47 2021] device veth316fdd7 left promiscuous mode
Note the difference in timestamp between Docker logs, below and dmesg, above.
The Docker logs appear to be from previous time I restarted containers using docker-compose.
$ snap change 203
Status Spawn Ready Summary
Done today at 08:58 IST today at 09:00 IST Ensure prerequisites for "docker" are available
Undone today at 08:58 IST today at 09:00 IST Download snap "docker" (1125) from channel "latest/stable"
Done today at 08:58 IST today at 09:00 IST Fetch and check assertions for snap "docker" (1125)
Undone today at 08:58 IST today at 09:00 IST Mount snap "docker" (1125)
Undone today at 08:58 IST today at 09:00 IST Run pre-refresh hook of "docker" snap if present
Undone today at 08:58 IST today at 09:00 IST Stop snap "docker" services
Undone today at 08:58 IST today at 09:00 IST Remove aliases for snap "docker"
Undone today at 08:58 IST today at 09:00 IST Make current revision for snap "docker" unavailable
Undone today at 08:58 IST today at 09:00 IST Copy snap "docker" data
Undone today at 08:58 IST today at 09:00 IST Setup snap "docker" (1125) security profiles
Undone today at 08:58 IST today at 09:00 IST Make snap "docker" (1125) available to the system
Undone today at 08:58 IST today at 09:00 IST Automatically connect eligible plugs and slots of snap "docker"
Undone today at 08:58 IST today at 09:00 IST Set automatic aliases for snap "docker"
Undone today at 08:58 IST today at 09:00 IST Setup snap "docker" aliases
Error today at 08:58 IST today at 09:00 IST Run post-refresh hook of "docker" snap if present
Hold today at 08:58 IST today at 09:00 IST Start snap "docker" (1125) services
Hold today at 08:58 IST today at 09:00 IST Remove data for snap "docker" (471)
Hold today at 08:58 IST today at 09:00 IST Remove snap "docker" (471) from the system
Hold today at 08:58 IST today at 09:00 IST Clean up "docker" (1125) install
Hold today at 08:58 IST today at 09:00 IST Run configure hook of "docker" snap if present
Hold today at 08:58 IST today at 09:00 IST Run health check of "docker" snap
Done today at 08:58 IST today at 09:00 IST Consider re-refresh of "docker"
......................................................................
Run post-refresh hook of "docker" snap if present
2021-09-17T09:00:06+05:30 ERROR run hook "post-refresh":
-----
cannot update snap namespace: cannot create symlink in "/etc/docker": existing file in the way
snap-update-ns failed with code 1
-----
$ snap change 202
Status Spawn Ready Summary
Done yesterday at 22:37 IST yesterday at 22:48 IST Ensure prerequisites for "docker" are available
Undone yesterday at 22:37 IST yesterday at 22:48 IST Download snap "docker" (1125) from channel "latest/stable"
Done yesterday at 22:37 IST yesterday at 22:48 IST Fetch and check assertions for snap "docker" (1125)
Undone yesterday at 22:37 IST yesterday at 22:48 IST Mount snap "docker" (1125)
Undone yesterday at 22:37 IST yesterday at 22:48 IST Run pre-refresh hook of "docker" snap if present
Undone yesterday at 22:37 IST yesterday at 22:48 IST Stop snap "docker" services
Undone yesterday at 22:37 IST yesterday at 22:48 IST Remove aliases for snap "docker"
Undone yesterday at 22:37 IST yesterday at 22:48 IST Make current revision for snap "docker" unavailable
Undone yesterday at 22:37 IST yesterday at 22:48 IST Copy snap "docker" data
Error yesterday at 22:37 IST yesterday at 22:48 IST Setup snap "docker" (1125) security profiles
Hold yesterday at 22:37 IST yesterday at 22:48 IST Make snap "docker" (1125) available to the system
Hold yesterday at 22:37 IST yesterday at 22:48 IST Automatically connect eligible plugs and slots of snap "docker"
Hold yesterday at 22:37 IST yesterday at 22:48 IST Set automatic aliases for snap "docker"
Hold yesterday at 22:37 IST yesterday at 22:48 IST Setup snap "docker" aliases
Hold yesterday at 22:37 IST yesterday at 22:48 IST Run post-refresh hook of "docker" snap if present
Hold yesterday at 22:37 IST yesterday at 22:48 IST Start snap "docker" (1125) services
Hold yesterday at 22:37 IST yesterday at 22:48 IST Remove data for snap "docker" (471)
Hold yesterday at 22:37 IST yesterday at 22:48 IST Remove snap "docker" (471) from the system
Hold yesterday at 22:37 IST yesterday at 22:48 IST Clean up "docker" (1125) install
Hold yesterday at 22:37 IST yesterday at 22:48 IST Run configure hook of "docker" snap if present
Hold yesterday at 22:37 IST yesterday at 22:48 IST Run health check of "docker" snap
Done yesterday at 22:37 IST yesterday at 22:48 IST Consider re-refresh of "docker"
......................................................................
Setup snap "docker" (1125) security profiles
2021-09-16T22:48:20+05:30 ERROR cannot update mount namespace of snap "docker": cannot update preserved namespace of snap "docker": cannot update snap namespace: cannot create symlink in "/etc/docker": existing file in the way
$ snap change 201
Status Spawn Ready Summary
Done yesterday at 14:12 IST yesterday at 14:25 IST Ensure prerequisites for "docker" are available
Undone yesterday at 14:12 IST yesterday at 14:25 IST Download snap "docker" (1125) from channel "latest/stable"
Done yesterday at 14:12 IST yesterday at 14:25 IST Fetch and check assertions for snap "docker" (1125)
Undone yesterday at 14:12 IST yesterday at 14:25 IST Mount snap "docker" (1125)
Undone yesterday at 14:12 IST yesterday at 14:25 IST Run pre-refresh hook of "docker" snap if present
Undone yesterday at 14:12 IST yesterday at 14:25 IST Stop snap "docker" services
Undone yesterday at 14:12 IST yesterday at 14:25 IST Remove aliases for snap "docker"
Undone yesterday at 14:12 IST yesterday at 14:25 IST Make current revision for snap "docker" unavailable
Undone yesterday at 14:12 IST yesterday at 14:25 IST Copy snap "docker" data
Error yesterday at 14:12 IST yesterday at 14:25 IST Setup snap "docker" (1125) security profiles
Hold yesterday at 14:12 IST yesterday at 14:25 IST Make snap "docker" (1125) available to the system
Hold yesterday at 14:12 IST yesterday at 14:25 IST Automatically connect eligible plugs and slots of snap "docker"
Hold yesterday at 14:12 IST yesterday at 14:25 IST Set automatic aliases for snap "docker"
Hold yesterday at 14:12 IST yesterday at 14:25 IST Setup snap "docker" aliases
Hold yesterday at 14:12 IST yesterday at 14:25 IST Run post-refresh hook of "docker" snap if present
Hold yesterday at 14:12 IST yesterday at 14:25 IST Start snap "docker" (1125) services
Hold yesterday at 14:12 IST yesterday at 14:25 IST Remove data for snap "docker" (471)
Hold yesterday at 14:12 IST yesterday at 14:25 IST Remove snap "docker" (471) from the system
Hold yesterday at 14:12 IST yesterday at 14:25 IST Clean up "docker" (1125) install
Hold yesterday at 14:12 IST yesterday at 14:25 IST Run configure hook of "docker" snap if present
Hold yesterday at 14:12 IST yesterday at 14:25 IST Run health check of "docker" snap
Done yesterday at 14:12 IST yesterday at 14:25 IST Consider re-refresh of "docker"
......................................................................
Setup snap "docker" (1125) security profiles
2021-09-16T14:25:21+05:30 ERROR cannot update mount namespace of snap "docker": cannot update preserved namespace of snap "docker": cannot update snap namespace: cannot create symlink in "/etc/docker": existing file in the way
Thanks! It appears that the problem has been fixed and the fix made available in the edge channel. Should I just wait for the fix to make its way to stable? Are there any other alternatives?