Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
SocketException starting Linux ProGet in Docker
-
I assume I am doing something wrong with my docker setup as this appeared after restarting a previously working instance. But I am at a loss as nothing changed in my config and the error is a bind error which only makes sense of the socket is being sent bad info.
Docker Command:
/usr/bin/docker run -v /etc/localtime:/etc/localtime:ro -v /home/proget/packages:/var/proget/packages -v /home/proget/extensions:/var/proget/extensions -p 8081:80 --name=proget --net=bridge -e PROGET_DATABASE="Server=172.17.0.1;Database=proget;User Id=;Password=;" inedo/proget:latestStack Trace:
Starting DockerUploadCleanupExecuter...
Unhandled Exception:
System.Net.Sockets.SocketException (0x80004005): The requested address is not valid in this contextServer stack trace:
at System.Net.Sockets.Socket.Bind (System.Net.EndPoint localEP) [0x0004c] in <5641e4edad4f4464ba58c620a7b8ea48>:0
at System.Net.EndPointListener..ctor (System.Net.HttpListener listener, System.Net.IPAddress addr, System.Int32 port, System.Boolean secure) [0x0004a] in <5641e4edad4f4464ba58c620a7b8ea48>:0
at System.Net.EndPointManager.GetEPListener (System.String host, System.Int32 port, System.Net.HttpListener listener, System.Boolean secure) [0x000be] in <5641e4edad4f4464ba58c620a7b8ea48>:0
at System.Net.EndPointManager.AddPrefixInternal (System.String p, System.Net.HttpListener listener) [0x00064] in <5641e4edad4f4464ba58c620a7b8ea48>:0
at System.Net.EndPointManager.AddListener (System.Net.HttpListener listener) [0x00030] in <5641e4edad4f4464ba58c620a7b8ea48>:0Exception rethrown at [0]:
at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_remoting_wrapper (intptr,intptr)
at (wrapper remoting-invoke) Inedo.Web.Server.HttpListenerHost:Start (Inedo.Web.Server.WebServerConfiguration)
at (wrapper xdomain-invoke) Inedo.Web.Server.HttpListenerHost:Start (Inedo.Web.Server.WebServerConfiguration)
at (wrapper remoting-invoke-with-check) Inedo.Web.Server.HttpListenerHost:Start (Inedo.Web.Server.WebServerConfiguration)
at Inedo.Web.Server.IntegratedServer.ProcessRequests () [0x00042] in <a916a109296c4f6da15cf8a9df666821>:0
at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <f712f98eb8e445c8918edaf595bbe465>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Net.Sockets.SocketException (0x80004005): The requested address is not valid in this contextServer stack trace:
at System.Net.Sockets.Socket.Bind (System.Net.EndPoint localEP) [0x0004c] in <5641e4edad4f4464ba58c620a7b8ea48>:0
at System.Net.EndPointListener..ctor (System.Net.HttpListener listener, System.Net.IPAddress addr, System.Int32 port, System.Boolean secure) [0x0004a] in <5641e4edad4f4464ba58c620a7b8ea48>:0
at System.Net.EndPointManager.GetEPListener (System.String host, System.Int32 port, System.Net.HttpListener listener, System.Boolean secure) [0x000be] in <5641e4edad4f4464ba58c620a7b8ea48>:0
at System.Net.EndPointManager.AddPrefixInternal (System.String p, System.Net.HttpListener listener) [0x00064] in <5641e4edad4f4464ba58c620a7b8ea48>:0
at System.Net.EndPointManager.AddListener (System.Net.HttpListener listener) [0x00030] in <5641e4edad4f4464ba58c620a7b8ea48>:0Exception rethrown at [0]:
at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_remoting_wrapper (intptr,intptr)
at (wrapper remoting-invoke) Inedo.Web.Server.HttpListenerHost:Start (Inedo.Web.Server.WebServerConfiguration)
at (wrapper xdomain-invoke) Inedo.Web.Server.HttpListenerHost:Start (Inedo.Web.Server.WebServerConfiguration)
at (wrapper remoting-invoke-with-check) Inedo.Web.Server.HttpListenerHost:Start (Inedo.Web.Server.WebServerConfiguration)
at Inedo.Web.Server.IntegratedServer.ProcessRequests () [0x00042] in <a916a109296c4f6da15cf8a9df666821>:0
at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <f712f98eb8e445c8918edaf595bbe465>:0Product: ProGet
Version: 4.7.6
-
Is something else listening on port 8081 on the host? ProGet's docker image only tries to listen using a System.Net.HttpListener with the prefix
"http://*:80/"
, which ends up listening on port 80 on all available interfaces in the container.
-
Was the first thing I checked. netstat -atp --numeric-ports shows nothing bound to 8081. There is however something bound to port 80 on the host.
-
Hmm, I just tried it locally and Docker gives a very different error message for my hypothesis:
docker: Error response from daemon: driver failed programming external connectivity on endpoint proget (559abf94e7064e2fa65b27ebf9c334b517927912b0eb73763a0875c6c060d4a7): Error starting userland proxy: listen tcp 0.0.0.0:8081: bind: address already in use.
Is it possible something is still holding one end of a connection open to port 8081 on the host?
-
Something that is invisible to netstat and survived a restart? (NOTE: ran netstat as root)
-
Hmm, if you rebooted the host, that's probably not it.
-
Tried stoping the service that was tying up port 80. No help.