Skip to content
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 create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting. 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 #2573

Closed
Sunimali opened this issue Jun 11, 2020 · 1 comment

Comments

@Sunimali
Copy link

@Sunimali Sunimali commented Jun 11, 2020

Description

Steps to reproduce the issue:

  1. docker-compose up

Describe the results you received:
Removing test-setup_apache-ui_1
test-setup_db_1 is up-to-date
Starting test-setup_tomcat-ui_1 ... error
Recreating cfb7dcf47a14_test-setup_apache-ui_1 ...

ERROR: for test-setup_tomcat-ui_1 Cannot start service tomcat-ui: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused "rootfs_linux.go:58: mounting \"/hms/deployments/tomcat-10.0/conf/server.xml\" to rootfs \"/var/lib/docker/overlay2/457ea1d47a3f23205d66a220187b4409bdf019ba55fbf2731d0098ace4863f7d/merged\" at \"/var/lib/docker/overlay2/457ea1d47a3f23205d66a220187b4409bdf019ba55fbf2731d0098ace4863f7d/merged/usr/local/tomcat/conf/server.xml\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified hosRecreating cfb7dcf47a14_test-setup_apache-ui_1 ... error

ERROR: for cfb7dcf47a14_test-setup_apache-ui_1 Cannot start service apache-ui: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused "rootfs_linux.go:58: mounting \"/hms/deployments/apache-2.4.43/conf/httpd.conf\" to rootfs \"/var/lib/docker/overlay2/93d7b8c49c2b5a990dcca48311a9259945e411759cfbc3b6b60afaf67f97722a/merged\" at \"/var/lib/docker/overlay2/93d7b8c49c2b5a990dcca48311a9259945e411759cfbc3b6b60afaf67f97722a/merged/usr/local/apache2/conf/httpd.conf\" caused \"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: for tomcat-ui Cannot start service tomcat-ui: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused "rootfs_linux.go:58: mounting \"/hms/deployments/tomcat-10.0/conf/server.xml\" to rootfs \"/var/lib/docker/overlay2/457ea1d47a3f23205d66a220187b4409bdf019ba55fbf2731d0098ace4863f7d/merged\" at \"/var/lib/docker/overlay2/457ea1d47a3f23205d66a220187b4409bdf019ba55fbf2731d0098ace4863f7d/merged/usr/local/tomcat/conf/server.xml\" caused \"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: for apache-ui Cannot start service apache-ui: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused "rootfs_linux.go:58: mounting \"/hms/deployments/apache-2.4.43/conf/httpd.conf\" to rootfs \"/var/lib/docker/overlay2/93d7b8c49c2b5a990dcca48311a9259945e411759cfbc3b6b60afaf67f97722a/merged\" at \"/var/lib/docker/overlay2/93d7b8c49c2b5a990dcca48311a9259945e411759cfbc3b6b60afaf67f97722a/merged/usr/local/apache2/conf/httpd.conf\" caused \"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: Encountered errors while bringing up the project.

Describe the results you expected:

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

Output of docker version:

Server: Docker Engine - Community
 Engine:
  Version:          19.03.11
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       42e35e61f3
  Built:            Mon Jun  1 09:10:54 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0

Output of docker info:

Client:
 Debug Mode: false

Server:
 Containers: 8
  Running: 1
  Paused: 0
  Stopped: 7
 Images: 19
 Server Version: 19.03.11
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-33-generic
 Operating System: Ubuntu 20.04 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.51GiB
 Name: sunimali-HP-ProBook-450-G6
 ID: K7IJ:NCGT:OIWZ:D677:W5QR:PBHU:NE2I:XJWH:XSFE:6WG7:VWES:BAEO
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

@Sunimali Sunimali changed the title : OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting Jun 11, 2020
@Sunimali Sunimali changed the title OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting. 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 Jun 11, 2020
@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jun 11, 2020

This error is produced if you're trying to bind-mount a path from the host that does not exist on the host where the docker daemon runs. When using the short-hand (-v <hostpath>:<containerpath>) syntax, docker automatically creates the host-path if it's missing, and defaults to creating a directory. In your case, likely the /hms/deployments/tomcat-10.0/conf/server.xml did not exist on the daemon host, and docker created a directory with that name, after that it tries to mount it in the container, but finds a file in that location, and mounting a directory on top of a file (or vice-versa) is not possible. See some more details/discussion in docker/compose#424 (and probably some issues in https://github.com/moby/moby/issues)

Given that this is not a bug, I'm closing this issue, but feel free to continue the conversation

@thaJeztah thaJeztah closed this Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.