Windows: [TP4] Fix daemon AV on docker network ls#17036
Closed
lowenna wants to merge 1 commit intomoby:masterfrom
Closed
Windows: [TP4] Fix daemon AV on docker network ls#17036lowenna wants to merge 1 commit intomoby:masterfrom
lowenna wants to merge 1 commit intomoby:masterfrom
Conversation
Signed-off-by: John Howard <[email protected]>
Contributor
|
I think the bug here is that the router includes the networking endpoints when it should not. That operation should be a 404 when the network controller is not initialized. Let me check the code. |
Contributor
|
@jhowardmsft please take a look at #17128 that should fix all the network routes on windows. |
Member
Author
|
I'll verify the other PR too locally over the weekend. Should this PR still be in though as a safety check regardless? |
Contributor
|
I'd vote to not add any defensive check inside the daemon. That function should never be used when the network controller is not initialized. I rather make the daemon explode, like it does now, if it happens again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: John Howard [email protected]
@mavenugo.
docker network lswill cause the daemon to AV in GetNetworksByID by dereferencing through a nil pointer without this fix.Before
time="2015-10-14T11:39:26.396368600-07:00" level=info msg="GET /v1.22/networks" 2015/10/14 11:39:26 http: panic serving 127.0.0.1:51377: runtime error: invalid memory address or nil pointer dereference goroutine 16 [running]: net/http.func·011() C:/Go/src/net/http/server.go:1130 +0xc2 github.com/docker/docker/daemon.(*Daemon).GetNetworksByID(0xc08206b400, 0x0, 0x0, 0x0, 0x0, 0x0) e:/go/src/github.com/docker/docker/daemon/network.go:77 +0x17e github.com/docker/docker/api/server/router/network.(*networkRouter).getNetworksList(0xc08259f2e0, 0x2171f28, 0xc08280d470, 0x2171ec8, 0xc0827ec8c0, 0xc0827b2340, 0xc08280d020, 0x0, 0x0) e:/go/src/github.com/docker/docker/api/server/router/network/network_routes.go:52 +0x76b github.com/docker/docker/api/server/router/network.*networkRouter.(github.com/docker/docker/api/server/router/network.getNetworksList)·fm(0x2171f28, 0xc08280d470, 0x2171ec8, 0xc0827ec8c0, 0xc0827b2340, 0xc08280d020, 0x0, 0x0) e:/go/src/github.com/docker/docker/api/server/router/network/network.go:32 +0x82 github.com/docker/docker/api/server.func·004(0x2171f28, 0xc08280d470, 0x2171ec8, 0xc0827ec8c0, 0xc0827b2340, 0xc08280d020, 0x0, 0x0) e:/go/src/github.com/docker/docker/api/server/middleware.go:87 +0x7ce github.com/docker/docker/api/server.func·003(0x20d2b68, 0xc082002fd8, 0x2171ec8, 0xc0827ec8c0, 0xc0827b2340, 0xc08280d020, 0x0, 0x0) e:/go/src/github.com/docker/docker/api/server/middleware.go:66 +0x115 github.com/docker/docker/api/server.func·002(0x20d2b68, 0xc082002fd8, 0x2171ec8, 0xc0827ec8c0, 0xc0827b2340, 0xc08280d020, 0x0, 0x0) e:/go/src/github.com/docker/docker/api/server/middleware.go:49 +0x483 github.com/docker/docker/api/server.func·001(0x20d2b68, 0xc082002fd8, 0x2171ec8, 0xc0827ec8c0, 0xc0827b2340, 0xc08280d020, 0x0, 0x0) e:/go/src/github.com/docker/docker/api/server/middleware.go:27 +0x1e3 github.com/docker/docker/api/server.func·007(0x2171ec8, 0xc0827ec8c0, 0xc0827b2340) e:/go/src/github.com/docker/docker/api/server/server.go:156 +0x26c net/http.HandlerFunc.ServeHTTP(0xc0827b8080, 0x2171ec8, 0xc0827ec8c0, 0xc0827b2340) C:/Go/src/net/http/server.go:1265 +0x48 github.com/gorilla/mux.(*Router).ServeHTTP(0xc082519f90, 0x2171ec8, 0xc0827ec8c0, 0xc0827b2340) e:/go/src/github.com/docker/docker/vendor/src/github.com/gorilla/mux/mux.go:98 +0x29e net/http.serverHandler.ServeHTTP(0xc08204eae0, 0x2171ec8, 0xc0827ec8c0, 0xc0827b2340) C:/Go/src/net/http/server.go:1703 +0x1a1 net/http.(*conn).serve(0xc0827ec820) C:/Go/src/net/http/server.go:1204 +0xb5e created by net/http.(*Server).Serve C:/Go/src/net/http/server.go:1751 +0x365E:\go\src\github.com\docker\docker\integration-cli>docker network ls An error occurred trying to connect: Get http://localhost:2375/v1.22/networks: EOFAfter
time="2015-10-14T11:44:22.006103700-07:00" level=debug msg="Calling GET /v1.22/networks" time="2015-10-14T11:44:22.009104400-07:00" level=info msg="GET /v1.22/networks"E:\go\src\github.com\docker\docker\integration-cli>docker network ls NETWORK ID NAME DRIVER