Getting error "Duplicate Request ID in Batch Request"
See original GitHub issueWe have an app that access google calendar using this lib, everything was working fine until a few hours ago when all requests to calendar have started to throw this error:
[{
"error": {
"code": 400,
"message": "Duplicate Request ID in Batch Request: ",
"errors": [
{
"message": "Duplicate Request ID in Batch Request: ",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}]
Then I found this issue on stackoverflow saying that:
While investigating this issue I found that Google made a change that now requires the “Content-ID” header on each batch request item. This header is currently not set when using the .Net Google.Apis.Requests.BatchRequest class.
Basicly there is a new mandatory field called “Content-ID” and this lib doesn’t add that on Google.Apis.Requests.BatchRequest
, I’ve made a change locally adding this line
content.Headers.Add("Content-ID", rnd.Next().ToString());
to
[VisibleForTestOnly]
internal static async Task<HttpContent> CreateIndividualRequest(IClientServiceRequest request)
{
Random rnd = new Random();
HttpRequestMessage requestMessage = request.CreateRequest(false);
string requestContent = await CreateRequestContentString(requestMessage).ConfigureAwait(false);
var content = new StringContent(requestContent);
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/http");
content.Headers.Add("Content-ID", rnd.Next().ToString());
return content;
}
And everything worked as normal. I think it’s necessary to add this same line on lib.
Environment details
- Programming language: C#
- OS: Windows
- Package version: 1.55.0.2410
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Google Tasks API BatchRequest triggers "Duplicate ...
Starting Sept 13th the Google Tasks BatchRequest update workflow is triggering a 400 error return "Duplicate Request ID in Batch Request" within ...
Read more >Duplicate ID error in batch process
Hi friends, There is a pressing issue that i am encountering in our customer application. I have a batch that runs every dat...
Read more >$batch issue - duplicate records
When I'm working with only one record, the $batch call is working fine... Aditionally, I get the next errors in the $batch call...
Read more >uuid__c duplicates value on record with id
The best possible solution for this scenario would be to synchronize the requests. Make sure, only one record is present in a request/in...
Read more >Batch requests fail if response contains duplicate HTTP ...
A BatchRequest will fail if the HTTP responses in the batch contain duplicate HTTP headers, generating a stack trace like the one seen ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this issue has broken our google integration, millions of calendar subscribers can’t get changes nor new subscriptions are possible now. please fix this ASAP. we had to reduce batch size to 1 to get around this but this introduces serious performance issues
A mitigation for Calendar API has been put in place that should roll in the next few hours. A mitigation will be put in place for the Task API as well. Library or client code does not need to change, once the mitigations are in place, both APIs will continue to accept empty Content-ID as they did before.
I’ll continue to report here when I know more.