{"action":"opened","issue":{"url":"https://api.github.com/repos/vmware/vic/issues/1645","repository_url":"https://api.github.com/repos/vmware/vic","labels_url":"https://api.github.com/repos/vmware/vic/issues/1645/labels{/name}","comments_url":"https://api.github.com/repos/vmware/vic/issues/1645/comments","events_url":"https://api.github.com/repos/vmware/vic/issues/1645/events","html_url":"https://github.com/vmware/vic/issues/1645","id":167311406,"number":1645,"title":"fails to delete container with run --rm","user":{"login":"hickeng","id":3923729,"avatar_url":"https://avatars.githubusercontent.com/u/3923729?v=3","gravatar_id":"","url":"https://api.github.com/users/hickeng","html_url":"https://github.com/hickeng","followers_url":"https://api.github.com/users/hickeng/followers","following_url":"https://api.github.com/users/hickeng/following{/other_user}","gists_url":"https://api.github.com/users/hickeng/gists{/gist_id}","starred_url":"https://api.github.com/users/hickeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hickeng/subscriptions","organizations_url":"https://api.github.com/users/hickeng/orgs","repos_url":"https://api.github.com/users/hickeng/repos","events_url":"https://api.github.com/users/hickeng/events{/privacy}","received_events_url":"https://api.github.com/users/hickeng/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vmware/vic/labels/component/portlayer/execution","name":"component/portlayer/execution","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-25T08:30:19Z","updated_at":"2016-07-25T08:30:19Z","closed_at":null,"body":"There is a timing hole when deleting containers via `run --rm`. The rm occurs as soon as the connection drops in this scenario. Because the shutdown is initiated from within the container and there's an actual OS shutdown, the VM may not have finished powering off by the time the rm is dispatched.\r\n\r\nRecreate\r\n```\r\ndocker run -it --rm busybox /bin/bash\r\n# exit\r\nexit\r\nError response from daemon: server error from portlayer : [DELETE /containers/{id}][500] containerRemoveInternalServerError\r\n```\r\nport layer\r\n```\r\ntime=\"2016-07-17T22:18:49Z\" level=info msg=\"Finished copying stdout stream for container 97633e2f38093f0a3d069d822d67c034c2079dd216aeca305b5ba2e53a19b215\" \r\ntime=\"2016-07-17T22:18:49Z\" level=info msg=\"Finished copying stderr stream for container 97633e2f38093f0a3d069d822d67c034c2079dd216aeca305b5ba2e53a19b215\" \r\ntime=\"2016-07-17T22:18:49Z\" level=info msg=\"Done copying stdin\" \r\ntime=\"2016-07-17T22:18:49Z\" level=debug msg=\"[BEGIN] [github.com/vmware/vic/lib/apiservers/portlayer/restapi/handlers.(*ContainersHandlersImpl).RemoveContainerHandler] Containers.RemoveContainerHandler\" \r\ntime=\"2016-07-17T22:18:49Z\" level=debug msg=\"[BEGIN] [github.com/vmware/vic/lib/portlayer/exec.(*Container).Remove] Container.Remove\" \r\ntime=\"2016-07-17T22:18:49Z\" level=error msg=\"Operation failed: The attempted operation cannot be performed in the current state (Powered on). - (&{{} %!!(MISSING)s(*types.InvalidPowerState=&{{{{<nil> []}}} poweredOff poweredOn}) The attempted operation cannot be performed in the current state (Powered on).})\" \r\ntime=\"2016-07-17T22:18:49Z\" level=debug msg=\"[ END ] [github.com/vmware/vic/lib/portlayer/exec.(*Container).Remove] [418.087372ms] Container.Remove\" \r\ntime=\"2016-07-17T22:18:49Z\" level=debug msg=\"[ END ] [github.com/vmware/vic/lib/apiservers/portlayer/restapi/handlers.(*ContainersHandlersImpl).RemoveContainerHandler] [419.482633ms] Containers.RemoveContainerHandler\" \r\n```\r\n\r\nThis may need some logic to allow for a delayed retry in this scenario - we should run some loop tests to determine how frequently this is seen."}}
{"actor":{"display_login":"hickeng"}}