Robert Thanks.

I get a different exception after I applied the patch, can you please
help

[Remote API Server] [handler.py:308] ERROR Exception while handling
service_name: "taskqueue"
method: "QueryAndOwnTasks"
request: "\n\011workitems\021\000\000\000\000\000 \254@\030\024"
Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\google\appengine\ext
\remote_api\handler.py", line 304, in post
    response_data = self.ExecuteRequest(request)
  File "C:\Program Files\Google\google_appengine\google\appengine\ext
\remote_api\handler.py", line 327, in ExecuteRequest
    request_data.ParseFromString(request.request())
  File "C:\Program Files\Google\google_appengine\google\net\proto
\ProtocolBuffer.py", line 77, in ParseFromString
    self.MergeFromString(s)
  File "C:\Program Files\Google\google_appengine\google\net\proto
\ProtocolBuffer.py", line 84, in MergeFromString
    self.MergePartialFromString(s)
  File "C:\Program Files\Google\google_appengine\google\net\proto
\ProtocolBuffer.py", line 98, in MergePartialFromString
    self.TryMerge(d)
  File "C:\Program Files\Google\google_appengine\google\appengine\api
\taskqueue\taskqueue_service_pb.py", line 7346, in TryMerge
    self.set_lease_seconds(d.getDouble())
  File "C:\Program Files\Google\google_appengine\google\net\proto
\ProtocolBuffer.py", line 580, in getDouble
    return struct.unpack("<d", a)[0]
  File "C:\Python25\lib\struct.py", line 87, in unpack
    return o.unpack(s)
error: unpack requires a string argument of length 8


On May 17, 7:03 pm, Robert Kluin <[email protected]> wrote:
> Hi Uri,
>   It looks like the remote_api doesn't support lease_tasks.  You
> should be able to enable leasing and deleting tasks by adding the
> following lines to the taskqueue service list:
>
>          'QueryAndOwnTasks':
> (taskqueue_service_pb.TaskQueueQueryAndOwnTasksRequest,
>
> taskqueue_service_pb.TaskQueueQueryAndOwnTasksResponse),
>          'Delete': (taskqueue_service_pb.TaskQueueDeleteRequest,
>                     taskqueue_service_pb.TaskQueueDeleteResponse),
>
>   Just put those after 'FetchQueueStats' (should be around line 110) in:
>     google_appengine/google/appengine/ext/remote_api/remote_api_services.py
>
>   Attached is a patch file.  This worked in my local testing at least. :)
>
> Robert
>
>
>
>
>
>
>
> On Tue, May 17, 2011 at 07:09, uri twig <[email protected]> wrote:
> > Thanks Greg
>
> > That works OK.
>
> > I have another problem: i have two back ends 1 'tester' inserts tasks
> > to a queue with 'PULL' method.
> > and another  'worker' that leases the tasks and process them. the
> > 'tester' backend works fine.
> > the 'worker' I get an exception at   lease_tasks function
>
> > the stack is as follows:
>
> > [Remote API Server] [handler.py:308] ERROR Exception while handling
> > service_name: "taskqueue"
> > method: "QueryAndOwnTasks"
> > request: "\n\011workitems\021\000\000\000\000\000 \254@\030d"
> > Traceback (most recent call last):
> >  File "C:\Program Files\Google\google_appengine\google\appengine\ext
> > \remote_api\handler.py", line 304, in post
> >    response_data = self.ExecuteRequest(request)
> >  File "C:\Program Files\Google\google_appengine\google\appengine\ext
> > \remote_api\handler.py", line 324, in ExecuteRequest
> >    raise apiproxy_errors.CallNotFoundError()
> > CallNotFoundError
> > [Backend Instance] [worker.0] [utilities.py:143] ERROR ***worker***
> > CallNotFoundError
>
> > Traceback (most recent call last):
> >  File "D:\vodio\trunk\Software\Samples\backends\test-backends
> > \worker.py", line 48, in main
> >    tasks = q.lease_tasks(3600, 100)
> >  File "C:\Program Files\Google\google_appengine\google\appengine\api
> > \taskqueue\taskqueue.py", line 1041, in lease_tasks
> >    response)
> >  File "C:\Program Files\Google\google_appengine\google\appengine\api
> > \apiproxy_stub_map.py", line 94, in MakeSyncCall
> >    return stubmap.MakeSyncCall(service, call, request, response)
> >  File "C:\Program Files\Google\google_appengine\google\appengine\api
> > \apiproxy_stub_map.py", line 308, in MakeSyncCall
> >    rpc.CheckSuccess()
> >  File "C:\Program Files\Google\google_appengine\google\appengine\api
> > \apiproxy_rpc.py", line 156, in _WaitImpl
> >    self.request, self.response)
> >  File "C:\Program Files\Google\google_appengine\google\appengine\ext
> > \remote_api\remote_api_stub.py", line 177, in MakeSyncCall
> >    self._MakeRealSyncCall(service, call, request, response)
> >  File "C:\Program Files\Google\google_appengine\google\appengine\ext
> > \remote_api\remote_api_stub.py", line 197, in _MakeRealSyncCall
> >    raise pickle.loads(response_pb.exception())
> > CallNotFoundError
>
> > On May 17, 12:44 am, "Greg Darke (Google)" <[email protected]>
> > wrote:
> >> In the dev-appserver you need to pass the '--backends' parameter.
>
> >> On 15 May 2011 11:07, uri twig <[email protected]> wrote:
>
> >> > Hi I'm tring to work with the new backends api, I downloaded the
> >> > sample code formhttp://backends-io.appspot.com/
>
> >> > and I run it on a few machines with the new appengine 1.5 sdk
>
> >> > this is what I get whenhttp://localhost:8080/welcome
>
> >> > What am I'm doing wrong ?!?
>
> >> > Traceback (most recent call last):
> >> >  File "C:\Program Files\Google\google_appengine\google\appengine\tools
> >> > \dev_appserver.py", line 4053, in _HandleRequest
> >> >    self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
> >> >  File "C:\Program Files\Google\google_appengine\google\appengine\tools
> >> > \dev_appserver.py", line 3977, in _Dispatch
> >> >    base_env_dict=env_dict)
> >> >  File "C:\Program Files\Google\google_appengine\google\appengine\tools
> >> > \dev_appserver.py", line 588, in Dispatch
> >> >    base_env_dict=base_env_dict)
> >> >  File "C:\Program Files\Google\google_appengine\google\appengine\tools
> >> > \dev_appserver.py", line 3050, in Dispatch
> >> >    self._module_dict)
> >> >  File "C:\Program Files\Google\google_appengine\google\appengine\tools
> >> > \dev_appserver.py", line 2954, in ExecuteCGI
> >> >    reset_modules = exec_script(handler_path, cgi_path, hook)
> >> >  File "C:\Program Files\Google\google_appengine\google\appengine\tools
> >> > \dev_appserver.py", line 2834, in ExecuteOrImportScript
> >> >    exec module_code in script_module.__dict__
> >> >  File "D:\test\counter_demo\demo_frontend.py", line 22, in <module>
> >> >    backends.get_url('counter'))
> >> >  File "C:\Program Files\Google\google_appengine\google\appengine\api
> >> > \backends\backends.py", line 101, in get_url
> >> >    return _get_dev_url(backend, instance)
> >> >  File "C:\Program Files\Google\google_appengine\google\appengine\api
> >> > \backends\backends.py", line 171, in _get_dev_url
> >> >    return 'http://%s' % _get_dev_hostname(backend, instance)
> >> >  File "C:\Program Files\Google\google_appengine\google\appengine\api
> >> > \backends\backends.py", line 190, in _get_dev_hostname
> >> >    raise InvalidBackendError(error)
> >> > InvalidBackendError: Backend not found: counter
>
> >> > --
> >> > You received this message because you are subscribed to the Google 
> >> > Groups "Google App Engine" group.
> >> > To post to this group, send email to [email protected].
> >> > To unsubscribe from this group, send email to 
> >> > [email protected].
> >> > For more options, visit this group 
> >> > athttp://groups.google.com/group/google-appengine?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Google App Engine" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine?hl=en.
>
>
>
>  remote_api_pull_queue.patch
> < 1KViewDownload

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to