question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Still experiencing 501 response code while batching

See original GitHub issue

While batching queries to manipulate GSheets, we encounter a 501 error.

The documentation shows that it is indeed supported: https://developers.google.com/api-client-library/dotnet/guide/batch?hl=fr

Someone with python library also encountered this error: https://github.com/googleapis/google-api-python-client/issues/2085

I was curious to read that it has been encountered and fix in the past: https://github.com/googleapis/google-api-dotnet-client/issues/1634

Environment details

  • Programming language: .NetCore 6
  • OS: Windows
  • Language runtime version:
  • Package version: Google.Apis 1.57.0.0

Steps to reproduce

  1. While trying to batch queries for GoogleSheet
  2. the execution of each individual request works
  3. Followed the documentation to batch all the request by making use of Queue()
  4. Code is similar to
SheetsService curSheetsService = new SheetsService(new Google.Apis.Services.BaseClientService.Initializer()
            {
                ApplicationName = "",
                HttpClientInitializer = credentials.First(),
            });

            Google.Apis.Requests.BatchRequest batchRequests = new Google.Apis.Requests.BatchRequest(curSheetsService);

            string range = "Input - OFFER" + "!" + "A1" + ":" + "A10";

            SpreadsheetsResource.ValuesResource.ClearRequest clearRequest = curSheetsService.Spreadsheets.Values.Clear(null, "1NBTwhG7K6uTag8XC9sLM8EmbigY0mJ6KYwUd1Vh8baY", range);
            var response = await clearRequest.ExecuteAsync();         // <- this works

            batchRequests.Queue<ClearValuesResponse>(clearRequest, (content, error, index, message) =>
            {

                logger.LogInformation(error.ToString());  // <- would fail here with message 501 not implemented, not supported o
            });

            await batchRequests.ExecuteAsync();   // <- this would NOT works
  1. Reponse for batch execution is
{
  "error": {
    "code": 501,
    "message": "Operation is not implemented, or supported, or enabled.",
    "errors": [
      {
        "message": "Operation is not implemented, or supported, or enabled.",
        "domain": "global",
        "reason": "notImplemented"
      }
    ],
    "status": "UNIMPLEMENTED"
  }
}

Thanks for getting back to me

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
amanda-tarafacommented, Apr 12, 2023

It’s flag as external as this is an issue with the API and not with the .NET client library. I’m still confirming my suspicions so I can give you a good answer. I’ll update here when I know more.

1reaction
jskeetcommented, Apr 12, 2023

Assigned to Amanda as she looked at this last time and may have insight into what’s happening.

Read more comments on GitHub >

github_iconTop Results From Across the Web

new_http_batch_request throwing 501:"Operation is not ...
I am trying to get google worksheet information in a batch call but getting the ... Still experiencing 501 response code while batching...
Read more >
How to Fix the HTTP 501 Not Implemented Error on Your Site
The HTTP 501 Not Implemented status code indicates that the server does not support the functionality required to fulfill the request.
Read more >
501 Not Implemented - HTTP - MDN Web Docs
501 is the appropriate response when the server does not recognize the request method and is incapable of supporting it for any resource....
Read more >
What Is a 501 Not Implemented Error (and How to Fix It)
A “501 Not Implemented” error occurs when a website you visit lacks the functionality to retrieve or show information that your web browser ......
Read more >
How to Fix the HTTP Error Code 501
The important thing to recognize is that when receiving a 501 error, the user has done nothing wrong. It is entirely server-based, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found