moby: "invalid volume mount source, must not be an absolute path" occurred when using docker service create --mount type=volume

Output of docker version: docker --version Docker version 1.12.1, build 23cf638, experimental

Output of docker info: Containers: 1 Running: 1 Paused: 0 Stopped: 0 Images: 2 Server Version: 1.12.1 Storage Driver: overlay Backing Filesystem: extfs Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host overlay null Swarm: active NodeID: 451bgswzvxvhnmj1vmltjomaj Is Manager: true ClusterID: da0rtoysphkdgc3p0uo2ocvs8 Managers: 1 Nodes: 2 Orchestration: Task History Retention Limit: 5 Raft: Snapshot Interval: 10000 Heartbeat Tick: 1 Election Tick: 3 Dispatcher: Heartbeat Period: 5 seconds CA Configuration: Expiry Duration: 3 months Node Address: 10.245.251.124 Runtimes: runc Default Runtime: runc Security Options: seccomp Kernel Version: 4.1.12-37.5.1.el7uek.x86_64 Operating System: Oracle Linux Server 7.0 OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 16.97 GiB Name: h1 ID: OFJZ:3THB:ZM76:5D4P:WLJG:D74G:COYF:B4NB:E37Q:MXAV:ZZGR:6S7X Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Experimental: true

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

OS: [root@generic]# uname -a Linux 4.1.12-37.5.1.el7uek.x86_64 #2 SMP Thu Jun 9 16:01:20 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux

Steps to reproduce the issue:

  1. Setup one swarm env using “docker swarm init”
  2. In the swarm manager node, run “docker service create --replicas 2 --name c2 --network ingress --publish 22 --mount type=volume,source=/run/systemd,target=/run/systemd busybox ping docker.com”
  3. Check the service status by “docker service ps c2”: [root@h1 generic]# docker service ps c2 ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR b10zaq7rf2u3apmvsu2wwom4n c2.1 busybox h2 Ready Assigned less than a second ago 5b27w4nimle3jmg6dde77poam _ c2.1 busybox h1 Ready Rejected less than a second ago “invalid volume mount source, …” 86vjnjhcxlfoof1wleiu5y19s _ c2.1 busybox h2 Shutdown Rejected 5 seconds ago “invalid volume mount source, …” cdue3daq5qi4rum5kp51c1qdg _ c2.1 busybox h1 Shutdown Rejected 5 seconds ago “invalid volume mount source, …” 457h3gto3ddoc2n4utiu70yyr _ c2.1 busybox h2 Shutdown Rejected 10 seconds ago “invalid volume mount source, …” 6y2gfl7sgurwdety4t54xiabd c2.2 busybox h1 Ready Rejected less than a second ago “invalid volume mount source, …” cpddx6r20dkd9sx3hg2898pz3 _ c2.2 busybox h1 Shutdown Rejected 5 seconds ago “invalid volume mount source, …” dek1smzmechdedmjmbnk6u2jv _ c2.2 busybox h1 Shutdown Rejected 10 seconds ago “invalid volume mount source, …” 61f7s8ke5grlhhocahie0lz0z _ c2.2 busybox h1 Shutdown Rejected 15 seconds ago “invalid volume mount source, …” 5l39sq16xarmzzgjdcfozxjk2 _ c2.2 busybox h1 Shutdown Rejected 20 seconds ago “invalid volume mount source, …”

Describe the results you received: From /var/log/messages, we can see the below error: Aug 21 21:40:18 slc09woz dockerd: time=“2016-08-21T21:40:18.256522939-07:00” level=error msg=“failed to start taskManager” error=“invalid volume mount source, must not be an absolute path: /run/systemd” module=agent Aug 21 21:40:18 slc09woz dockerd: time=“2016-08-21T21:40:18.282052878-07:00” level=warning msg=“cannot find target task in store” method=“(*Dispatcher).UpdateTaskStatus” node.id=bfo8245ks0t5sdsu8qntisjmz node.session=8hh95orw8jvx0rcdrxkhutbhj task.id=a01bs7w2lyk3isj6aie3js5w8

Describe the results you expected: Why do we need the relative path in this command? I tried the same command in previous version of docker and it worked fine.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

@urlund 1.12 is very much the broken one. You don’t want a type=volume, you want a type=bind as @garthk mentioned.

Closing because this is working as intended. Docs for this are here: #25776

Try type=bind, e.g. --mount target=/tmp/docker.sock,source=/var/run/docker.sock,type=bind.

Thanks all. type=bind works

@sinkoneri Yould have to ssh to the machine to create these host dirs, just setting the env is not going to do it.

@cpuguy83 Before creating the jenkins service i issued the eval $(docker-machine env nodename) than the mkdir command which creates the source dir. I followed this video to create a failover jenkins config with docker swarm. Am i missing something or there is some preconfig steps,settings which isn`t in the video?

Sorry I’m a newb at docker/docker swarm.

@pacoxu Because this is a broken expectation for docker to do for you. If you want docker to create a path for you, then use a volume.