Search code examples
pythongoogle-app-enginegoogle-tasks

Taskqueue HTTP 1.1 404 error Google App Engine


We are executing taskqueue. Based on documentation here , we have created a new queue called "generate-reports". Our queue.yaml looks like this.

- name: generate-reports
  target: v2.task-module
  rate: 5/s
  max_concurrent_requests: 10
  bucket_size: 40

We check the google cloud console and can verify that the "generate-reports" queue is active.

We are then placing a task in this queue using this.

class scheduledownloadreport(webapp2.RequestHandler):
    # Call the report to get the elements
    ScheduleReportDownload_cloudapi_obj = schedulereportdownload_cloudapi.ScheduleReportDownload_cloudapi()
    data_sent_obj = ScheduleReportDownload_cloudapi_obj.schedule_download(
                    download_obj)



class schedulereportdownload_cloudapi():     

    taskqueue.Queue(name='generate-reports')            
        task = taskqueue.add(
            url='/schedulebackendtasktocreatereport',
            target='worker',
            queue_name = 'generate-reports',
            params={
                "task_data"     : task_data
            })  

We also tried this.

taskqueue.Queue(name='generate-reports')            
        task = taskqueue.add(
            url='/worker/schedulebackendtasktocreatereport',
            target='worker',
            queue_name = 'generate-reports',
            params={
                "task_data"     : task_data
            })  

In both instances we are getting the following error -

"POST /schedulebackendtasktocreatereport HTTP/1.1" 404 113 https://MY-PROJECT-NAME/schedulereportdownload

If we use just (without the queue_name parameter)

    taskqueue.Queue(name='generate-reports')            
        task = taskqueue.add(
            url='/schedulebackendtasktocreatereport',
            target='worker',
            params={
                "task_data"     : task_data
            })  

the tasks work like a charm. they get queued into the default queue.

UPDATED WITH SOLUTION

- name: generate-reports
  target: worker
  rate: 5/s
  max_concurrent_requests: 10
  bucket_size: 40

Solution

  • Changed the target name to "worker" in queue.yaml and it worked.

    - name: generate-reports
      target: worker
      rate: 5/s
      max_concurrent_requests: 10
      bucket_size: 40