Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddDaprSecretStore always times out #983

Open
lsoft-bho opened this issue Nov 22, 2022 · 3 comments
Open

AddDaprSecretStore always times out #983

lsoft-bho opened this issue Nov 22, 2022 · 3 comments
Labels
area/client/secrets kind/bug Something isn't working

Comments

@lsoft-bho
Copy link

I have services deployed in Azure Container Apps with Dapr enabled. I'm trying to add a secrret store to the configuration like this:

builder.Services.AddDaprClient();

if (!string.IsNullOrEmpty(builder.Configuration["SecretStore"]))
{
    var timeout = builder.Configuration.GetValue("DaprSidecarTimeout", 5);
    using var sp = builder.Services.BuildServiceProvider();
    builder.Configuration.AddDaprSecretStore(builder.Configuration["SecretStore"], sp.GetRequiredService<DaprClient>(), TimeSpan.FromSeconds(timeout));
}

This works locally running with docker compose, but in the container app this always creates the following exception:

Unhandled exception. System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Dapr.Client.DaprClientGrpc.WaitForSidecarAsync(CancellationToken cancellationToken)
at Dapr.Extensions.Configuration.DaprSecretStore.DaprSecretStoreConfigurationProvider.LoadAsync()
at Dapr.Extensions.Configuration.DaprSecretStore.DaprSecretStoreConfigurationProvider.Load()
at Microsoft.Extensions.Configuration.ConfigurationManager.AddSource(IConfigurationSource source)
at Microsoft.Extensions.Configuration.ConfigurationManager.Microsoft.Extensions.Configuration.IConfigurationBuilder.Add(IConfigurationSource source)
...

I have tried with timeouts of up to one minute.

Is there some configuration I am missing that I should have set?

@m1t0k
Copy link

m1t0k commented Nov 25, 2022

I had the same issue, fixed in docker-compose.yml file by adding network_mode:

test-api:
...
...
test-api-dapr:
.....
depends_on:
- test-api
network_mode: "service:test-api"

@lsoft-bho
Copy link
Author

Thank you for your answer @m1t0k, but you misunterstood my problem. It is working with docker-compose - it is not working in Azure Container Apps.

@WhitWaldo
Copy link
Contributor

@lsoft-bho Are you still experiencing this issue? ACA should be running a few newer versions than they were when you first reported the issue and I'm hopeful that between their update and this PR, this issue is now resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client/secrets kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants