osrf / rocker

A tool to run docker containers with overlays and convenient options for things like GUIs etc.
Apache License 2.0
555 stars 70 forks source link

Status: Exited (127) container after using rocker #216

Closed Feedback02 closed 1 year ago

Feedback02 commented 1 year ago

reproduce the error (ubuntu)

rocker --x11 --nocleanup --privileged osrf/ros:noetic-desktop-full to start the image, and then inside the container i type the exit command. doing docker ps -a i get the container with status Exit(0). the when i want to start the container i use docker start id getting this error: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/tmp/.dockerhl7oumo6.xauth" to rootfs at "/tmp/.dockerhl7oumo6.xauth": mount /tmp/.dockerhl7oumo6.xauth:/tmp/.dockerhl7oumo6.xauth (via /proc/self/fd/8), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type Error: failed to start containers: e669de809abb and with docker ps -a i have that the container has Status: Exited (127) . i tried many things like deleting rocker and docker, even following the error response but nothing works. if i start the container using only docker run than everything works fine. this problem arise only when using rocker. when i use docker logs, the container automatically exit without giving me messages.

tfoote commented 1 year ago

There was an issue resolved in https://github.com/osrf/rocker/pull/189 which looks a lot like your issue. I think that it has not yet been released. If you test from source it should be resolved, can you confirm?

Feedback02 commented 1 year ago

There was an issue resolved in #189 which looks a lot like your issue. I think that it has not yet been released. If you test from source it should be resolved, can you confirm?

i tried it by source and it gives me the same error. i will try to delete everything (formatting the hard disk) maybe it has something to do with the dual boot. ill update you

tfoote commented 1 year ago

Please comment back or open a new issue if you encounter this again. 0.2.12 is out now and should have this fix included.

Feedback02 commented 1 year ago

@tfoote ok i figure it out.after alot of trials. using docker exec -it id bash gives me no problem

Feedback02 commented 1 year ago

@tfoote just kiddin, after restarting pc it doesn't work anymore. so at the first try it works even if i exit from the container and use docker start. but after rebooting nothing works again.: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/tmp/.dockergzwlnx9b.xauth" to rootfs at "/tmp/.dockergzwlnx9b.xauth": mount /tmp/.dockergzwlnx9b.xauth:/tmp/.dockergzwlnx9b.xauth (via /proc/self/fd/8), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

tfoote commented 1 year ago

So you can see that it's using files in your /tmp directory. If you want containers generated by rocker that use tempfiles like that you should create an alternative persistent directory and set the environment variable TMPDIR to that path not on a volatile filesystem (such as /tmp) so that the generated files will survive a reboot. You can get more info on that here: https://stackoverflow.com/questions/18280245/where-does-python-tempfile-writes-its-files

Related to #187