{"action":"created","issue":{"url":"https://api.github.com/repos/weaveworks/weave/issues/2394","repository_url":"https://api.github.com/repos/weaveworks/weave","labels_url":"https://api.github.com/repos/weaveworks/weave/issues/2394/labels{/name}","comments_url":"https://api.github.com/repos/weaveworks/weave/issues/2394/comments","events_url":"https://api.github.com/repos/weaveworks/weave/issues/2394/events","html_url":"https://github.com/weaveworks/weave/issues/2394","id":162104526,"number":2394,"title":"Using Weave CNI in Mesos: \"no such file or directory\" error","user":{"login":"philwinder","id":8793723,"avatar_url":"https://avatars.githubusercontent.com/u/8793723?v=3","gravatar_id":"","url":"https://api.github.com/users/philwinder","html_url":"https://github.com/philwinder","followers_url":"https://api.github.com/users/philwinder/followers","following_url":"https://api.github.com/users/philwinder/following{/other_user}","gists_url":"https://api.github.com/users/philwinder/gists{/gist_id}","starred_url":"https://api.github.com/users/philwinder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philwinder/subscriptions","organizations_url":"https://api.github.com/users/philwinder/orgs","repos_url":"https://api.github.com/users/philwinder/repos","events_url":"https://api.github.com/users/philwinder/events{/privacy}","received_events_url":"https://api.github.com/users/philwinder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-06-24T08:59:00Z","updated_at":"2016-06-24T13:29:34Z","closed_at":null,"body":"I'm attempting to get Weave CNI working with Mesos CNI. I've stolen commands from the K8s tutorial and merged them in with a Mesos tutorial. Everything seems to be setup correctly, but when the call is made to `/opt/bin/cni/weave-net` and hence the `docker run plugin...` command, the container fails with the logs:\r\n```\r\n{\r\n    \"code\": 100,\r\n    \"msg\": \"no such file or directory\"\r\n}\r\n```\r\n\r\nI edited the `weave-net` script to add some debug messages like so:\r\n\r\n```\r\n#!/bin/sh\r\nset -x\r\necho \"\\nEnv Vars\\n\"\r\nenv\r\necho \"------\"\r\nls /etc/cni\r\nls /opt/cni\r\nls CNI_PATH\r\nls /var/run/docker.sock\r\n\r\ndocker run --rm --privileged --net=host -v /var/run/docker.sock:/var/run/docker.sock --pid=host -i \\\r\n -e CNI_VERSION -e CNI_COMMAND -e CNI_CONTAINERID -e CNI_NETNS \\\r\n -e CNI_IFNAME -e CNI_ARGS -e CNI_PATH -v /etc/cni:/etc/cni -v /opt/cni:/opt/cni \\\r\n weaveworks/plugin:1.6.0  --cni-net -log-level debug\r\n```\r\n\r\nWhich resulted in:\r\n\r\n```\r\nubuntu@ip-10-0-0-249:~$ sudo mesos-execute --command=/bin/bash --docker_image=ubuntu:latest --master=ec2-52-49-23-223.eu-west-1.compute.amazonaws.com:5050 --name=ubuntu --networks=weave --no-shell\r\nI0624 08:28:19.010092  6044 scheduler.cpp:187] Version: 1.0.0\r\nI0624 08:28:19.011386  6050 scheduler.cpp:471] New master detected at master@10.0.0.217:5050\r\nSubscribed with ID '85ab8d71-94b0-4d7e-8a43-1938a716c786-0020'\r\nSubmitted task 'ubuntu' to agent '85ab8d71-94b0-4d7e-8a43-1938a716c786-S4'\r\nReceived status update TASK_FAILED for task 'ubuntu'\r\n  message: 'Failed to launch container: Collect failed: The CNI plugin 'weave-net' failed to attach container 6249ab71-2ba0-4f35-bbe4-385228792284 to CNI network 'weave': \r\nEnv Vars\r\n\r\nCNI_PATH=/opt/cni/bin\r\nCNI_CONTAINERID=6249ab71-2ba0-4f35-bbe4-385228792284\r\nPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\r\nCNI_NETNS=/run/mesos/isolators/network/cni/6249ab71-2ba0-4f35-bbe4-385228792284/ns\r\nCNI_IFNAME=eth0\r\nCNI_COMMAND=ADD\r\nPWD=/\r\n------\r\nnet.d\r\nbin\r\n/var/run/docker.sock\r\n{\r\n    \"code\": 100,\r\n    \"msg\": \"no such file or directory\"\r\n}; Abnormal executor termination'\r\n  source: SOURCE_AGENT\r\n  reason: REASON_CONTAINER_LAUNCH_FAILED\r\n```\r\n\r\nAs you can see, all of the directories appear to be present and correct.\r\n\r\nAlso, I tracked this down to an error being thrown by the containernetworking/cni code here: https://github.com/containernetworking/cni/blob/master/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go\r\n\r\nBut I don't know what code calls that error message.\r\n\r\nSetup below:\r\n```\r\nubuntu@ip-10-0-0-69:~$ cat /etc/mesos-slave/network_cni_config_dir \r\n/etc/cni/net.d\r\nubuntu@ip-10-0-0-69:~$ cat /etc/mesos-slave/network_cni_plugins_dir \r\n/opt/cni/bin\r\nubuntu@ip-10-0-0-69:~$ cat /etc/cni/net.d/10-weave.conf\r\n{\r\n    \"name\": \"weave\",\r\n    \"type\": \"weave-net\"\r\n}\r\nubuntu@ip-10-0-0-69:~$ cat /opt/cni/bin/weave-net \r\n#!/bin/sh\r\ndocker run --rm --privileged --net=host -v /var/run/docker.sock:/var/run/docker.sock --pid=host -i \\\r\n -e CNI_VERSION -e CNI_COMMAND -e CNI_CONTAINERID -e CNI_NETNS \\\r\n -e CNI_IFNAME -e CNI_ARGS -e CNI_PATH -v /etc/cni:/etc/cni -v /opt/cni:/opt/cni \\\r\n weaveworks/plugin:1.6.0  --cni-net\r\nubuntu@ip-10-0-0-69:~$ sudo mesos-execute --command=/bin/bash --docker_image=ubuntu:latest --master=ec2-52-49-23-223.eu-west-1.compute.amazonaws.com:5050 --name=ubuntu --networks=weave --no-shell\r\nI0624 08:54:44.619662  5762 scheduler.cpp:187] Version: 1.0.0\r\nI0624 08:54:44.621544  5766 scheduler.cpp:471] New master detected at master@10.0.0.217:5050\r\nSubscribed with ID '85ab8d71-94b0-4d7e-8a43-1938a716c786-0025'\r\nSubmitted task 'ubuntu' to agent '85ab8d71-94b0-4d7e-8a43-1938a716c786-S3'\r\nReceived status update TASK_FAILED for task 'ubuntu'\r\n  message: 'Failed to launch container: Collect failed: The CNI plugin 'weave-net' failed to attach container 0de98310-57df-4f5e-9eb3-39d9d4499e34 to CNI network 'weave': {\r\n    \"code\": 100,\r\n    \"msg\": \"no such file or directory\"\r\n}; Abnormal executor termination'\r\n  source: SOURCE_AGENT\r\n  reason: REASON_CONTAINER_LAUNCH_FAILED\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/weaveworks/weave/issues/comments/228345537","html_url":"https://github.com/weaveworks/weave/issues/2394#issuecomment-228345537","issue_url":"https://api.github.com/repos/weaveworks/weave/issues/2394","id":228345537,"user":{"login":"squaremo","id":62033,"avatar_url":"https://avatars.githubusercontent.com/u/62033?v=3","gravatar_id":"","url":"https://api.github.com/users/squaremo","html_url":"https://github.com/squaremo","followers_url":"https://api.github.com/users/squaremo/followers","following_url":"https://api.github.com/users/squaremo/following{/other_user}","gists_url":"https://api.github.com/users/squaremo/gists{/gist_id}","starred_url":"https://api.github.com/users/squaremo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/squaremo/subscriptions","organizations_url":"https://api.github.com/users/squaremo/orgs","repos_url":"https://api.github.com/users/squaremo/repos","events_url":"https://api.github.com/users/squaremo/events{/privacy}","received_events_url":"https://api.github.com/users/squaremo/received_events","type":"User","site_admin":false},"created_at":"2016-06-24T13:29:34Z","updated_at":"2016-06-24T13:29:34Z","body":"> For other uses, the file is /proc/pid/ns/net, and /proc is the same inside the container due to the --pid=host option.\r\n\r\nGot it, ta. I had presumed it would involve `/var/run/netns`."}}
{"actor":{"display_login":"squaremo"}}