Cloud tasks failing while transitioning to a load balancer

Hi everyone,

I am currently in the process of migrating our production traffic to a Google Cloud Global External HTTP(S) Load Balancer and have encountered a specific issue with Google Cloud Tasks.

The Architecture:

  • Source: Google Cloud Tasks (HTTP Target) sending POST requests with payloads.

  • Destination: A backend service exposed via the new Global External-Managed Load Balancer.

  • LB Configuration: The URL Map includes a route rule to handle host redirects (e.g., redirecting example.comwww.example.com or enforcing HTTPS).

  • Current Redirect Action: We are using redirectResponseCode: MOVED_PERMANENTLY_DEFAULT (HTTP 301).

The Issue: During our testing phase (simulating the traffic migration), we observed that Cloud Tasks fail when we changed the CNAME of our site to send the traffic to the load balancer instead of directly app engine app.

Even if DNS change take time to propogate, our old app engine registration should work because I had not cancelled it.

There are no logs of tasks failing in the cloud logging so they are lost before they even reach the app.

Questions:

  1. Is something wrong with my configuration? Am I not aware of any network setting which might have something to do with this?

Has anyone successfully configured GCLB to handle POST redirects for Cloud Tasks?

Thanks!

1 Like

Hi @Yash_Virani Cloud Tasks does not properly handle 301 redirects for POST requests. When your load balancer redirects the request, the task may fail or change from POST to GET, so it never reaches your backend and you see no logs. The fix is to configure Cloud Tasks to call the final correct URL directly and remove the redirect for that endpoint. Do not rely on 301 redirects for task traffic.