question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AddDaprSecretStore Extension always throws unhandled exception at container start

See original GitHub issue

Expected Behavior

Using AddDaprSecretStore extension will not throw an exception when the side car is not ready yet

Actual Behavior

It throws an unhandled exception crashing my pod. On restart, it goes through fine

Unhandled exception. Dapr.DaprException: Bulk secret operation failed: the Dapr endpoint indicated a failure. See InnerException for details.
 ---> Grpc.Core.RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Connection refused (127.0.0.1:50001) SocketException: Connection refused", DebugException="System.Net.Http.HttpRequestException: Connection refused (127.0.0.1:50001)
 ---> System.Net.Sockets.SocketException (111): Connection refused
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|283_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.DefaultConnectAsync(SocketsHttpConnectionContext context, CancellationToken cancellationToken)
   at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)")
   at Dapr.Client.DaprClientGrpc.GetBulkSecretAsync(String storeName, IReadOnlyDictionary`2 metadata, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Dapr.Client.DaprClientGrpc.GetBulkSecretAsync(String storeName, IReadOnlyDictionary`2 metadata, CancellationToken cancellationToken)
   at Dapr.Extensions.Configuration.DaprSecretStore.DaprSecretStoreConfigurationProvider.LoadAsync()
   at Dapr.Extensions.Configuration.DaprSecretStore.DaprSecretStoreConfigurationProvider.Load()
   at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
   at MyApp.Program.Main(String[] args) in /MyApp/Program.cs:line 18

Steps to Reproduce the Problem

Dapr 1.4 running in Kubernetes with a dotnet 5 webapi app.

public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args).ConfigureAppConfiguration(config =>
{
  var daprClient = new DaprClientBuilder().Build();
  config.AddDaprSecretStore(KeyvaultStoreName, daprClient);
}).UseStartup<Startup>();

Release Note

RELEASE NOTE:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
harvendra2022commented, Jan 13, 2022

We have started using Dapr in Microservices written .Net 6 and using DaprSecretStore to get the secretes from Azure Key Vault. It would be great if this issue can be fixed at the earliest? Is there any tentative timeline for the fix?

0reactions
halspangcommented, Feb 11, 2022

Actually, healthz/outbound is already marked as ready before it blocks on the app. I’ll just use that since it already exists 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dapr v1.7 is now available
ADDED Support for providing Actor TypeName during runtime at startup. 677 ; FIXED AddDaprSecretStore Extension always throws unhandled exception ...
Read more >
Untitled
... demonstrate how we can use another approach to secrets in Container Apps. We ... Extension always throws unhandled exception at container start...
Read more >
Apress.Introducing.Distributed.Application.Runtime.Dapr
introduces Dapr: how it works and how to initialize and run it locally. The next chapter covers the basics of containers and Kubernetes....
Read more >
Sidecar resolution issue. In the window that opens, you can dra
... AddDaprSecretStore extension will not throw an exception when the side car is not ready yet Actual Behavior It throws an unhandled exception...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found