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

Querying the state does not work in Azure Containers App #4459

Closed
sergiibielskyi opened this issue Mar 31, 2022 · 13 comments
Closed

Querying the state does not work in Azure Containers App #4459

sergiibielskyi opened this issue Mar 31, 2022 · 13 comments
Labels
kind/bug Something isn't working

Comments

@sergiibielskyi
Copy link

Hi team,
I am trying to find the solution to how to get results from state storage by using a specific query, not just getting item by id. I found a good explanation here https://docs.dapr.io/developing-applications/building-blocks/state-management/howto-state-query-api/. And I prepared method to use query state.

CancellationTokenSource source = new CancellationTokenSource();
CancellationToken cancellationToken = source.Token;

    var query = "{" +
            "\"filter\": {" +
                "\"EQ\": { \"value.style\": \""+ style +"\" }" +
            "}" +
        "}";

var queryResponse = await daprClient.QueryStateAsync(storeName, query, cancellationToken: cancellationToken);

Locally, it works. But when I try to publish that into the Azure Containers App I see 500 error and any description why it happens.

I assume, probably Azure Containers App service doesn't have the right Dapr runtime but I can not prove it.
Any ideas?

@sergiibielskyi sergiibielskyi added the kind/bug Something isn't working label Mar 31, 2022
@sergiibielskyi sergiibielskyi changed the title Queuing the state does not worj in Azure Containers App Queuing the state does not work in Azure Containers App Mar 31, 2022
@sergiibielskyi
Copy link
Author

Update. Found an error into app logs
Dapr.DaprException: Query state operation failed: the Dapr endpointed indicated a failure.
See InnerException for details. ---> Grpc.Core.RpcException: Status(StatusCode="Unknown",
Detail="cannot proxy request: missing dapr-app-id metadata")
at Dapr.Client.DaprClientGrpc.QueryStateAsync[TValue](String storeName, String jsonQuery,
IReadOnlyDictionary2 metadata, CancellationToken cancellationToken) --- End of inner exception stack trace --- at Dapr.Client.DaprClientGrpc.QueryStateAsync[TValue](String storeName, String jsonQuery, IReadOnlyDictionary2 metadata, CancellationToken cancellationToken)
at mart.cosmosdb.ObjectController.GetObjectsByQuery(String style)
in /cosmosdb/mart-api-cosmos-db/Controllers/ObjectController.cs:line 38
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.
TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper,
ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.
g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker. <InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application)

@sergiibielskyi sergiibielskyi changed the title Queuing the state does not work in Azure Containers App Querying the state does not work in Azure Containers App Mar 31, 2022
@torosent
Copy link

Hi @sergiibielskyi , Can you reference this issue here https://github.com/microsoft/azure-container-apps/issues?
We will take a look.

@yaron2
Copy link
Member

yaron2 commented Mar 31, 2022

Thanks @sergiibielskyi, closing this as this belongs to the container apps GitHub repository.

@yaron2 yaron2 closed this as completed Mar 31, 2022
@sergiibielskyi
Copy link
Author

Hi @sergiibielskyi , Can you reference this issue here https://github.com/microsoft/azure-container-apps/issues? We will take a look.

did not find. Thanks.

@k33lan
Copy link

k33lan commented Apr 28, 2022

Hi, did you find a solution to this issue? I've gotten this error, but ONLY for querying. Everything else is fine.

@yaron2
Copy link
Member

yaron2 commented Apr 28, 2022

Hi, did you find a solution to this issue? I've gotten this error, but ONLY for querying. Everything else is fine.

Azure Container Apps uses Dapr 1.4 which doesn't support querying. I know they're going to upgrade to 1.7 soon. cc @torosent

@k33lan
Copy link

k33lan commented Apr 28, 2022

Ah, that makes perfect sense. Wish I'd have asked this question a few days ago.

Many thanks for the info!

@sergiibielskyi
Copy link
Author

Hi, did you find a solution to this issue? I've gotten this error, but ONLY for querying. Everything else is fine.

Azure Container Apps uses Dapr 1.4 which doesn't support querying. I know they're going to upgrade to 1.7 soon. cc @torosent

waiting for this upgrade. Thanks.

@sergiibielskyi
Copy link
Author

Just created an issue here microsoft/azure-container-apps#155

@tjoudeh
Copy link

tjoudeh commented Aug 12, 2022

The problem is still there even though they are Container Apps use v1.7.3. I can't query Cosmos DB store when deploying to container apps, while query cosmos db works when I self-host dap on my machine with no issues.

This is the exception I'm receiving

Dapr.DaprException: Query state operation failed: the Dapr endpointed indicated a failure. See InnerException for details.
 ---> Grpc.Core.RpcException: Status(StatusCode="Unimplemented", Detail="Not Implemented")
 at Dapr.Client.DaprClientGrpc.QueryStateAsync[TValue](String storeName, String jsonQuery, IReadOnlyDictionary`2 metadata, CancellationToken cancellationToken)
 --- End of inner exception stack trace ---

image
FYI @yaron2 @torosent if you have any input here

@yaron2
Copy link
Member

yaron2 commented Aug 12, 2022

This needs to be tracked here: microsoft/azure-container-apps#155

@akshat172
Copy link

The issue is still there
image
image

@akshat172
Copy link

Any updates on the fix

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

No branches or pull requests

6 participants