It turns out I need to use 'url=url' instead just url as the first 
positional parameter

Thanks for your suggestion!

Cheers

On Saturday, 9 January 2016 07:00:26 UTC+11, Christian F. Howes wrote:
>
> are you using a fully qualified URL or a relative URL?  i use a relative 
> URL and let the taskqueue handler figure it out.
>
> note that you can use secure with URLs accessed by the task queue.
>
> On Thursday, January 7, 2016 at 6:12:08 PM UTC-8, A. Kong wrote:
>>
>> I did more digging and I realised the url is actually marked as 'secure' 
>> in app.yaml. Maybe the task execution fails due to a 302, which is not 
>> captured in the log?
>>
>>
>> That's why when I test the url in a browser, it returns OK.
>>
>>
>> So what is the best practice in term of which url to pass to the 
>> taskqueue.add?
>>
>>
>> On Friday, 8 January 2016 12:28:58 UTC+11, A. Kong wrote:
>>>
>>> Hi,
>>>
>>> When I tried to use taskqueue to execute a task in local dev server, I 
>>> encounter the said exception and the task simply fails to be executed.
>>>
>>> Here is more information:
>>>
>>>
>>> Queue definition:
>>>
>>>
>>> - name: votecounter
>>>   rate: 1/s
>>>   max_concurrent_requests: 1
>>>   target: app
>>>
>>>
>>>
>>> Python code:
>>>
>>> taskqueue.add(url, queue_name='votecounter')
>>>
>>>
>>> Here is the exception stacktrace
>>>
>>>
>>> WARNING  2016-01-08 01:16:41,722 main.py:135] handle 404
>>> WARNING  2016-01-08 01:16:41,723 main.py:136] The resource could not be 
>>> found.
>>> Traceback (most recent call last):
>>>   File 
>>> "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py",
>>>  
>>> line 1529, in __call__
>>>     rv = self.router.dispatch(request, response)
>>>   File 
>>> "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py",
>>>  
>>> line 1265, in default_dispatcher
>>>     route, args, kwargs = rv = self.match(request)
>>>   File 
>>> "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py",
>>>  
>>> line 1214, in default_matcher
>>>     raise exc.HTTPNotFound()
>>> HTTPNotFound: The resource could not be found.
>>> INFO     2016-01-08 01:16:41,787 module.py:794] app: "POST 
>>> /_ah/queue/votecounter HTTP/1.1" 404 1218
>>> WARNING  2016-01-08 01:16:41,788 taskqueue_stub.py:1977] Task task1 
>>> failed to execute. This task will retry in 0.100 seconds
>>>
>>> Apparently the same code can run OK on the app engine server. How can I 
>>> enable taskqueue in a local dev environment?
>>>
>>> Cheers
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/550fa44e-8bac-4012-ae70-99321d099054%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to