You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by 小熹 <hu...@qq.com> on 2016/10/12 01:32:31 UTC

TProtocolException: Expected version 1 but got 2

Hi,


I am occasionally getting below exception when using Apache Thrift:


javax.servlet.ServletException: org.apache.thrift.protocol.TProtocolException: Expected version 1 but got 2



I have no clue why the client is complaining about this. I am using the auto-gen client/server codes, and they just work in most of time. Could you please give me some spark on this issue?


Appreciated any help! Thanks!


regards,
Michael

Re: TProtocolException: Expected version 1 but got 2

Posted by 小熹 <hu...@qq.com>.
Aki, 

One more question, do you happen to know if there is such issue reported for BinaryProtocol before? If not, we might just simply switch to Binary protocol for the time being... Any suggestion is appreciated!

regards,
Michael

---Original---
From: "小熹"<hu...@qq.com>
Date: 2016/10/13 11:58:41
To: "user"<us...@thrift.apache.org>;
Subject: Re: TProtocolException: Expected version 1 but got 2


Hi Aki,

Thanks for your reply. We are using java for both client and sever implementation for now. We migt use PHP for client side eventually. Both client/sever codes are generated by thrift tool automatically. Per protocol, we are using the Compact one.

Regarding increment to use big endian, could you share some more details about how to do that? Thanks!

regards,
Michael
---Original---
From: "Aki Sukegawa"<ns...@apache.org>
Date: 2016/10/13 01:51:34
To: "thrift-user-help"<us...@thrift.apache.org>;
Subject: Re: TProtocolException: Expected version 1 but got 2


Hi, what protocol do you use and against what servers/languages ?
Last time I checked, Apache Thrift against fbthrift with Compact protocol
was deemed to end up with this version 2 v.s. 1 error.
(For anyone interested/concerned, they chose to increment compact protocol
version to use big endian, rather than little endian, for double floating
point number encoding, while we chose to fix those languages that has been
erroneously using big endian.)

If you're only using Apache Thrift endpoints, it sounds worth a bug report.


On Wed, Oct 12, 2016 at 10:32 AM 小熹 <hu...@qq.com> wrote:

> Hi,
>
>
> I am occasionally getting below exception when using Apache Thrift:
>
>
> javax.servlet.ServletException:
> org.apache.thrift.protocol.TProtocolException: Expected version 1 but got 2
>
>
>
> I have no clue why the client is complaining about this. I am using the
> auto-gen client/server codes, and they just work in most of time. Could you
> please give me some spark on this issue?
>
>
> Appreciated any help! Thanks!
>
>
> regards,
> Michael

Re: TProtocolException: Expected version 1 but got 2

Posted by 小熹 <hu...@qq.com>.
Hi Aki,

Thanks for your reply. We are using java for both client and sever implementation for now. We migt use PHP for client side eventually. Both client/sever codes are generated by thrift tool automatically. Per protocol, we are using the Compact one.

Regarding increment to use big endian, could you share some more details about how to do that? Thanks!

regards,
Michael
---Original---
From: "Aki Sukegawa"<ns...@apache.org>
Date: 2016/10/13 01:51:34
To: "thrift-user-help"<us...@thrift.apache.org>;
Subject: Re: TProtocolException: Expected version 1 but got 2


Hi, what protocol do you use and against what servers/languages ?
Last time I checked, Apache Thrift against fbthrift with Compact protocol
was deemed to end up with this version 2 v.s. 1 error.
(For anyone interested/concerned, they chose to increment compact protocol
version to use big endian, rather than little endian, for double floating
point number encoding, while we chose to fix those languages that has been
erroneously using big endian.)

If you're only using Apache Thrift endpoints, it sounds worth a bug report.


On Wed, Oct 12, 2016 at 10:32 AM 小熹 <hu...@qq.com> wrote:

> Hi,
>
>
> I am occasionally getting below exception when using Apache Thrift:
>
>
> javax.servlet.ServletException:
> org.apache.thrift.protocol.TProtocolException: Expected version 1 but got 2
>
>
>
> I have no clue why the client is complaining about this. I am using the
> auto-gen client/server codes, and they just work in most of time. Could you
> please give me some spark on this issue?
>
>
> Appreciated any help! Thanks!
>
>
> regards,
> Michael

Re: TProtocolException: Expected version 1 but got 2

Posted by Aki Sukegawa <ns...@apache.org>.
Hi Jens,

Yes, it might be a good idea to keep compatibility with major fork(s).
After all, Thrift is for connecting different technology stacks ?

Looking at fbthrift code, they mostly do it too for server side usage, but
often without client side API to switch to v1.

On Thu, Oct 13, 2016 at 4:06 AM Jens Geyer <je...@hotmail.com> wrote:

> Hi Aki,
>
> That's interesting. Why can't we just support both flavours if there is
> such
> a good distinction between the two?
>
> Have fun,
> JensG
>
>
> -----Ursprüngliche Nachricht-----
> From: Aki Sukegawa
> Sent: Wednesday, October 12, 2016 7:51 PM
> To: thrift-user-help
> Subject: Re: TProtocolException: Expected version 1 but got 2
>
> Hi, what protocol do you use and against what servers/languages ?
> Last time I checked, Apache Thrift against fbthrift with Compact protocol
> was deemed to end up with this version 2 v.s. 1 error.
> (For anyone interested/concerned, they chose to increment compact protocol
> version to use big endian, rather than little endian, for double floating
> point number encoding, while we chose to fix those languages that has been
> erroneously using big endian.)
>
> If you're only using Apache Thrift endpoints, it sounds worth a bug report.
>
>
> On Wed, Oct 12, 2016 at 10:32 AM 小熹 <hu...@qq.com> wrote:
>
> > Hi,
> >
> >
> > I am occasionally getting below exception when using Apache Thrift:
> >
> >
> > javax.servlet.ServletException:
> > org.apache.thrift.protocol.TProtocolException: Expected version 1 but got
> > 2
> >
> >
> >
> > I have no clue why the client is complaining about this. I am using the
> > auto-gen client/server codes, and they just work in most of time. Could
> > you
> > please give me some spark on this issue?
> >
> >
> > Appreciated any help! Thanks!
> >
> >
> > regards,
> > Michael
>
>

Re: TProtocolException: Expected version 1 but got 2

Posted by Jens Geyer <je...@hotmail.com>.
Hi Aki,

That's interesting. Why can't we just support both flavours if there is such 
a good distinction between the two?

Have fun,
JensG


-----Ursprüngliche Nachricht----- 
From: Aki Sukegawa
Sent: Wednesday, October 12, 2016 7:51 PM
To: thrift-user-help
Subject: Re: TProtocolException: Expected version 1 but got 2

Hi, what protocol do you use and against what servers/languages ?
Last time I checked, Apache Thrift against fbthrift with Compact protocol
was deemed to end up with this version 2 v.s. 1 error.
(For anyone interested/concerned, they chose to increment compact protocol
version to use big endian, rather than little endian, for double floating
point number encoding, while we chose to fix those languages that has been
erroneously using big endian.)

If you're only using Apache Thrift endpoints, it sounds worth a bug report.


On Wed, Oct 12, 2016 at 10:32 AM 小熹 <hu...@qq.com> wrote:

> Hi,
>
>
> I am occasionally getting below exception when using Apache Thrift:
>
>
> javax.servlet.ServletException:
> org.apache.thrift.protocol.TProtocolException: Expected version 1 but got 
> 2
>
>
>
> I have no clue why the client is complaining about this. I am using the
> auto-gen client/server codes, and they just work in most of time. Could 
> you
> please give me some spark on this issue?
>
>
> Appreciated any help! Thanks!
>
>
> regards,
> Michael 


Re: TProtocolException: Expected version 1 but got 2

Posted by Aki Sukegawa <ns...@apache.org>.
Hi, what protocol do you use and against what servers/languages ?
Last time I checked, Apache Thrift against fbthrift with Compact protocol
was deemed to end up with this version 2 v.s. 1 error.
(For anyone interested/concerned, they chose to increment compact protocol
version to use big endian, rather than little endian, for double floating
point number encoding, while we chose to fix those languages that has been
erroneously using big endian.)

If you're only using Apache Thrift endpoints, it sounds worth a bug report.


On Wed, Oct 12, 2016 at 10:32 AM 小熹 <hu...@qq.com> wrote:

> Hi,
>
>
> I am occasionally getting below exception when using Apache Thrift:
>
>
> javax.servlet.ServletException:
> org.apache.thrift.protocol.TProtocolException: Expected version 1 but got 2
>
>
>
> I have no clue why the client is complaining about this. I am using the
> auto-gen client/server codes, and they just work in most of time. Could you
> please give me some spark on this issue?
>
>
> Appreciated any help! Thanks!
>
>
> regards,
> Michael