[SOLVED] "Name or service not known" exception when app starts

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [X] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

I’ve deployed the app as a container to a Linux App Service in Azure. After I enable vnet integration on the app, the application no longer loads. It throws an exception at OrleansService line 73 with message: Name or service not known

I’ve added some logging, Dns.GetHostName() returns e.g.

b6737257279f

But it breaks at this line.

When I disable vnet integration, it all works, and it e.g. returns 172.16.58.3

Logging, first line is custom logging I’ve added:

2019-11-05T20:45:19.401738048Z Resolving IP address for host name 59d0831c727a
2019-11-05T20:45:19.537646872Z Unhandled exception. System.AggregateException: One or more errors occurred. (Name or service not known)
2019-11-05T20:45:19.537675172Z  ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (00000005, 0xFFFDFFFF): Name or service not known
2019-11-05T20:45:19.537683272Z    at System.Net.Dns.InternalGetHostByName(String hostName)
2019-11-05T20:45:19.537699173Z    at System.Net.Dns.ResolveCallback(Object context)
2019-11-05T20:45:19.537703573Z --- End of stack trace from previous location where exception was thrown ---
2019-11-05T20:45:19.537720473Z    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source)
2019-11-05T20:45:19.537724673Z    at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult)
2019-11-05T20:45:19.537728673Z    at System.Net.Dns.EndGetHostAddresses(IAsyncResult asyncResult)
2019-11-05T20:45:19.537732673Z    at System.Net.Dns.<>c.<GetHostAddressesAsync>b__25_1(IAsyncResult asyncResult)
2019-11-05T20:45:19.537737073Z    at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
2019-11-05T20:45:19.537741073Z --- End of stack trace from previous location where exception was thrown ---
2019-11-05T20:45:19.537744973Z    at Squidex.Config.Orleans.Helper.ResolveIPAddressAsync(String addressOrHost, AddressFamily family) in /src/src/Squidex/Config/Orleans/Helper.cs:line 34
2019-11-05T20:45:19.537760873Z    --- End of inner exception stack trace ---
2019-11-05T20:45:19.537764873Z    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
2019-11-05T20:45:19.537768873Z    at System.Threading.Tasks.Task`1.get_Result()
2019-11-05T20:45:19.537772973Z    at Squidex.Config.Orleans.OrleansServices.ConfigureForSquidex(ISiloBuilder builder, IConfiguration config) in /src/src/Squidex/Config/Orleans/OrleansServices.cs:line 75
2019-11-05T20:45:19.537777273Z    at Squidex.Program.<>c.<CreateHostBuilder>b__1_3(HostBuilderContext context, ISiloBuilder builder) in /src/src/Squidex/Program.cs:line 52
2019-11-05T20:45:19.537781673Z    at Orleans.Hosting.SiloBuilder.Build(HostBuilderContext context, IServiceCollection serviceCollection)
2019-11-05T20:45:19.537785873Z    at Microsoft.Extensions.Hosting.GenericHostExtensions.<>c__DisplayClass0_0.<UseOrleans>b__0(HostBuilderContext context, IServiceCollection services)
2019-11-05T20:45:19.537790573Z    at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
2019-11-05T20:45:19.537794873Z    at Microsoft.Extensions.Hosting.HostBuilder.Build()
2019-11-05T20:45:19.545104618Z    at Squidex.Program.Main(String[] args) in /src/src/Squidex/Program.cs:line 23

Expected behavior

The application should work fine with vnet integration enabled.

Environment

  • [X] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: netcore3.0

What else

Linux App Services and vnet integration is still in preview. The only caveat I found is that it runs on a custom port, see here. I’ve modified the code to read this PORT environment variable and if it’s set, it will listen on that port. So, that should be fine.

Thanks, can you post information to: Self Hosting Squidex, how to secure Mongo with vnet? ?

1 Like

Can you try dev-3328?

Hi @Sebastian thanks for your help, sorry for my late reply. I see my messages have been marked as spam, not sure why?
Anyway, we solved our problem by not using vnets… It turned out to be too complicated, plus it’s a preview feature in Azure.
Thanks again for the prompt reply.

I do not know either …thanks for your response.