0

I have a simple netcore 3.0 console app initializing a connection with Azure Service Bus using Rebus(v7.1.0). I built the app to be selfcontained, then I run it on my laptop and on another computer we have at the office.


The problem :

The app is throwing an error (see below) only on the second computer running in a docker container.


What I've try :

  • Running the app without docker on both machine. OK
  • Running the app in a docker container on my laptop using the same Dockerfile. OK
  • I don't find anything relevant in docker logs.
  • Re-install docker on the the 2nd computer.
  • Try an older version of docker. Same problem occur


Questions :

  • Do you know why this is happening ?
  • I am relatively new to docker, can you guys provide me some tools or tips on how to understand what is happening ?


Specs :

My laptop :

  • Windows: 1903 (Build 18362.657)
  • Docker desktop community: 2.2.0.3 (42716)

2nd computer :

  • Windows: 1809 (Build 17763.194)
  • Docker desktop community: 2.2.0.3 (42716)


Thanks a lot for your help !


Complete Error :

[INF] Rebus.AzureServiceBus.AzureServiceBusTransport (Thread #1): Initializing Azure Service Bus transport with queue "blablabla"
[INF] Rebus.Bus.RebusBus (Thread #1): Bus "Rebus 1" stopped
Could not resolve Rebus.Bus.IBus with decorator depth 0 - registrations: Rebus.Injection.Injectionist+Handler
Microsoft.Azure.ServiceBus.ServiceBusException: No such host is known.
 ---> System.Net.Http.HttpRequestException: No such host is known.
 ---> System.Net.Sockets.SocketException (11001): No such host is known.
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Microsoft.Azure.ServiceBus.Management.ManagementClient.SendHttpRequest(HttpRequestMessage request, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.ServiceBus.Management.ManagementClient.SendHttpRequest(HttpRequestMessage request, CancellationToken cancellationToken)
   at Microsoft.Azure.ServiceBus.Management.ManagementClient.GetEntity(String path, String query, Boolean enrich, CancellationToken cancellationToken)
   at Microsoft.Azure.ServiceBus.Management.ManagementClient.GetQueueAsync(String queuePath, CancellationToken cancellationToken)
   at Microsoft.Azure.ServiceBus.Management.ManagementClient.QueueExistsAsync(String queuePath, CancellationToken cancellationToken)
   at Rebus.AzureServiceBus.AzureServiceBusTransport.<>c__DisplayClass30_0.<<InnerCreateQueue>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Rebus.Internals.AsyncHelpers.CustomSynchronizationContext.<Run>b__7_0(Object _)
   at Rebus.Internals.AsyncHelpers.CustomSynchronizationContext.Run()
   at Rebus.Internals.AsyncHelpers.RunSync(Func`1 task)
   at Rebus.AzureServiceBus.AzureServiceBusTransport.InnerCreateQueue(String normalizedAddress)
   at Rebus.AzureServiceBus.AzureServiceBusTransport.Initialize()
   at Rebus.Config.RebusConfigurer.<>c__DisplayClass13_0.<Start>b__27(IResolutionContext c)
   at Rebus.Injection.Injectionist.Resolver`1.InvokeResolver(IResolutionContext context)
   at Rebus.Injection.Injectionist.ResolutionContext.Get[TService]()
jeremybl
  • 1
  • 1
  • Check your network configuration. The error says that it can't find the hostname. – fredrik Mar 05 '20 at 16:36
  • The container's network settings are the same on both machine. I did not set/specified anything about network. – jeremybl Mar 05 '20 at 16:39
  • Are they both on the same network? – Train Mar 05 '20 at 16:41
  • https://hub.docker.com/_/microsoft-windows-nanoserver/ Does this help? – Train Mar 05 '20 at 16:43
  • Yes, the same network in the office. Both machines have access to the internet and Docker can also pull images from a cloud registry. – jeremybl Mar 05 '20 at 16:43
  • Whether docker can pull images or not is immaterial. The difference is in container network configuration isn't. You say you've made no specific network settings for them - then whatever difference there is between docker on the two windows versions is causing an issue for you. Inspect both containers and see if you can see a difference in configuration. Also try turning off any firewall, temporarily, to see if that is causing an issue. – fredrik Mar 05 '20 at 16:50
  • I got it. The real problem was that any container couldn't reach internet. You're comment about pulling images being immaterial made me try different things. The answer that helped me => https://github.com/docker/for-win/issues/2760#issuecomment-430889666 – jeremybl Mar 05 '20 at 20:52

0 Answers0