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.

TagManager v2 batch requests return 404

See original GitHub issue

Hello. I was trying to send batch request to TagManager API and got 404 error. Here is my code:

var service = new TagManagerService(new BaseClientService.Initializer()
{
    HttpClientInitializer = credential, ApplicationName = "..."
});
var batchRequest = new BatchRequest(service);
foreach (var variable in toAdd)
{
    batchRequest.Queue<AccountsResource.ContainersResource.WorkspacesResource.VariablesResource.CreateRequest>(
        service.Accounts.Containers.Workspaces.Variables.Create(variable, workspace.Path),
        (content, error, index, message) =>
        {
           // ...
        });
}
await batchRequest.ExecuteAsync(cancellationToken);

It fails with HttpRequestException:

System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at Google.Apis.Requests.BatchRequest.ExecuteAsync(CancellationToken cancellationToken)

I’ve seen this announcement - https://developers.googleblog.com/2018/03/discontinuing-support-for-json-rpc-and.html and i send homogenous request to specific api. But it still doesn’t work.

Request goes to https://www.googleapis.com/batch/tagmanager/v2 and if i open it browser it also shows 404 page. I’ve checked discovery document - https://www.googleapis.com/discovery/v1/apis/tagmanager/v2/rest - and there is same batch url

"batchPath": "batch/tagmanager/v2"

However, if i initialize batch request with old global batch url value, e.g

var batchRequest = new BatchRequest(service, "https://www.googleapis.com/batch");

it works. But soon this url will be switched off, so this is not a solution.

I’m not sure this is a client library problem, but i hope someone can help me here =) Thx.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SonicGDcommented, Jul 2, 2020

Yes, i’ve tested and now everything working. Thank you!

1reaction
amanda-tarafacommented, Jun 23, 2020

As an FYI, this is being fixed. It might take a few days before the fix is in and rolled out, but I’ll update here when it’s done. Again, thanks for reporting!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Tag Manager 404 error (gtm.js 404)
Your browser is requesting data from Google's servers although that container is still not published yet, thus no data will be returned. The ......
Read more >
Tag Manager API v2 batch end point stopped working
This batch end point is throwing error 404. https://content.googleapis.com/batch/tagmanager/v2. What you expected to happen: It should return response.
Read more >
Solving the Google Tag Manager 404 Error Message - UpBuild
In Google Tag Assistant, the message reads: “HTTP response code indicates tag failed to fire: Status 404. This could be due to an...
Read more >
How to Track, Find and Fix 404 Errors in GA4
1. Jump into GA4 and in the left navigation, click on Reports. · 2. Then click Engagement, followed by Pages and screens. ·...
Read more >
Server-side Tagging In Google Tag Manager
Google Tag Manager has now released Server-side tagging into ... However, all of the requests that we send events return 404 not found....
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