Docker Community Forums

Share and learn in the Docker community.

'no such file or directory' trying to open bash shell


(Cwynd) #1

Hi

I am new to docker, and struggling for some time. Brief details:
debian wheezy 64 / Docker version 1.8.2, build 0a8c2e3

I have modified DOCKER_OPTS in /etc/default/docker to add:

"-g /path/to/docker/"

-since I need to store it on a large disk. I am using a hub image unmodified:

rspeer/conceptnet-web:5.4

I can start the container as follows:

docker run -p 10054 rspeer/conceptnet-web:5.4 -v /path/to/conceptnet5.4/data/:/conceptnet_data

I need to open a shell to look at paths since the above is not finding the data:

/path/to/conceptnet5.4/data

Despite many hours of fiddling, when I run the following:

docker exec -it <container-id> /bin/bash

-I cannot get beyond the cryptic:

$ docker exec -it <container-id> /bin/bash
no such file or directory
$

-and nothing else. If I misstype the container-id I get a message from the docker daemon as expected. I have tried to use the --log-level or --debug options. These provide no further information whatsoever. Also I have hunted for logs in many possible locations, and discovered nothing relevant.

For what it is worth this appears to work:

docker top <container-id>

I would really really appreciate any advice on how to debug access to this container!


(Cwynd) #2

Update (not solved).

Running the docker daemon in foreground mode using simply this:

docker daemon --debug=true

-and then running the same container command as above to successfully start the same container:

docker run -p 10054 rspeer/conceptnet-web:5.4 -v /mnt/data1500/conceptnet5.4/data/:/conceptnet_data

-provides a little more info. First the behaviour in a client shell is exactly the same:

$ docker exec -it d0864c882d7a /bin/bash
no such file or directory
$ docker exec -it d0864c882d7a /this/does/not/exist
no such file or directory
$

The daemon debug log is I believe identical for both of the above, but both are pasted below:

DEBU[1224] Calling POST /containers/{name:.*}/exec      
INFO[1224] POST /v1.20/containers/d0864c882d7a/exec     
DEBU[1224] Calling POST /exec/{name:.*}/start           
INFO[1224] POST /v1.20/exec/794df5847b87d69c0cd40ea756d22f4e7c176e10ab370d9ba0fdd4a8f658ee42/start 
DEBU[1224] starting exec command 794df5847b87d69c0cd40ea756d22f4e7c176e10ab370d9ba0fdd4a8f658ee42 in container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b 
DEBU[1224] attach: stdin: begin                         
DEBU[1224] attach: stdout: begin                        
DEBU[1224] Calling POST /exec/{name:.*}/resize          
INFO[1224] POST /v1.20/exec/794df5847b87d69c0cd40ea756d22f4e7c176e10ab370d9ba0fdd4a8f658ee42/resize?h=94&w=180 
WARN[1225] exit status 1                                
ERRO[1225] Error running command in existing container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b: [8] System error: no such file or directory 
DEBU[1225] Exec task in container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b exited with code -1 
DEBU[1225] attach: stdout: end                          
ERRO[1225] Handler for POST /exec/{name:.*}/resize returned error: bad file descriptor 
ERRO[1225] HTTP Error                                    err=bad file descriptor statusCode=500
ERRO[1225] Error starting exec command in container 794df5847b87d69c0cd40ea756d22f4e7c176e10ab370d9ba0fdd4a8f658ee42: Cannot run exec command 794df5847b87d69c0cd40ea756d22f4e7c176e10ab370d9ba0fdd4a8f658ee42 in container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b: [8] System error: no such file or directory 
ERRO[1225] Handler for POST /exec/{name:.*}/start returned error: Cannot run exec command 794df5847b87d69c0cd40ea756d22f4e7c176e10ab370d9ba0fdd4a8f658ee42 in container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b: [8] System error: no such file or directory 
ERRO[1225] HTTP Error                                    err=Cannot run exec command 794df5847b87d69c0cd40ea756d22f4e7c176e10ab370d9ba0fdd4a8f658ee42 in container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b: [8] System error: no such file or directory statusCode=404
2015/10/19 11:14:22 http: response.WriteHeader on hijacked connection
2015/10/19 11:14:22 http: response.Write on hijacked connection
DEBU[1225] attach: stdin: end                           
DEBU[1225] Closing buffered stdin pipe                  
DEBU[1225] Calling GET /exec/{id:.*}/json               
INFO[1225] GET /v1.20/exec/794df5847b87d69c0cd40ea756d22f4e7c176e10ab370d9ba0fdd4a8f658ee42/json 

-and for ‘/this/does/not/exist’:

DEBU[1266] Calling POST /containers/{name:.*}/exec      
INFO[1266] POST /v1.20/containers/d0864c882d7a/exec     
DEBU[1266] Calling POST /exec/{name:.*}/start           
INFO[1266] POST /v1.20/exec/033d9ca370ee5bee894d945f4de2e9f5a64f4519ae7794c376b23e5141414651/start 
DEBU[1266] starting exec command 033d9ca370ee5bee894d945f4de2e9f5a64f4519ae7794c376b23e5141414651 in container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b 
DEBU[1266] attach: stdin: begin                         
DEBU[1266] attach: stdout: begin                        
DEBU[1266] Calling POST /exec/{name:.*}/resize          
INFO[1266] POST /v1.20/exec/033d9ca370ee5bee894d945f4de2e9f5a64f4519ae7794c376b23e5141414651/resize?h=94&w=180 
WARN[1266] exit status 1                                
ERRO[1266] Error running command in existing container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b: [8] System error: no such file or directory 
DEBU[1266] Exec task in container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b exited with code -1 
DEBU[1266] attach: stdout: end                          
ERRO[1266] Handler for POST /exec/{name:.*}/resize returned error: bad file descriptor 
ERRO[1266] HTTP Error                                    err=bad file descriptor statusCode=500
ERRO[1266] Error starting exec command in container 033d9ca370ee5bee894d945f4de2e9f5a64f4519ae7794c376b23e5141414651: Cannot run exec command 033d9ca370ee5bee894d945f4de2e9f5a64f4519ae7794c376b23e5141414651 in container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b: [8] System error: no such file or directory 
ERRO[1266] Handler for POST /exec/{name:.*}/start returned error: Cannot run exec command 033d9ca370ee5bee894d945f4de2e9f5a64f4519ae7794c376b23e5141414651 in container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b: [8] System error: no such file or directory 
ERRO[1266] HTTP Error                                    err=Cannot run exec command 033d9ca370ee5bee894d945f4de2e9f5a64f4519ae7794c376b23e5141414651 in container d0864c882d7a37501e0e86733e79ccab79f3cd333b2c83f23bd6da86048bca8b: [8] System error: no such file or directory statusCode=404
2015/10/19 11:15:03 http: response.WriteHeader on hijacked connection
2015/10/19 11:15:03 http: response.Write on hijacked connection
DEBU[1266] attach: stdin: end                           
DEBU[1266] Closing buffered stdin pipe                  
DEBU[1266] Calling GET /exec/{id:.*}/json               
INFO[1266] GET /v1.20/exec/033d9ca370ee5bee894d945f4de2e9f5a64f4519ae7794c376b23e5141414651/json 
DEBU[1500] clean 1 unused exec commands                 
DEBU[1800] clean 2 unused exec commands     

“no such file or directory” is really a very useless error report to the user, and does not seem to reflect what is actually going on. At the very least it might be smart to echo the file or dir string that does not exist…

Hopefully the above daemon error messages mean something to a docker dev…


(Cwynd) #3

In case anyone is reading this thread, you can find a discussion thread with the container owner here:
https://github.com/commonsense/conceptnet5/issues/57

[helpfully this forum parses & counts the links in the referenced post as “my” links and “sorry no more than 2 links”… hence the intentional non-link (url is correct)…]


(Cwynd) #4

Since this was attracting zero attention, I have moved it to the Open Source - Docker Engine category in the hope that someone might actually notice it.

The problem remains unsolved.


(Shtihskar) #5

Hi did anyone find a solution. I am facing the same problem

Jun 05 06:28:00 localhost systemd[1]: Stopped optimus-manager.service. Jun 05 06:28:00 localhost systemd[1]: Starting optimus-manager.service... Jun 05 06:28:00 localhost systemd[1]: Started optimus-manager.service. Jun 05 06:28:00 localhost dockerd[3027]: time="2016-06-05T06:28:00.869839339Z" level=info msg="POST /v1.20/containers/create" Jun 05 06:28:00 localhost dockerd[3027]: time="2016-06-05T06:28:00.917769680Z" level=info msg="POST /v1.20/containers/7b7827b068294647260d5e334b5b5a15faa9098123b98bd9739ac6ea17740794/attach?stderr=1&stdout=1&stream=1" Jun 05 06:28:00 localhost dockerd[3027]: time="2016-06-05T06:28:00.918031097Z" level=info msg="POST /v1.20/containers/7b7827b068294647260d5e334b5b5a15faa9098123b98bd9739ac6ea17740794/start" Jun 05 06:28:00 localhost systemd[1]: Started docker container 7b7827b068294647260d5e334b5b5a15faa9098123b98bd9739ac6ea17740794. Jun 05 06:28:00 localhost dockerd[3027]: time="2016-06-05T06:28:00.958944791Z" level=warning msg="exit status 1" Jun 05 06:28:00 localhost systemd[1]: Stopped docker container 7b7827b068294647260d5e334b5b5a15faa9098123b98bd9739ac6ea17740794. Jun 05 06:28:00 localhost dockerd[3027]: time="2016-06-05T06:28:00.965582614Z" level=error msg="Handler for POST /containers/{name:.*}/start returned error: Cannot start container 7b7827b068294647260d5e334b5b5a15faa9098123b98bd9739ac6ea17740794: [8] System error: no such file or directory" Jun 05 06:28:00 localhost dockerd[3027]: time="2016-06-05T06:28:00.965629809Z" level=error msg="HTTP Error" err="Cannot start container 7b7827b068294647260d5e334b5b5a15faa9098123b98bd9739ac6ea17740794: [8] System error: no such file or directory" statusCode=404 Jun 05 06:28:00 localhost systemd[1]: optimus-manager.service: Main process exited, code=exited, status=1/FAILURE Jun 05 06:28:00 localhost systemd[1]: optimus-manager.service: Unit entered failed state. Jun 05 06:28:00 localhost systemd[1]: optimus-manager.service: Failed with result 'exit-code'. Jun 05 06:28:01 localhost systemd[1]: optimus-manager.service: Service hold-off time over, scheduling restart. Jun 05 06:28:01 localhost systemd[1]: Stopped optimus-manager.service.

This doesn’t happen all the time - i mean the same docker image pulled from quay on a new machine runs just fine


(Dvohra) #6

For container id d0864c882d7a Run the command

docker exec -it d0864c882d7a bash