Quantcast

Decoding error on GAE gateway

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Decoding error on GAE gateway

Stuart Mitchell-3
Hi I am getting this strange error occasionally (1/500 requests) on my GAE application.

Error decoding AMF request
Traceback (most recent call last):
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/remoting/gateway/google.py", line 77, in post
    logger=self.logger, timezone_offset=timezone_offset)
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/remoting/__init__.py", line 599, in decode
    msg.amfVersion = stream.read_ushort()
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 262, in read_ushort
    return struct.unpack("%sH" % self.endian, self._read(2))[0]
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 194, in _read
    bytes = self.read(length)
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 534, in read
    'only %d remain' % (length, len(self) - self.tell()))
IOError: Attempted to read 2 bytes from the buffer but only 0 remain

Any ideas? This seems very strange as as far as we can tell nothing is different on the client side.

Thanks

Stu

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Decoding error on GAE gateway

Nick Joyce
On Thursday, 22 March 2012 at 5:37 PM, Stuart Mitchell wrote:
Hi I am getting this strange error occasionally (1/500 requests) on my GAE application.

Error decoding AMF request
Traceback (most recent call last):
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/remoting/gateway/google.py", line 77, in post
    logger=self.logger, timezone_offset=timezone_offset)
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/remoting/__init__.py", line 599, in decode
    msg.amfVersion = stream.read_ushort()
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 262, in read_ushort
    return struct.unpack("%sH" % self.endian, self._read(2))[0]
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 194, in _read
    bytes = self.read(length)
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 534, in read
    'only %d remain' % (length, len(self) - self.tell()))
IOError: Attempted to read 2 bytes from the buffer but only 0 remain

Any ideas? This seems very strange as as far as we can tell nothing is different on the client side.
Very strange, no ideas spring to mind. I would need to look at the raw request data to help diagnose further, post to me off list if you think it may contain sensitive info.

Cheers,

Nick

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Decoding error on GAE gateway

Stuart Mitchell-3
On Fri, Mar 23, 2012 at 12:47 PM, Nick Joyce <[hidden email]> wrote:
On Thursday, 22 March 2012 at 5:37 PM, Stuart Mitchell wrote:
Hi I am getting this strange error occasionally (1/500 requests) on my GAE application.

Error decoding AMF request
Traceback (most recent call last):
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/remoting/gateway/google.py", line 77, in post
    logger=self.logger, timezone_offset=timezone_offset)
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/remoting/__init__.py", line 599, in decode
    msg.amfVersion = stream.read_ushort()
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 262, in read_ushort
    return struct.unpack("%sH" % self.endian, self._read(2))[0]
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 194, in _read
    bytes = self.read(length)
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 534, in read
    'only %d remain' % (length, len(self) - self.tell()))
IOError: Attempted to read 2 bytes from the buffer but only 0 remain

Any ideas? This seems very strange as as far as we can tell nothing is different on the client side.
Very strange, no ideas spring to mind. I would need to look at the raw request data to help diagnose further, post to me off list if you think it may contain sensitive info.


Ok so I have altered the WebAppGateway.post() method in pyamf/remoting/gateway/google.py

to log the body of the post

    def post(self):
        body = self.request.body_file.read()
        if self.logger:
            self.logger.info('Incoming AMF body:\n %s' % body)

is this sufficient to see 'the raw request data' when I get another exception?

Stu
 

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Decoding error on GAE gateway

Nick Joyce
Yes, that should do it.

On Thursday, 22 March 2012 at 7:00 PM, Stuart Mitchell wrote:

On Fri, Mar 23, 2012 at 12:47 PM, Nick Joyce <[hidden email]> wrote:
On Thursday, 22 March 2012 at 5:37 PM, Stuart Mitchell wrote:
Hi I am getting this strange error occasionally (1/500 requests) on my GAE application.

Error decoding AMF request
Traceback (most recent call last):
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/remoting/gateway/google.py", line 77, in post
    logger=self.logger, timezone_offset=timezone_offset)
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/remoting/__init__.py", line 599, in decode
    msg.amfVersion = stream.read_ushort()
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 262, in read_ushort
    return struct.unpack("%sH" % self.endian, self._read(2))[0]
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 194, in _read
    bytes = self.read(length)
  File "/base/data/home/apps/s~mediawise-program-exclusions/0-0-1.357635847498836715/pyamf/util/pure.py", line 534, in read
    'only %d remain' % (length, len(self) - self.tell()))
IOError: Attempted to read 2 bytes from the buffer but only 0 remain

Any ideas? This seems very strange as as far as we can tell nothing is different on the client side.
Very strange, no ideas spring to mind. I would need to look at the raw request data to help diagnose further, post to me off list if you think it may contain sensitive info.


Ok so I have altered the WebAppGateway.post() method in pyamf/remoting/gateway/google.py

to log the body of the post

    def post(self):
        body = self.request.body_file.read()
        if self.logger:
            self.logger.info('Incoming AMF body:\n %s' % body)

is this sufficient to see 'the raw request data' when I get another exception?

Stu
 
_______________________________________________
PyAMF users mailing list - [hidden email]


_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Loading...