-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: "panic: runtime error: invalid memory address or nil pointer dereference" when running docker tests (docker built with 1.6beta2) #14001
Comments
CC @bradfitz |
fails on x86 and ppc64le |
Docker wasn't using CloseNotify from the right goroutine. Patch for Docker: diff --git a/api/server/server.go b/api/server/server.go
index a1c57a8..e6a2957 100644
--- a/api/server/server.go
+++ b/api/server/server.go
@@ -1091,10 +1091,11 @@ func postBuild(eng *engine.Engine, version version.Version, w http.ResponseWrite
if closeNotifier, ok := w.(http.CloseNotifier); ok {
finished := make(chan struct{})
defer close(finished)
+ clientGone := closeNotifier.CloseNotify()
go func() {
select {
case <-finished:
- case <-closeNotifier.CloseNotify():
+ case <-clientGone:
log.Infof("Client disconnected, cancelling job: %v", job)
job.Cancel()
} If it worked before, it was just luck. Or it was racy. We've improved the CloseNotifier docs a bunch in this cycle. But I'll make Go panic with a more useful error message so you and others can diagnose this earlier and more easily in the future. |
CL https://golang.org/cl/18708 mentions this issue. |
Thanks. It looks like that's the only spot in the docker code that's an issue, so I can submit a PR to them for this. |
This is happening now due to improvements in net/http: golang/go@99fb191 To test, change the go version in the Dockerfile: -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6beta2 More info here: golang/go#14001 Signed-off-by: Christy Perez <[email protected]>
<3 Thanks. Probably haven't seen it before b/c we haven't done a release with GOMAXPROCS set higher than 1. |
This is happening now due to improvements in net/http: golang/go@99fb191 To test, change the go version in the Dockerfile: -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6beta2 More info here: golang/go#14001 Signed-off-by: Christy Perez <[email protected]>
This is happening now due to improvements in net/http: golang/go@99fb191 To test, change the go version in the Dockerfile: -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6beta2 More info here: golang/go#14001 Signed-off-by: Christy Perez <[email protected]>
I've traced this error back to commit 99fb191
The docker image itself is running Ubuntu trusty:
docker run -it --privileged docker-go1.6beta2 uname -a
Linux 4b2dfe4ce10b 4.2.8-200.fc22.x86_64 #1 SMP Tue Dec 15 16:50:23 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Here's how to get the docker env set up to recreate (all in docker images).
0) Install docker
-ENV GO_VERSION 1.5.3
+ENV GO_VERSION 1.6beta2
pwd
:/go/src/github.com/docker/docker/ ./hack/make.sh binary test-integration-cliYou'll see all the docker tests start to fail with "Cannot connect to the Docker daemon. Is the docker daemon running on this host?"
The -v flag will volume-mount your local directory into the container, so then you can look at logs locally after the container exits. Check
less bundles/latest/test-integration-cli/docker.log
for the stack-trace I pasted above.Because of how the tests are run it's not trivial to tell which of the tests causes the panic that kills the docker daemon, but I'm working on that.
The text was updated successfully, but these errors were encountered: