Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Exceition: FindAsync returning Resource Not Found #120

Open
indulismisins opened this issue Dec 19, 2019 · 1 comment
Open

Exceition: FindAsync returning Resource Not Found #120

indulismisins opened this issue Dec 19, 2019 · 1 comment

Comments

@indulismisins
Copy link

Hi,

Method FindAsync could not find record by Id value.
When I execute this line of code:
var workflow = await _cosmosStore.FindAsync(command.WorkflowId, new PartitionKey("id"));

I'm getting error:
Executed 'ProcessWorkflows' (Failed, Id=dd9ea974-a1b5-4475-a4da-583a20ea7f5b) [19.12.2019 08:40:20] System.Private.CoreLib: Exception while executing function: ProcessWorkflows. Microsoft.Azure.Cosmos.Client: Response status code does not indicate success: 404 Substatus: 0 Reason: ({ [19.12.2019 08:40:20] "Errors": [ [19.12.2019 08:40:20] "Resource Not Found" [19.12.2019 08:40:20] ] [19.12.2019 08:40:20] }).

When I execute this line of code:
var workflows = _cosmosStore.Query(allowSynchronousQueryExecution: true).Where(w => w.Id == command.WorkflowId).ToList();

I'm getting one item. In both runs command.WorkflowId value is same.
I'm using 3.0.0-preview1 version.

@Elfocrash
Copy link
Owner

This line:
var workflow = await _cosmosStore.FindAsync(command.WorkflowId, new PartitionKey("id"));
needs to be:
var workflow = await _cosmosStore.FindAsync(command.WorkflowId, new PartitionKey(command.WorkflowId));

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants