Discussion:
Crazy TBinaryProtocol
André Lemos
2018-01-11 15:39:49 UTC
Permalink
Hi,


When parsing through a TBinaryProtocol, trying to get the readMessageBegin,
readI32, returns 16777216, which will raise an EOFError, because it's just
a too big of a value. If I use something like 25, I do get something pretty
closer to what I am trying to get, although I still get the initial bit of
the protocol, and not just the name I am trying to get.

Any hints as to where I should be looking?



Ps.: sorry for the cross-post, but feedback seems to be a little slim on
the user@ side of things


Thank you,

André
Kevin Clark
2018-01-11 16:13:31 UTC
Permalink
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the readMessageBegin,
readI32, returns 16777216, which will raise an EOFError, because it's just
a too big of a value. If I use something like 25, I do get something pretty
closer to what I am trying to get, although I still get the initial bit of
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the message
you expect to be on the wire would make it easier for someone to help you.
Post by André Lemos
Ps.: sorry for the cross-post, but feedback seems to be a little slim on
Thank you,
André
--
Kevin Clark
André Lemos
2018-01-11 16:18:42 UTC
Permalink
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError, because it's
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get something
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the initial bit
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the message
you expect to be on the wire would make it easier for someone to help you.
I am using Python 2, I've sent the code. The message I am trying to parse,
looks like this:

\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\x12The
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
James King
2018-01-11 16:34:07 UTC
Permalink
Hi, suggest you start by looking at the binary protocol documentation at:
https://github.com/apache/thrift/blob/master/doc/specs/thrift-binary-protocol.md

See if you are getting a complete message or not, that will help you narrow
the issue down to the sender or the receiver?
If you are supposed to be getting a Message then it has a header, and the
header format is described.

- Jim
Post by André Lemos
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError, because it's
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get something
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the initial bit
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the message
you expect to be on the wire would make it easier for someone to help
you.
I am using Python 2, I've sent the code. The message I am trying to parse,
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\x12The
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
André Lemos
2018-01-11 16:38:33 UTC
Permalink
Hi James,


Not quite sure I follow you. I am just looking to the payload of a
TBinaryProtocol message. Should there be something else? There are other
clients that digest this message correctly, so I am sure the issue is on my
end.
Post by James King
https://github.com/apache/thrift/blob/master/doc/specs/
thrift-binary-protocol.md
See if you are getting a complete message or not, that will help you narrow
the issue down to the sender or the receiver?
If you are supposed to be getting a Message then it has a header, and the
header format is described.
- Jim
Post by André Lemos
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError, because it's
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get something
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the initial
bit
Post by André Lemos
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the
message
Post by André Lemos
Post by André Lemos
you expect to be on the wire would make it easier for someone to help
you.
I am using Python 2, I've sent the code. The message I am trying to
parse,
Post by André Lemos
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\x12The
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Kevin Clark
2018-01-11 16:34:53 UTC
Permalink
Post by André Lemos
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError, because it's
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get something
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the initial bit
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the message
you expect to be on the wire would make it easier for someone to help
you.
I am using Python 2, I've sent the code. The message I am trying to parse,
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\x12The
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it should fit in
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight but it’s
hard to tell you more without the actual code and the precise error message.
Post by André Lemos
--
Kevin Clark
André Lemos
2018-01-11 16:40:56 UTC
Permalink
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError, because it's
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get something
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the initial
bit
Post by André Lemos
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the
message
Post by André Lemos
Post by André Lemos
you expect to be on the wire would make it easier for someone to help
you.
I am using Python 2, I've sent the code. The message I am trying to
parse,
Post by André Lemos
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Post by André Lemos
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\x12The
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it should fit in
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight but it’s
hard to tell you more without the actual code and the precise error message.
here's the code (Python 2):

trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1, strictWrite=False)
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)


issue is that readI32() gets me a EOFError as it tries to read way past the
full message.
Post by Kevin Clark
Post by André Lemos
--
Kevin Clark
Ben Craig
2018-01-11 17:20:43 UTC
Permalink
This kind of issue usually arises when one side is using a framed message
and the other side is not.
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError, because
it's
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get
something
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the initial
bit
Post by André Lemos
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the
message
Post by André Lemos
Post by André Lemos
you expect to be on the wire would make it easier for someone to help
you.
I am using Python 2, I've sent the code. The message I am trying to
parse,
Post by André Lemos
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Post by André Lemos
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\x12The
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it should fit
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight but
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise error message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1, strictWrite=False)
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read way past the
full message.
Post by Kevin Clark
Post by André Lemos
--
Kevin Clark
André Lemos
2018-01-11 17:30:54 UTC
Permalink
I've looked it up, but the C++ client does not use Framed messages, and
that is working.
Post by Ben Craig
This kind of issue usually arises when one side is using a framed message
and the other side is not.
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError, because
it's
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get
something
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the
initial
Post by André Lemos
Post by Kevin Clark
bit
Post by André Lemos
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the
message
Post by André Lemos
Post by André Lemos
you expect to be on the wire would make it easier for someone to
help
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
you.
I am using Python 2, I've sent the code. The message I am trying to
parse,
Post by André Lemos
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Post by André Lemos
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\
x12The
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it should fit
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight but
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise error message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1, strictWrite=False)
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read way past
the
Post by André Lemos
full message.
Post by Kevin Clark
Post by André Lemos
--
Kevin Clark
Jens Geyer
2018-01-12 08:09:39 UTC
Permalink
Agree with Ben.

Could you give an idea what server you are using? Some of them imply framed.

Sent from mobile device, please ignore spelling mistakes.
________________________________
Von: Ben Craig
Gesendet: 11.01.2018 18:20
An: ***@thrift.apache.org
Betreff: Re: Crazy TBinaryProtocol

This kind of issue usually arises when one side is using a framed message
and the other side is not.
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError, because
it's
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get
something
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the initial
bit
Post by André Lemos
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the
message
Post by André Lemos
Post by André Lemos
you expect to be on the wire would make it easier for someone to help
you.
I am using Python 2, I've sent the code. The message I am trying to
parse,
Post by André Lemos
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Post by André Lemos
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\x12The
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it should fit
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight but
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise error message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1, strictWrite=False)
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read way past the
full message.
Post by Kevin Clark
Post by André Lemos
--
Kevin Clark
André Lemos
2018-01-12 14:08:24 UTC
Permalink
Unfortunately, I do not know. The source code for the C++ clients does
include #include <thrift/protocol/TBinaryProtocol.h>, but no Framed in
sight...
Post by Jens Geyer
Agree with Ben.
Could you give an idea what server you are using? Some of them imply framed.
Sent from mobile device, please ignore spelling mistakes.
________________________________
Von: Ben Craig
Gesendet: 11.01.2018 18:20
Betreff: Re: Crazy TBinaryProtocol
This kind of issue usually arises when one side is using a framed message
and the other side is not.
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError, because
it's
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get
something
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the
initial
Post by André Lemos
Post by Kevin Clark
bit
Post by André Lemos
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the
message
Post by André Lemos
Post by André Lemos
you expect to be on the wire would make it easier for someone to
help
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
you.
I am using Python 2, I've sent the code. The message I am trying to
parse,
Post by André Lemos
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Post by André Lemos
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\
x12The
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it should fit
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight but
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise error message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1, strictWrite=False)
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read way past
the
Post by André Lemos
full message.
Post by Kevin Clark
Post by André Lemos
--
Kevin Clark
Kevin Clark
2018-01-11 17:32:20 UTC
Permalink
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError, because
it's
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get
something
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the initial
bit
Post by André Lemos
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the
message
Post by André Lemos
Post by André Lemos
you expect to be on the wire would make it easier for someone to help
you.
I am using Python 2, I've sent the code. The message I am trying to
parse,
Post by André Lemos
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Post by André Lemos
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\x12The
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it should fit
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight but
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise error message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1, strictWrite=False)
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read way past the
full message.
Ah! Issue looks like it’s youre using strictWrite=False in one of the
protocols. That’s going to skip writing the version which the read side is
looking for. Been too long since I touched the code to remember the
intended purpose of those args, but that should at least tell you why it’s
blowing up - it expects more data because a 32 bit version should be there
in the header.

Hope that helps.
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
--
Kevin Clark
--
Kevin Clark
André Lemos
2018-01-11 18:35:18 UTC
Permalink
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError, because
it's
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get
something
Post by Kevin Clark
Post by André Lemos
Post by André Lemos
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the
initial
Post by André Lemos
Post by Kevin Clark
bit
Post by André Lemos
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the
message
Post by André Lemos
Post by André Lemos
you expect to be on the wire would make it easier for someone to
help
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
you.
I am using Python 2, I've sent the code. The message I am trying to
parse,
Post by André Lemos
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Post by André Lemos
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\
x12The
Post by André Lemos
Post by Kevin Clark
Post by André Lemos
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it should fit
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight but
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise error message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1, strictWrite=False)
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read way past
the
Post by André Lemos
full message.
Ah! Issue looks like it’s youre using strictWrite=False in one of the
protocols. That’s going to skip writing the version which the read side is
looking for. Been too long since I touched the code to remember the
intended purpose of those args, but that should at least tell you why it’s
blowing up - it expects more data because a 32 bit version should be there
in the header.
Hope that helps.
Still the same problem...


File "thrift/protocol/TBinaryProtocol.py", line 153, in readMessageBegin
name = self.trans.readAll(sz)
File "thrift/transport/TTransport.py", line 65, in readAll
raise EOFError()
EOFError



:\
Chet Murthy
2018-01-11 20:42:00 UTC
Permalink
Andre',

(1) The message is generated in which language? Python?

(2) Can you supply the IDL for the message payload and message itself?
Post by André Lemos
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
On Thu, Jan 11, 2018 at 4:13 PM, Kevin Clark <
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError,
because
Post by André Lemos
Post by André Lemos
it's
Post by Kevin Clark
Post by André Lemos
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get
something
Post by Kevin Clark
Post by André Lemos
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the
initial
Post by André Lemos
Post by Kevin Clark
bit
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and the
message
Post by André Lemos
you expect to be on the wire would make it easier for someone to
help
Post by André Lemos
Post by Kevin Clark
you.
I am using Python 2, I've sent the code. The message I am trying to
parse,
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\
x12The
Post by André Lemos
Post by Kevin Clark
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it should
fit
Post by André Lemos
Post by André Lemos
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight
but
Post by André Lemos
Post by André Lemos
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise error message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1, strictWrite=False)
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read way past
the
Post by André Lemos
full message.
Ah! Issue looks like it’s youre using strictWrite=False in one of the
protocols. That’s going to skip writing the version which the read side
is
Post by André Lemos
looking for. Been too long since I touched the code to remember the
intended purpose of those args, but that should at least tell you why
it’s
Post by André Lemos
blowing up - it expects more data because a 32 bit version should be
there
Post by André Lemos
in the header.
Hope that helps.
Still the same problem...
File "thrift/protocol/TBinaryProtocol.py", line 153, in readMessageBegin
name = self.trans.readAll(sz)
File "thrift/transport/TTransport.py", line 65, in readAll
raise EOFError()
EOFError
:\
Chet Murthy
2018-01-11 21:14:32 UTC
Permalink
Andre',

Another suggestion: these other clients, I presume, are in other
languages? Could you take that string, and write a cmdline program that
demarshals it in one of the other languages that work? Just to verify that
indeed it's just a Python-only problem?
Post by Chet Murthy
Andre',
(1) The message is generated in which language? Python?
(2) Can you supply the IDL for the message payload and message itself?
Post by André Lemos
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
On Thu, Jan 11, 2018 at 4:13 PM, Kevin Clark <
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError,
because
Post by André Lemos
Post by André Lemos
it's
Post by Kevin Clark
Post by André Lemos
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get
something
Post by Kevin Clark
Post by André Lemos
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the
initial
Post by André Lemos
Post by Kevin Clark
bit
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and
the
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
message
Post by André Lemos
you expect to be on the wire would make it easier for someone to
help
Post by André Lemos
Post by Kevin Clark
you.
I am using Python 2, I've sent the code. The message I am trying
to
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
parse,
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\
x12The
Post by André Lemos
Post by Kevin Clark
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it should
fit
Post by André Lemos
Post by André Lemos
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight
but
Post by André Lemos
Post by André Lemos
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise error message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1,
strictWrite=False)
Post by André Lemos
Post by André Lemos
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read way
past
Post by André Lemos
the
Post by André Lemos
full message.
Ah! Issue looks like it’s youre using strictWrite=False in one of the
protocols. That’s going to skip writing the version which the read side
is
Post by André Lemos
looking for. Been too long since I touched the code to remember the
intended purpose of those args, but that should at least tell you why
it’s
Post by André Lemos
blowing up - it expects more data because a 32 bit version should be
there
Post by André Lemos
in the header.
Hope that helps.
Still the same problem...
File "thrift/protocol/TBinaryProtocol.py", line 153, in
readMessageBegin
name = self.trans.readAll(sz)
File "thrift/transport/TTransport.py", line 65, in readAll
raise EOFError()
EOFError
:\
André Lemos
2018-01-12 14:06:33 UTC
Permalink
Yeah, other languages. C++/C#. Something specific I should try to get out
of the message?
Post by Chet Murthy
Andre',
Another suggestion: these other clients, I presume, are in other
languages? Could you take that string, and write a cmdline program that
demarshals it in one of the other languages that work? Just to verify that
indeed it's just a Python-only problem?
Post by Chet Murthy
Andre',
(1) The message is generated in which language? Python?
(2) Can you supply the IDL for the message payload and message itself?
Post by André Lemos
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
On Thu, Jan 11, 2018 at 4:13 PM, Kevin Clark <
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError,
because
Post by André Lemos
Post by André Lemos
it's
Post by Kevin Clark
Post by André Lemos
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get
something
Post by Kevin Clark
Post by André Lemos
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the
initial
Post by André Lemos
Post by Kevin Clark
bit
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and
the
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
message
Post by André Lemos
you expect to be on the wire would make it easier for someone
to
Post by Chet Murthy
Post by André Lemos
Post by André Lemos
help
Post by André Lemos
Post by Kevin Clark
you.
I am using Python 2, I've sent the code. The message I am trying
to
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
parse,
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Observer XT\x08\x00\x03\x00\x00\x00\
x02\x0b\x00\x04\x00\x00\x00\
Post by Chet Murthy
Post by André Lemos
Post by André Lemos
x12The
Post by André Lemos
Post by Kevin Clark
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it
should
Post by Chet Murthy
Post by André Lemos
fit
Post by André Lemos
Post by André Lemos
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight
but
Post by André Lemos
Post by André Lemos
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise
error
Post by Chet Murthy
Post by André Lemos
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1,
strictWrite=False)
Post by André Lemos
Post by André Lemos
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read way
past
Post by André Lemos
the
Post by André Lemos
full message.
Ah! Issue looks like it’s youre using strictWrite=False in one of the
protocols. That’s going to skip writing the version which the read
side
Post by Chet Murthy
Post by André Lemos
is
Post by André Lemos
looking for. Been too long since I touched the code to remember the
intended purpose of those args, but that should at least tell you why
it’s
Post by André Lemos
blowing up - it expects more data because a 32 bit version should be
there
Post by André Lemos
in the header.
Hope that helps.
Still the same problem...
File "thrift/protocol/TBinaryProtocol.py", line 153, in
readMessageBegin
name = self.trans.readAll(sz)
File "thrift/transport/TTransport.py", line 65, in readAll
raise EOFError()
EOFError
:\
André Lemos
2018-01-12 14:05:17 UTC
Permalink
Hi,


1) Not quite sure which language generates the message, but I'm thinking
possibly C++. Not Python, for sure. I do not have access to the source
file, although I do have access to examples in C++ and C# for consumers,
that do work.

2) You mean the .thrift file?



Thank you!
Post by Chet Murthy
Andre',
(1) The message is generated in which language? Python?
(2) Can you supply the IDL for the message payload and message itself?
Post by André Lemos
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
On Thu, Jan 11, 2018 at 4:13 PM, Kevin Clark <
Post by André Lemos
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError,
because
Post by André Lemos
Post by André Lemos
it's
Post by Kevin Clark
Post by André Lemos
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get
something
Post by Kevin Clark
Post by André Lemos
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the
initial
Post by André Lemos
Post by Kevin Clark
bit
Post by André Lemos
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and
the
Post by André Lemos
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
message
Post by André Lemos
you expect to be on the wire would make it easier for someone
to
Post by André Lemos
Post by André Lemos
help
Post by André Lemos
Post by Kevin Clark
you.
I am using Python 2, I've sent the code. The message I am trying
to
Post by André Lemos
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
parse,
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Observer XT\x08\x00\x03\x00\x00\x00\x02\x0b\x00\x04\x00\x00\x00\
x12The
Post by André Lemos
Post by Kevin Clark
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it should
fit
Post by André Lemos
Post by André Lemos
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple oversight
but
Post by André Lemos
Post by André Lemos
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise error
message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1,
strictWrite=False)
Post by André Lemos
Post by André Lemos
Post by André Lemos
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read way
past
Post by André Lemos
Post by André Lemos
the
Post by André Lemos
full message.
Ah! Issue looks like it’s youre using strictWrite=False in one of the
protocols. That’s going to skip writing the version which the read side
is
Post by André Lemos
looking for. Been too long since I touched the code to remember the
intended purpose of those args, but that should at least tell you why
it’s
Post by André Lemos
blowing up - it expects more data because a 32 bit version should be
there
Post by André Lemos
in the header.
Hope that helps.
Still the same problem...
File "thrift/protocol/TBinaryProtocol.py", line 153, in
readMessageBegin
Post by André Lemos
name = self.trans.readAll(sz)
File "thrift/transport/TTransport.py", line 65, in readAll
raise EOFError()
EOFError
:\
Chet Murthy
2018-01-12 17:00:55 UTC
Permalink
Andre',

OK, let's go with C++. Can you write a C++ program that demarshals the
flat string you showed us, intro an object and prints the object out (to
verify that it's correctly demarshalled)? A standalone C++ program? Then
a standalone Python program that does the same thing, and fails (of
course). This would be a working testcase, that we could use to diagnose
your prroblem.

--chet--
Post by André Lemos
Hi,
1) Not quite sure which language generates the message, but I'm thinking
possibly C++. Not Python, for sure. I do not have access to the source
file, although I do have access to examples in C++ and C# for consumers,
that do work.
2) You mean the .thrift file?
Thank you!
Post by Chet Murthy
Andre',
(1) The message is generated in which language? Python?
(2) Can you supply the IDL for the message payload and message itself?
Post by André Lemos
Post by André Lemos
On Thu, Jan 11, 2018 at 4:34 PM, Kevin Clark <
Post by Kevin Clark
On Thu, Jan 11, 2018 at 4:13 PM, Kevin Clark <
On Thu, Jan 11, 2018 at 7:40 AM André Lemos <
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError,
because
Post by André Lemos
it's
Post by Kevin Clark
just
Post by André Lemos
a too big of a value. If I use something like 25, I do get
something
Post by Kevin Clark
pretty
Post by André Lemos
closer to what I am trying to get, although I still get the
initial
Post by Kevin Clark
bit
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code, and
the
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
message
you expect to be on the wire would make it easier for someone
to
Post by André Lemos
Post by André Lemos
help
Post by Kevin Clark
you.
I am using Python 2, I've sent the code. The message I am
trying
Post by Chet Murthy
to
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
parse,
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Observer XT\x08\x00\x03\x00\x00\x00\
x02\x0b\x00\x04\x00\x00\x00\
Post by Chet Murthy
Post by André Lemos
Post by André Lemos
x12The
Post by Kevin Clark
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it
should
Post by Chet Murthy
Post by André Lemos
fit
Post by André Lemos
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere, just
descriptions of method calls. I suspect this is a simple
oversight
Post by Chet Murthy
Post by André Lemos
but
Post by André Lemos
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise
error
Post by Chet Murthy
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1,
strictWrite=False)
Post by André Lemos
Post by André Lemos
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read way
past
Post by André Lemos
Post by André Lemos
the
full message.
Ah! Issue looks like it’s youre using strictWrite=False in one of the
protocols. That’s going to skip writing the version which the read
side
Post by Chet Murthy
Post by André Lemos
is
Post by André Lemos
looking for. Been too long since I touched the code to remember the
intended purpose of those args, but that should at least tell you why
it’s
Post by André Lemos
blowing up - it expects more data because a 32 bit version should be
there
Post by André Lemos
in the header.
Hope that helps.
Still the same problem...
File "thrift/protocol/TBinaryProtocol.py", line 153, in
readMessageBegin
Post by André Lemos
name = self.trans.readAll(sz)
File "thrift/transport/TTransport.py", line 65, in readAll
raise EOFError()
EOFError
:\
André Lemos
2018-01-12 17:24:44 UTC
Permalink
Ok! I'm a bit rusty on the C++ side of things, but I'll do my best.
Post by Chet Murthy
Andre',
OK, let's go with C++. Can you write a C++ program that demarshals the
flat string you showed us, intro an object and prints the object out (to
verify that it's correctly demarshalled)? A standalone C++ program? Then
a standalone Python program that does the same thing, and fails (of
course). This would be a working testcase, that we could use to diagnose
your prroblem.
--chet--
Post by André Lemos
Hi,
1) Not quite sure which language generates the message, but I'm thinking
possibly C++. Not Python, for sure. I do not have access to the source
file, although I do have access to examples in C++ and C# for consumers,
that do work.
2) You mean the .thrift file?
Thank you!
Post by Chet Murthy
Andre',
(1) The message is generated in which language? Python?
(2) Can you supply the IDL for the message payload and message itself?
Post by André Lemos
Post by André Lemos
On Thu, Jan 11, 2018 at 4:34 PM, Kevin Clark <
Post by Kevin Clark
On Thu, Jan 11, 2018 at 4:13 PM, Kevin Clark <
On Thu, Jan 11, 2018 at 7:40 AM André Lemos <
Post by André Lemos
Hi,
When parsing through a TBinaryProtocol, trying to get the
readMessageBegin,
Post by André Lemos
readI32, returns 16777216, which will raise an EOFError,
because
Post by André Lemos
it's
Post by Kevin Clark
just
Post by André Lemos
a too big of a value. If I use something like 25, I do
get
Post by André Lemos
Post by Chet Murthy
Post by André Lemos
Post by André Lemos
something
Post by Kevin Clark
pretty
Post by André Lemos
closer to what I am trying to get, although I still get
the
Post by André Lemos
Post by Chet Murthy
Post by André Lemos
Post by André Lemos
initial
Post by Kevin Clark
bit
of
Post by André Lemos
the protocol, and not just the name I am trying to get.
Any hints as to where I should be looking?
Providing the language of the lib you’re using, the code,
and
Post by André Lemos
Post by Chet Murthy
the
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
message
you expect to be on the wire would make it easier for
someone
Post by André Lemos
Post by Chet Murthy
to
Post by André Lemos
Post by André Lemos
help
Post by Kevin Clark
you.
I am using Python 2, I've sent the code. The message I am
trying
Post by Chet Murthy
to
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
parse,
\x01\x00\x00\x00\xed\x00\x00\x00\x80\x01\x00\x04\x00\x00\
x00\x15RequestProcessListing\x00\x00\x00\x00\x0c\x00\x01\
x0b\x00\x01\x00\x00\x00\x10\xfe\x8e\xc3F\xed\\\x8aG\x97+\
x0cp\x0eY\x05U\x0b\x00\x02\x00\x00\x00\x0fThe
Observer XT\x08\x00\x03\x00\x00\x00\
x02\x0b\x00\x04\x00\x00\x00\
Post by Chet Murthy
Post by André Lemos
Post by André Lemos
x12The
Post by Kevin Clark
Observer XT
14\x0b\x00\x05\x00\x00\x00\x08LEMOS-PC\x0b\x00\x06\x00\
x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x0c\x00\x07\x08\x00\x01\x00\x00\x00\
x01\x0c\x00\x02\x0c\x00\x01\x0b\x00\x01\x00\x00\x00\x00\
x08\x00\x02\x00\x00\x00\x00\x0f\x00\x03\x0c\x00\x00\x00\
x00\x0f\x00\x04\x0c\x00\x00\x00\x00\x00\x00\x0c\x00\x03\
x02\x00\x01\x01\x02\x00\x02\x01\x0b\x00\x03\x00\x00\x00\
x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00
Well the number you’ve pasted looks like it’s 1 << 24, so it
should
Post by Chet Murthy
Post by André Lemos
fit
Post by André Lemos
in
Post by Kevin Clark
a 32 bit int just fine. I’m not seeing actual code anywhere,
just
Post by André Lemos
Post by Chet Murthy
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
descriptions of method calls. I suspect this is a simple
oversight
Post by Chet Murthy
Post by André Lemos
but
Post by André Lemos
it’s
Post by Kevin Clark
hard to tell you more without the actual code and the precise
error
Post by Chet Murthy
Post by André Lemos
Post by André Lemos
Post by Kevin Clark
message.
trans1 = TTransport.TMemoryBuffer()
trans1.open()
trans = TTransport.TMemoryBuffer(body)
trans.open()
iprot = TBinaryProtocol.TBinaryProtocol(trans)
oprot = TBinaryProtocol.TBinaryProtocol(trans1,
strictWrite=False)
Post by André Lemos
Post by André Lemos
tr = Processor(CommonService.CommonService.Iface())
tr.process(iprot, oprot)
issue is that readI32() gets me a EOFError as it tries to read
way
Post by André Lemos
Post by Chet Murthy
past
Post by André Lemos
Post by André Lemos
the
full message.
Ah! Issue looks like it’s youre using strictWrite=False in one of
the
Post by André Lemos
Post by Chet Murthy
Post by André Lemos
Post by André Lemos
protocols. That’s going to skip writing the version which the read
side
Post by Chet Murthy
Post by André Lemos
is
Post by André Lemos
looking for. Been too long since I touched the code to remember the
intended purpose of those args, but that should at least tell you
why
Post by André Lemos
Post by Chet Murthy
Post by André Lemos
it’s
Post by André Lemos
blowing up - it expects more data because a 32 bit version should
be
Post by André Lemos
Post by Chet Murthy
Post by André Lemos
there
Post by André Lemos
in the header.
Hope that helps.
Still the same problem...
File "thrift/protocol/TBinaryProtocol.py", line 153, in
readMessageBegin
Post by André Lemos
name = self.trans.readAll(sz)
File "thrift/transport/TTransport.py", line 65, in readAll
raise EOFError()
EOFError
:\
Loading...