0

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
Jack tileman
  • 813
  • 2
  • 11
  • 26
  • Why does your queue.yaml have `target: v2.task-module` but your call to `taskqueue.Queue` have `target='worker'` – Alex Oct 17 '19 at 23:15
  • Found this by trial and error. Changed it to ***target: worker*** and it worked. Thanks for your comment. – Jack tileman Oct 19 '19 at 03:49
  • @Jacktileman Would be great if you can post the solution as an answer, in order to get more visibility for other users with the same issue! Thanks :) – ericcco Oct 21 '19 at 08:38
  • @eespinola - done. – Jack tileman Oct 22 '19 at 16:10
  • @Jacktileman Thanks for updating your post, but the best way would be to post as a new answer, so other users can see that this post has already an answer accepted. You can do it and accept your own answer, or either I can do it as [community wiki](https://stackoverflow.com/help/privileges/community-wiki). – ericcco Oct 23 '19 at 08:33

1 Answers1

1

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
Jack tileman
  • 813
  • 2
  • 11
  • 26