{"action":"created","issue":{"url":"https://api.github.com/repos/Metaswitch/calico-docker/issues/99","labels_url":"https://api.github.com/repos/Metaswitch/calico-docker/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/Metaswitch/calico-docker/issues/99/comments","events_url":"https://api.github.com/repos/Metaswitch/calico-docker/issues/99/events","html_url":"https://github.com/Metaswitch/calico-docker/issues/99","id":71808878,"number":99,"title":"docker run will get stuck if command exit immediately","user":{"login":"frostynova","id":1219822,"avatar_url":"https://avatars.githubusercontent.com/u/1219822?v=3","gravatar_id":"","url":"https://api.github.com/users/frostynova","html_url":"https://github.com/frostynova","followers_url":"https://api.github.com/users/frostynova/followers","following_url":"https://api.github.com/users/frostynova/following{/other_user}","gists_url":"https://api.github.com/users/frostynova/gists{/gist_id}","starred_url":"https://api.github.com/users/frostynova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frostynova/subscriptions","organizations_url":"https://api.github.com/users/frostynova/orgs","repos_url":"https://api.github.com/users/frostynova/repos","events_url":"https://api.github.com/users/frostynova/events{/privacy}","received_events_url":"https://api.github.com/users/frostynova/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-29T08:10:17Z","updated_at":"2015-05-07T00:38:17Z","closed_at":"2015-05-07T00:38:17Z","body":"```\r\nexport DOCKER_HOST=localhost:2377\r\ndocker run -e CALICO_IP=auto ubuntu date\r\n```\r\n\r\nThen it will hang. Powerstrip error log is:\r\n\r\n```\r\n2015-04-29 07:58:19,634 [ERROR] powerstrip-calico.py.__main__ 91: Failed to process POST\r\nTraceback (most recent call last):\r\n  File \"powerstrip-calico.py\", line 83, in render_POST\r\n    result = self._handle_post_hook(request, request_content)\r\n  File \"powerstrip-calico.py\", line 112, in _handle_post_hook\r\n    self._install_endpoint(client_request)\r\n  File \"powerstrip-calico.py\", line 174, in _install_endpoint\r\n    next_hop_ips=next_hop_ips)\r\n  File \"/adapter/netns.py\", line 122, in set_up_endpoint\r\n    check_call(\"ip link set %s netns %s\" % (iface_tmp, cpid), shell=True)\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 540, in check_call\r\n    raise CalledProcessError(retcode, cmd)\r\nCalledProcessError: Command 'ip link set tmp7ff46598ee4 netns 18258' returned non-zero exit status 2\r\n```\r\n\r\nI think this is because powerstrip has no time to execute the POST-HOOK which added ip for the container.\r\n\r\nIf i add a ```sleep 3``` then everything is ok.\r\n```\r\ndocker run -e CALICO_IP=auto ubuntu bash -c \"sleep3; date\"\r\n````\r\n\r\nBut i think it would be better if not get stuck in this case.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Metaswitch/calico-docker/issues/comments/99660046","html_url":"https://github.com/Metaswitch/calico-docker/issues/99#issuecomment-99660046","issue_url":"https://api.github.com/repos/Metaswitch/calico-docker/issues/99","id":99660046,"user":{"login":"robbrockbank","id":3227729,"avatar_url":"https://avatars.githubusercontent.com/u/3227729?v=3","gravatar_id":"","url":"https://api.github.com/users/robbrockbank","html_url":"https://github.com/robbrockbank","followers_url":"https://api.github.com/users/robbrockbank/followers","following_url":"https://api.github.com/users/robbrockbank/following{/other_user}","gists_url":"https://api.github.com/users/robbrockbank/gists{/gist_id}","starred_url":"https://api.github.com/users/robbrockbank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbrockbank/subscriptions","organizations_url":"https://api.github.com/users/robbrockbank/orgs","repos_url":"https://api.github.com/users/robbrockbank/repos","events_url":"https://api.github.com/users/robbrockbank/events{/privacy}","received_events_url":"https://api.github.com/users/robbrockbank/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T00:38:17Z","updated_at":"2015-05-07T00:38:17Z","body":"Fix for issue #95 added protective exception handling in the webhooks - so this no longer hangs.\r\n\r\nYou will still see the exception in the logs, but the docker command completes."}}