{"action":"created","issue":{"url":"https://api.github.com/repos/arquillian/arquillian-cube/issues/310","repository_url":"https://api.github.com/repos/arquillian/arquillian-cube","labels_url":"https://api.github.com/repos/arquillian/arquillian-cube/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/arquillian/arquillian-cube/issues/310/comments","events_url":"https://api.github.com/repos/arquillian/arquillian-cube/issues/310/events","html_url":"https://github.com/arquillian/arquillian-cube/issues/310","id":138493888,"number":310,"title":"InternalServerErrorException: http: Hijack is incompatible with use of CloseNotifier","user":{"login":"foxlegend","id":673172,"avatar_url":"https://avatars.githubusercontent.com/u/673172?v=3","gravatar_id":"","url":"https://api.github.com/users/foxlegend","html_url":"https://github.com/foxlegend","followers_url":"https://api.github.com/users/foxlegend/followers","following_url":"https://api.github.com/users/foxlegend/following{/other_user}","gists_url":"https://api.github.com/users/foxlegend/gists{/gist_id}","starred_url":"https://api.github.com/users/foxlegend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foxlegend/subscriptions","organizations_url":"https://api.github.com/users/foxlegend/orgs","repos_url":"https://api.github.com/users/foxlegend/repos","events_url":"https://api.github.com/users/foxlegend/events{/privacy}","received_events_url":"https://api.github.com/users/foxlegend/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-03-04T14:52:35Z","updated_at":"2016-03-10T15:08:12Z","closed_at":null,"body":"Hello there,\r\n\r\nI had a new issue when building the image with Cube.\r\nIn fact, it seems to be a known issue with docker itself I could not explain.\r\n\r\nWhen building an image, Cube seems to perform the following Docker API queries:\r\n\r\n* ping (OK),\r\n* build the image with Dockerfile directory content (OK),\r\n* create the container (OK),\r\n* start the container (OK),\r\n* inspect the container (OK),\r\n* create the await command `ss -lntu | grep … etc.` (OK),\r\n* execute the command (KO).\r\n\r\nWhen the command execution query is sent to my docker host, I obtain:\r\n\r\n* the `com.github.dockerjava.api.InternalServerErrorException: http: Hijack is incompatible with use of CloseNotifier` from my project side,\r\n* a `500 Internal Server Error` with message `http: Hijack is incompatible with use of CloseNotifier` from docker host logs.\r\n\r\nAdditional information I can provide:\r\n\r\n* full logs from project: [arquillian_cube_full_logs.txt](https://github.com/arquillian/arquillian-cube/files/158804/arquillian_cube_full_logs.txt),\r\n* docker logs: [docker_full_logs.txt](https://github.com/arquillian/arquillian-cube/files/158809/docker_full_logs.txt)\r\n* arquillian.xml: [arquillian.xml.txt](https://github.com/arquillian/arquillian-cube/files/158812/arquillian.xml.txt) (please note that removing the database image results in the same issue),\r\n* the same issue occured with Docker 1.8.2 and 1.10.0.\r\n\r\nI found that the issue was something already \"known\":\r\n\r\n* [Hijack is incompatible with use of CloseNotifier](https://github.com/docker/docker/issues/12845),\r\n* [Close connection after building or pulling](https://github.com/docker/compose/pull/1374),\r\n* [Dockerpy - Making the container with Python](http://harpoon.readthedocs.org/en/latest/docs/building_harpoon/section1/introduce_dockerpy.html#making-the-container-with-python).\r\n\r\nIt seems there is a bug in go, causing Docker daemon issues when using a recycled connection.\r\n\r\nTo try a workaround, I shadowed the `DockerClientExecutor` in order to release the `dockerClient` instance properly (`dockerClient.close()`) after the build request (in the `buildImage` method) and create a new instance of `DockerClient`. Everything is working for me now with such a solution.\r\n\r\nDo no hesitate if you need more information about the issue (or if I have not been very understandable ;))!\r\n\r\nDavid."},"comment":{"url":"https://api.github.com/repos/arquillian/arquillian-cube/issues/comments/194892659","html_url":"https://github.com/arquillian/arquillian-cube/issues/310#issuecomment-194892659","issue_url":"https://api.github.com/repos/arquillian/arquillian-cube/issues/310","id":194892659,"user":{"login":"lordofthejars","id":1517153,"avatar_url":"https://avatars.githubusercontent.com/u/1517153?v=3","gravatar_id":"","url":"https://api.github.com/users/lordofthejars","html_url":"https://github.com/lordofthejars","followers_url":"https://api.github.com/users/lordofthejars/followers","following_url":"https://api.github.com/users/lordofthejars/following{/other_user}","gists_url":"https://api.github.com/users/lordofthejars/gists{/gist_id}","starred_url":"https://api.github.com/users/lordofthejars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lordofthejars/subscriptions","organizations_url":"https://api.github.com/users/lordofthejars/orgs","repos_url":"https://api.github.com/users/lordofthejars/repos","events_url":"https://api.github.com/users/lordofthejars/events{/privacy}","received_events_url":"https://api.github.com/users/lordofthejars/received_events","type":"User","site_admin":false},"created_at":"2016-03-10T15:08:12Z","updated_at":"2016-03-10T15:08:12Z","body":"Absolutely, we need to find what is happening :) and if you found a possible solution with code maybe we can extrapolate to other situations. Thanks"}}