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

Change Feed with StartFromTime configuration does not work #817

Closed
gpinolo opened this issue Jan 23, 2023 · 4 comments · Fixed by #822
Closed

Change Feed with StartFromTime configuration does not work #817

gpinolo opened this issue Jan 23, 2023 · 4 comments · Fixed by #822

Comments

@gpinolo
Copy link

gpinolo commented Jan 23, 2023

Describe the bug
When specify the StartFromTime for CosmosDBTrigger, the change feed is not triggered

To Reproduce
Configure a function as shown below:

	public async Task run(
            [CosmosDBTrigger("databaseName", "containerName",
                Connection = "COSMOS_CONN",
                LeaseContainerName = "leaseContainer",
                StartFromTime = "2021-02-16T14:19:29Z",
                MaxItemsPerInvocation = 100,
            )] IReadOnlyList<JObject> changeFeedList,
            ILogger log)  
        {
           log.LogInformation("item in changeFeedlist " + changeFeedList.Count);
        }
		

Expected behavior
After cleaning the leaseContainer and then running the function, when a document is saved or updated in containerName the number of inserted/modified document are logged

Actual behavior
Nothing is logged

Environment summary
SDK Version: 3.1.416
OS Version: Windows 10 Pro

Additional context
The DateTimeKind of time is Local, so the ChangeFeedStartFromTime fails to start

@ghost ghost added the Needs: Triage 🔍 label Jan 23, 2023
@GewoonMaarten
Copy link

I get this error message:

DocDBTrace Warning: 0 : Exception System.ArgumentOutOfRangeException: RequestUri: , Specified argument was out of the range of valid values. (Parameter 'time.Kind must be DateTimeKind.Utc'),    at Microsoft.Azure.Cosmos.ChangeFeed.ChangeFeedStartFromTime..ctor(DateTime time, FeedRangeInternal feedRange)
   at Microsoft.Azure.Cosmos.ChangeFeedStartFrom.Time(DateTime dateTimeUtc, FeedRange feedRange)
   at Microsoft.Azure.Cosmos.ChangeFeed.ChangeFeedPartitionKeyResultSetIteratorCore.Create(DocumentServiceLease lease, String continuationToken, Nullable`1 maxItemCount, ContainerInternal container, Nullable`1 startTime, Boolean startFromBeginning)
   at Microsoft.Azure.Cosmos.ChangeFeed.FeedProcessing.FeedProcessorFactoryCore.Create(DocumentServiceLease lease, ChangeFeedObserver observer)
   at Microsoft.Azure.Cosmos.ChangeFeed.FeedManagement.PartitionSupervisorFactoryCore.Create(DocumentServiceLease lease)
   at Microsoft.Azure.Cosmos.ChangeFeed.FeedManagement.PartitionControllerCore.AddOrUpdateLeaseAsync(DocumentServiceLease lease)
   at Microsoft.Azure.Cosmos.ChangeFeed.FeedManagement.PartitionLoadBalancerCore.RunAsync()
DocDBTrace Error: 0 : Partition load balancer lease add/update iteration failed

@gpinolo
Copy link
Author

gpinolo commented Jan 25, 2023

See #809 and Azure/azure-cosmos-dotnet-v3#3559

@ealsur
Copy link
Member

ealsur commented Jan 27, 2023

This will be resolved next week when the new SDK is released.

@ealsur
Copy link
Member

ealsur commented Feb 6, 2023

You can bump the SDK dependency to https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.0, we'll be doing the bump on the extension package shortly.

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

Successfully merging a pull request may close this issue.

3 participants