orleans icon indicating copy to clipboard operation
orleans copied to clipboard

UseDynamoDBClustering: Name or service not known

Open bgiftge opened this issue 6 years ago • 5 comments

Affects Microsoft.Orleans.Clustering.DynamoDB 3.1.0

System.Net.Http.HttpRequestException: Name or service not known
 ---> System.Net.Sockets.SocketException (0xFFFDFFFF): Name or service not 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.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken)
   at Amazon.Runtime.Internal.HttpHandler`1.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.Unmarshaller.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CredentialsRetriever.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Orleans.Clustering.DynamoDB.DynamoDBStorage.GetTableDescription(String tableName)
   at Orleans.Clustering.DynamoDB.DynamoDBStorage.InitializeTable(String tableName, List`1 keys, List`1 attributes, List`1 secondaryIndexes, String ttlAttributeName)
   at Orleans.Clustering.DynamoDB.DynamoDBMembershipTable.InitializeMembershipTable(Boolean tryInitTableVersion)
   at Orleans.Runtime.MembershipService.MembershipTableManager.Start()
   at Orleans.Runtime.MembershipService.MembershipTableManager.<>c__DisplayClass53_0.<<Orleans-ILifecycleParticipant<Orleans-Runtime-ISiloLifecycle>-Participate>g__OnRuntimeGrainServicesStart|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Orleans.Runtime.SiloLifecycleSubject.MonitoredObserver.OnStart(CancellationToken ct)
   at Orleans.LifecycleSubject.<OnStart>g__CallOnStart|7_0(Int32 stage, OrderedObserver observer, CancellationToken cancellationToken)
   at Orleans.LifecycleSubject.OnStart(CancellationToken ct)
   at Orleans.Runtime.Scheduler.AsyncClosureWorkItem.Execute()
   at Orleans.Runtime.Silo.StartAsync(CancellationToken cancellationToken)
   at Orleans.Hosting.SiloWrapper.StartAsync(CancellationToken cancellationToken)
   at Orleans.Hosting.SiloHostedService.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)

bgiftge avatar Feb 25 '20 01:02 bgiftge

I wonder if @pipermatt knows what's going on here. He changed this code recently. I would suspect misconfiguration of the clustering provider.

sergeybykov avatar Feb 27 '20 17:02 sergeybykov

The changes I made only added an implementation for a method that was previously throwing a NotImplementedException... but I’m happy to help diagnose. I’m not seeing this same issue with our silos using the 3.1 DynamoDB clustering...

@bgiftge Can you share a minimal reproduction case?

pipermatt avatar Feb 27 '20 18:02 pipermatt

I don't think I am doing much out of the ordinary: Orleans is initialized with the aspnet core host builder extension "UseOrleans" and clustering for EC2 is configured like this:

builder
      .Configure<ClusterOptions>(options => { options.ClusterId = "testCluster"; options.ServiceId = "test" })
      .ConfigureEndpoints(Environment.MachineName, 5005, 5004)
      .UseDynamoDBClustering(options => options.Service = "test"); 

running .net core 3.1.100 AWSSDK.DynamoDBv2 3.3.105.6

bgiftge avatar Mar 03 '20 20:03 bgiftge

@bgiftge DynamoDBClusteringOptions is expecting the AWS region you are using in options.Service ... like so:

.UseDynamoDBClustering(options => options.Service = "us-east-1");

pipermatt avatar Mar 03 '20 21:03 pipermatt

Thanks, this works. When I used version 3.0.2 and before it was sufficient to set the region in the aws profile, so I wonder what changed.

bgiftge avatar Mar 04 '20 18:03 bgiftge