Error on ProtocolBuffer.py

2 views
Skip to first unread message

Rajagopal

unread,
Jun 10, 2008, 11:12:54 AM6/10/08
to Google App Engine
Im trying to develop a mashup of Google Calendar, Contacts and Maps as
an application inside the app-engine. For an initial phase, it just
links the calendar and contacts and I had to do a few tweaks to get
this working (as the socket module isnt supported and the urlfetch
tries a redirect 5 times before giving up). Most of the Google apis
does a 302 and need a subsequent POST or PUT or GET depending on the
api accessed. Long story short, I got this to work under the
development sandbox.

Now when I deploy this live, the stacktrace thrown when trying to
update a Calendar Event is
apiproxy_stub_map.MakeSyncCall('urlfetch', 'Fetch', request,
response)
File "/base/python_lib/versions/1/google/appengine/api/
apiproxy_stub_map.py", line 46, in MakeSyncCall
stub.MakeSyncCall(service, call, request, response)
File "/base/python_lib/versions/1/google/appengine/runtime/
apiproxy.py", line 244, in MakeSyncCall
rpc.MakeCall(package, call, request, response)
File "/base/python_lib/versions/1/google/appengine/runtime/
apiproxy.py", line 144, in MakeCall
self.request.Output(e)
File "/base/python_lib/versions/1/google/net/proto/
ProtocolBuffer.py", line 147, in Output
self.OutputUnchecked(e)
File "/base/python_lib/versions/1/google/appengine/api/
urlfetch_service_pb.py", line 592, in OutputUnchecked
self.header_[i].OutputUnchecked(out)
File "/base/python_lib/versions/1/google/appengine/api/
urlfetch_service_pb.py", line 412, in OutputUnchecked
out.putPrefixedString(self.value_)
File "/base/python_lib/versions/1/google/net/proto/
ProtocolBuffer.py", line 326, in putPrefixedString
self.putVarInt32(len(v))
TypeError: object of type 'int' has no len()

I looked briefly in urlfetch and apiproxy to see why this could
happen, but dont see anything that could help me. Im going to dig in
deep, but just wanted to post this and see if anyone has seen this
error earlier.

Thanks
Raja

Rajagopal

unread,
Jun 10, 2008, 1:57:34 PM6/10/08
to Google App Engine
Ok, solved the problem. The issue was I was using the python-gdata api
to do the google-api operations. In addition to making changes to get
it to work with the appengine(the python-gdata-client uses the socket
and related modules to do the connectivity which isnt allowed in
appengine), I found a place in the code where the "Content-Length" was
figured from the payload, but wasnt converted into string. That caused
the stacktrace mentioned below to appear. I changed the Content-Length
to be a string type and Got my app working just fine now. I will file
a bug against the python-gdata-client api though.

The stacktrace in the "logs" section of the dashboard was just too
cool! Thanks for the great work.

Thanks
Raja
Reply all
Reply to author
Forward
0 new messages