1

Basically, I am facing an issue while n number of taskqueues are running in the Google Cloud Platform. There is no error in code or server but the execution of the taskqueues got terminated due to instance unavailability by which it will trigger a taskqueue again and again.

I know a few reasons by which this kind of termination process takes place.

Reasons:

  1. Instance Unavailable
  2. App Error / AppEngine Error
  3. Memory Exceeded

I want to know the other possible values for the X-AppEngine-TaskRetryReason header.

For example (the response of GAE):

self.request.headers {'Content_Length': '432', 'Content-Length': '432', 'X-Appengine-Current-Namespace': '75f4910a-b925-4945-92f0-b214a459f0be', 'X-Appengine-Taskexecutioncount': '1', 'X-Appengine-Tasketa': '1624452214.545367', 'User-Agent': 'AppEngine-Google; (+http://code.google.com/appengine)', 'X-Appengine-Taskpreviousresponse': '503', 'Host': 'payqa-dot-hw-pay.qa.appspot.com', 'X-Appengine-Taskretrycount': '2', 'Referer': 'http://payqa-dot-hw-pay.qa-.appspot.com/pay/runpayroll', 'Content_Type': 'application/octet-stream', 'X-Cloud-Trace-Context': 'd44fdfd56bc7733afb3169fb354b80ed/6659926505008598367', 'Traceparent': '00-d44fdfd56bc7733afb3169fb354b80ed-5c6ccfded93f0d5f-00', 'X-Appengine-Queuename': 'payroll', 'X-Appengine-Taskname': '21925984910338157231', 'Content-Type': 'application/octet-stream', 'X-Appengine-Country': 'ZZ', **'X-Appengine-Taskretryreason': 'Instance Unavailable'**}
Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
  • There is no listing in the documentation for the possible values of `X-AppEngine-TaskRetryReason`, it only states that it's `The reason for retrying the task.`. You could open a [Customer issue in Google's issue tracker](https://cloud.google.com/support/docs/issue-trackers#:~:text=Create%20new%20App%20Engine%20issue) to get that information from their Engineering team. But why do you want that information? Seems to me like you already have narrowed down possible causes of the issue and just need to follow through on those. – Ralemos Jul 01 '21 at 12:18
  • Thanks, Rafael Lemos for the reply, I want this information because I want to put some conditions in my code for this error so that I can easily handle taskqueue retry problems and GCP instance costs. – Mihir Shukla Jul 02 '21 at 09:39

1 Answers1

0

Like I mentioned in the comments there is no listing in the documentation for the possible values of X-AppEngine-TaskRetryReason and it only states that it represents:

The reason for retrying the task.

That being said there is two possibilities why this happens, either this has no specific value and just spits out whatever message it is passed to it by the actual class or component that generated the failure of the execution of the tasks or this is not being shared because the Google Cloud team did not considered it necessary.

Either way if you want to know why this happens and what values you can expect, you should open a Customer issue in Google's Issue Tracker so you can check why this is not shared in the documentation with their Engineering team.

Ralemos
  • 5,571
  • 2
  • 9
  • 18