I have a Docker Swarm setup with 10 containers.
Docker Swarm runs in a VM, data center, VM-Ware.
The swarm consists of only one machine.
I do not need high availability.
When I restart the VM, several containers start with an error.
OCI runtime exec failed: exec failed: unable to start container process:
error starting setns process: fork/exec /proc/self/fd/7: no such file or directory: unknown
Does anyone have a solution for this error?
How can I debug the error?
System:
Debian 12 - 6.1.0-37-amd64 (up to date)
Docker version 28.3.1, build 38b7060 (up to date)
1 vCPU
4 GB RAM
200 GB HDD
Copying existing content from the default data-root location to another location is not a good idea, even more so, when container configurations exist, as some configuration paths are absolute, and not relative to the value of data-root.
Try with an empty data-root folder, and check whether the problem still exists. It shouldnāt.
If I understand it correctly, you have running containers and the errors occur only when you restart the machine. So Iām not sure if that is caused by the data root copy, but I guess it is possible.
@meyay could be right about the absolute paths, but I donāt remember any. Maybe except when I set a custom source path to a volume, so I need to change that too.. I copied the data root multiple times, but simply using ācpā might not keep all the attributes of the files. There is a ā-pā flag to āpreserveā and a ā-aā flag to āarchiveā and a couple of other useful flags. You could also use rsync which has similar flags.cp -a also includes ā-Rā. You can find more in the help outputs of the commands. Without the right commands, you can break symlinks and probably other special files.
Only the base folder structure and if you have all the services defined in a compose file or you have any commands to recreate your containers, it will of course pull images and recreate the new containers the same way as they were before.
Since that way all containers are reproducable as they should be, I think I copied the docker data after I deleted all containers with ādocker compose downā and I just ran ādocker compose up -dā after the data was on the new disk, so I didnāt have to copy containers, only images.
But itās great that everything works in a new data root!
The value for the keys "LogPath", "HostnamePath", "HostsPath" and "ResolvConfPath" are absolute paths, and need to be updated when the configuration is moved to another location.
I never copy the data-root. I used to move it in the past, but since a couple of years I prefer to start with a fresh data-root. Back up named volumes (that actually persist in <data-root>/volumes/<volume name>/_data) from the old data-root instance, then deploy the containers/services using their compose files with the new data-root instance, stop the compose deployment, then finally restore the content of the volumes. When I write backup and restore, I mean by using a helper container. I never access anything in the folder directly.
As usually I thought you meant the target of the symlinks and I forgot about the config file. Since I never had problem with it, that confirms I always instinctively deleted the containers before moving the data root.
Moving the data root could spare time in environments with slow network when it was urgent, but I noticed I forgot to mount the data disk before starting the Docker daemon and pullig images.
I use a selfhost runner via github. The image is sent to the local registry via CI/CD.
When I restart the server it tries to download the image via the local registry. But it is missing the login data. How can I configure this so that docker has the login data?
as I said, when I restart the server, various containers continue to be started with the following error:
OCI runtime exec failed: exec failed: unable to start container process: error starting setns process: fork/exec /proc/self/fd/7: no such file or directory: unknown
It should create it in <data-root>/network. If it is creating it in the default data-root folder /var/lib/docker, but not in the one specified in your daemon.json settings, than this pretty much smells like a bug.
The default folder /var/lib/docker is not re-created.
When I created a network and start a container attached to the network, the folder /var/lib/docker is still not re-created.
I was able to reproduce it in another VM.
the folder /var/lib/docker/network is created after I have installed portainer (business).
although I have set this to /opt/docker-root in the daemon.json.
Forgive me, but I am not going to follow you down the Portainer-path, as I have no particular interest in re-learning a tool, I stopped using years ago. I lack the required patience for clickOps I am sure itās a great product and has its community. Itās just not the right tool for me.
I have no idea what causes your problem, as I am not able to reproduce it.
I leave this one for someone else to answer. Good luck, I hope you find the solution!