Taskqueue INVALID_REQUEST error in pull queues

45 views
Skip to first unread message

Andrew Haskell

unread,
Jan 12, 2016, 12:49:52 PM1/12/16
to Google App Engine
I'm using a pull queue in Appengine for Go and while locally leasing tasks worked just fine, when I deployed my code, the call to taskqueue.Lease gave me this error:

API error 13 (taskqueue: INVALID_REQUEST) *internal.APIError

My lease call was:

tasks, err := taskqueue.Lease(ctx, 100, "pullqueue", 60)

And it has happened no matter what parameters I pass in, like parameters for a blank queue name. Has anyone else gotten this error? Thanks in advance for the help!

Andrew Haskell

unread,
Jan 12, 2016, 3:38:26 PM1/12/16
to Google App Engine
Nvm in my real code I was leasing 2000 tasks but the max I can lease is actually 1000.

Nicholas (Google Cloud Support)

unread,
Jan 12, 2016, 5:28:39 PM1/12/16
to Google App Engine
Thank you for sharing your error and discovery here with us. As you've mentioned, the maximum number of tasks one can lease is 1000, as supported by this Go article about Leasing tasks with Pull Queues. This is also the case for all other available runtimes. On a side note related to your earlier tests, the taskqueue.go source code on line 355 reveals that supplying the queueName parameter with an empty string will be substituted with the value "default":

func lease(c appengine.Context, maxTasks int, queueName string, leaseTime int, groupByTag bool, tag []byte) ([]*Task, error) {
  if queueName == "" {
    queueName = "default"
  }
  // ...
}

If other issues arise with this same error message, feel free to contribute more tests, results and logs here.

Cheers,
Reply all
Reply to author
Forward
0 new messages