New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"oci runtime error: could not synchronise with container process: not a directory" on remote host #23474

Closed
loomchild opened this Issue Jun 12, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@loomchild

loomchild commented Jun 12, 2016

When I try to run the following command on Docker running locally and natively, as described in official Nginx image, it works as expected:

docker run --rm --name testnginx -p 8080:80 -v /absolute/path/to/nginx.conf:/etc/nginx/nginx.conf:ro nginx

Mounted config is just a copy of the initial configuraion found in the image:

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

However, when I try to run it on Docker running remotely, either created as local Virtualbox Docker Machine or on remote server, I get the following error:

docker: Error response from daemon: rpc error: code = 2 desc = "oci runtime error: could not synchronise with container process: not a directory".

The error is not present when I run the same command without a volume mount.

Output of docker version:

Client:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   b9f10c9
 Built:        Wed Jun  1 21:23:39 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   b9f10c9
 Built:        Wed Jun  1 21:20:08 2016
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 1
Server Version: 1.11.2
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 8
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: host bridge null
Kernel Version: 4.4.12-boot2docker
Operating System: Boot2Docker 1.11.2 (TCL 7.1); HEAD : a6645c3 - Wed Jun  1 22:59:51 UTC 2016
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 995.9 MiB
Name: dev
ID: CPL2:GDK2:BBBG:XJRC:S25V:P5PI:67PZ:CNV5:4GK6:F2FC:PZS6:EDMW
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug mode (client): false
Debug mode (server): true
 File Descriptors: 14
 Goroutines: 31
 System Time: 2016-06-12T13:37:11.898821461Z
 EventsListeners: 0
Username: loomchild
Registry: https://index.docker.io/v1/
Labels:
 provider=virtualbox

Additional environment details (AWS, VirtualBox, physical, etc.):

Machine freshly created with:

docker-machine create --driver virtualbox dev

Also happens on AWS Ubuntu 14.04 LTS and bare-metal Debian 8.4 server.

Steps to reproduce the issue:

  1. docker-machine create --driver virtualbox dev
  2. eval "$(docker-machine env dev)"
  3. docker run --rm --name testnginx -p 8080:80 -v /absolute/path/to/nginx.conf:/etc/nginx/nginx.conf:ro nginx

output:

docker: Error response from daemon: rpc error: code = 2 desc = "oci runtime error: could not synchronise with container process: not a directory".

Describe the results you expected:

No output, container properly started and responding on port 8080.

Additional information you deem important (e.g. issue happens only occasionally):

It does not happen when running the same command on local / native docker daemon.

Might be related to #21702.

Discovered while running official Piwik image using Docker Compose, but I was able to reproduce it using only nginx image with both Docker Compose and just Docker.

@loomchild

This comment has been minimized.

Show comment
Hide comment
@loomchild

loomchild Jun 12, 2016

Wait, I think I missed the fact that files and directories on local machine are not mounted on remote machine. Closing as obsolete, sorry for the noise.

loomchild commented Jun 12, 2016

Wait, I think I missed the fact that files and directories on local machine are not mounted on remote machine. Closing as obsolete, sorry for the noise.

@loomchild loomchild closed this Jun 12, 2016

@fommil

This comment has been minimized.

Show comment
Hide comment
@fommil

fommil Jul 12, 2017

@loomchild I'm also seeing this, but I don't understand what you mean by "files and directories on local machine are not mounted on remote machine"... didn't you do this with the -v flag?

fommil commented Jul 12, 2017

@loomchild I'm also seeing this, but I don't understand what you mean by "files and directories on local machine are not mounted on remote machine"... didn't you do this with the -v flag?

@loomchild

This comment has been minimized.

Show comment
Hide comment
@loomchild

loomchild Jul 12, 2017

The problem I had was when Docker was running on a remote machine, I was connecting to it via Docker Machine (eval "$(docker-machine env <hostname>)") and then executing docker run -v ... command. I was expecting that directories from my localhost will be mounted as volumes on Docker remote machine, but in fact the directories from a remote machine were mounted.

loomchild commented Jul 12, 2017

The problem I had was when Docker was running on a remote machine, I was connecting to it via Docker Machine (eval "$(docker-machine env <hostname>)") and then executing docker run -v ... command. I was expecting that directories from my localhost will be mounted as volumes on Docker remote machine, but in fact the directories from a remote machine were mounted.

@fommil

This comment has been minimized.

Show comment
Hide comment
@fommil

fommil Jul 12, 2017

right, so our similar problem was because the old version of docker-compose we have to use won't mount files (only directories).

fommil commented Jul 12, 2017

right, so our similar problem was because the old version of docker-compose we have to use won't mount files (only directories).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment