Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Engine Task Queues - nasty failure

I'm developing an app for GAE and trying to use Task Queues. At present, I just have the thing running on my Windows box through GAE App Launcher but whenever I try to enqueue anything, the development 'server' crashes over and the log is full of nasty output.

taskqueue.add(url='/processWork', params={'key', myModel.key()})

I've tried running this in a transaction with other work so I'm pretty sure the work is being successfully enqueued.

However, shortly afterwards the development server crashes and the log is full of stuff like this:

ERROR    2011-02-06 17:04:23,289
__init__.py:395] global name 'true' is not defined Traceback (most recent call last):   File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 517, in __call__
    handler.post(*groups)   File "C:\Projects\GAE\MyApp\main.py", line 114, in post
    activity.approved = true NameError: global name 'true' is not defined INFO     2011-02-06 17:04:23,309 dev_appserver.py:3317] "POST /processWork HTTP/1.1" 500 - WARNING  2011-02-06 17:04:23,309 taskqueue_stub.py:586] Task named "task1" on queue "default" failed with code 500; will retry in 30 seconds Traceback (most recent call last):   File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
    self.process_request(request, client_address)   File "C:\Python27\lib\SocketServer.py", line 311, in process_request
    self.shutdown_request(request)   File "C:\Python27\lib\SocketServer.py", line 459, in shutdown_request
    request.shutdown(socket.SHUT_WR) AttributeError: 'FakeConnection' object has no attribute 'shutdown' ERROR    2011-02-06 17:04:23,312 dev_appserver_main.py:494] Error encountered: Traceback (most recent call last):
    File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_main.py", line 488, in main
    http_server.serve_forever()
    File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3947, in serve_forever
    self.handle_request()
    File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3913, in handle_request
    self._handle_request_noblock()
    File "C:\Python27\lib\SocketServer.py", line 287, in _handle_request_noblock
    self.shutdown_request(request)
    File "C:\Python27\lib\SocketServer.py", line 459, in shutdown_request
    request.shutdown(socket.SHUT_WR)   AttributeError: 'FakeConnection' object has no attribute 'shutdown'   Now terminating.
---------------------------------------- Exception happened during processing of request from ('0.1.0.2', 80)
---------------------------------------- 2011-02-06 09:04:23 (Process exited with code 1)

Apologies - a reply below spotted the typo (true, not True). However, this crept in when trying to resolve the original problem though. If I fix the typo, the queued work completes but my server still falls over with this error in the log:

INFO     2011-02-06 17:50:32,882 dev_appserver.py:3317] "POST /processWork HTTP/1.1" 200 -
Traceback (most recent call last):
  File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
    self.process_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 311, in process_request
    self.shutdown_request(request)
  File "C:\Python27\lib\SocketServer.py", line 459, in shutdown_request
    request.shutdown(socket.SHUT_WR)
AttributeError: 'FakeConnection' object has no attribute 'shutdown'
ERROR    2011-02-06 17:50:32,884 dev_appserver_main.py:494] Error encountered:
Traceback (most recent call last):

  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_main.py", line 488, in main
    http_server.serve_forever()

  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3947, in serve_forever
    self.handle_request()

  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3913, in handle_request
    self._handle_request_noblock()

  File "C:\Python27\lib\SocketServer.py", line 287, in _handle_request_noblock
    self.shutdown_request(request)

  File "C:\Python27\lib\SocketServer.py", line 459, in shutdown_request
    request.shutdown(socket.SHUT_WR)

AttributeError: 'FakeConnection' object has no attribute 'shutdown'

Now terminating.
----------------------------------------
Exception happened during processing of request from ('0.1.0.2', 80)
----------------------------------------
2011-02-06 09:50:32 (Process exited with code 1)

If I remove the call to taskqueue.add it works fine (without the queued work, of course). What is going wrong?

like image 897
ConfusedNoob Avatar asked Dec 12 '22 16:12

ConfusedNoob


1 Answers

File "C:\Python27\lib\SocketServer.py"

App Engine runs with Python 2.5 and you are using Python 2.7.

like image 90
systempuntoout Avatar answered Dec 15 '22 05:12

systempuntoout