You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by maxi628 <ma...@gmail.com> on 2021/01/27 16:46:39 UTC

[2.7.6] Unsupported protocol version: -76 with thin client.

Hello everyone.

I'm having an issue that appears randomly on my internal product testing.
Looks like its related to https://issues.apache.org/jira/browse/IGNITE-13401
but the stacktrace looks different.
Basically I'm building a BinaryObject which ends up fetching
BinaryObjectMetadata from the server and it fails with that exception.



Upgrading to ignite 2.9.1 where it's patched isn't an option for me.
The BinaryObjectMetadata is user-configured via some interfaces.
Is there any workarounds for this? 
If we have a way to calculate the size of the metadata before sending it we
could add a dummy field in those cases where it ends up matching the
GridBinaryMarshaller.OBJ on the second byte of the stream.

Here's the datagram in hex


And a photo from the debugger in which it shows the problematic value

Screen_Shot_2021-01-27_at_10.png
<http://apache-ignite-users.70518.x6.nabble.com/file/t3058/Screen_Shot_2021-01-27_at_10.png>  

Thanks everyone.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: [2.7.6] Unsupported protocol version: -76 with thin client.

Posted by maxi628 <ma...@gmail.com>.
Here's the stacktrace:

org.apache.ignite.binary.BinaryObjectException: Unsupported protocol
version: 43
	BinaryUtils checkProtocolVersion                    798
org.apache.ignite.internal.binary.BinaryUtils in BinaryUtils.java
	BinaryReaderExImpl <init>                           221
org.apache.ignite.internal.binary.BinaryReaderExImpl in
BinaryReaderExImpl.java
	BinaryReaderExImpl <init>                           186
org.apache.ignite.internal.binary.BinaryReaderExImpl in
BinaryReaderExImpl.java
	BinaryReaderExImpl <init>                           165
org.apache.ignite.internal.binary.BinaryReaderExImpl in
BinaryReaderExImpl.java
	ClientUtils binaryMetadata                          156
org.apache.ignite.internal.client.thin.ClientUtils in ClientUtils.java
	TcpIgniteClient.ClientBinaryMetadataHandler lambda$metadata0$2  293
org.apache.ignite.internal.client.thin.TcpIgniteClient$ClientBinaryMetadataHandler
in TcpIgniteClient.java
	TcpClientChannel receive                            189
org.apache.ignite.internal.client.thin.TcpClientChannel in
TcpClientChannel.java
	ReliableChannel service                             126
org.apache.ignite.internal.client.thin.ReliableChannel in
ReliableChannel.java
	TcpIgniteClient.ClientBinaryMetadataHandler metadata0  288
org.apache.ignite.internal.client.thin.TcpIgniteClient$ClientBinaryMetadataHandler
in TcpIgniteClient.java
	TcpIgniteClient.ClientBinaryMetadataHandler metadata  270
org.apache.ignite.internal.client.thin.TcpIgniteClient$ClientBinaryMetadataHandler
in TcpIgniteClient.java
	BinaryContext metadata                             1266
org.apache.ignite.internal.binary.BinaryContext in BinaryContext.java
	BinaryObjectBuilderImpl serializeTo                 209
org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl in
BinaryObjectBuilderImpl.java
	BinaryObjectBuilderImpl build                       190
org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl in
BinaryObjectBuilderImpl.java

so basically it fails while trying to call to binaryObjectBuilder.build()



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: [2.7.6] Unsupported protocol version: -76 with thin client.

Posted by Ilya Kasnacheev <il...@gmail.com>.
Thank you.

https://issues.apache.org/jira/browse/IGNITE-13401 for the curious.

Regards,
-- 
Ilya Kasnacheev


пт, 29 янв. 2021 г. в 12:04, Alex Plehanov <pl...@gmail.com>:

> Ilya, you can find reproducer in test
> IgniteBinaryTest.testBinaryTypeWithIdOfMarshallerHeader
> In this thread, we are talking about a workaround for older versions where
> this issue is not fixed.
>
> пт, 29 янв. 2021 г. в 11:49, Ilya Kasnacheev <il...@gmail.com>:
>
>> Hello!
>>
>> Do you have reproducer for that entity name issue? I would very much like
>> to check that. Why do you need to add 'x' to it?
>>
>> Regards,
>> --
>> Ilya Kasnacheev
>>
>>
>> чт, 28 янв. 2021 г. в 16:26, Maximiliano Gazquez <
>> maximiliano.628@gmail.com>:
>>
>>> So we fixed it like this
>>>
>>> private static String fixEntityName(Function<String, Integer>
>>> nameToTypeId, String name) {
>>> String result = name;
>>> while ((nameToTypeId.apply(result) & 0x000000FF) == 103) {
>>> result = "x" + result;
>>> }
>>> return result;
>>> }
>>> Where nameToTypeId is BinaryBasicIdMapper#typeId basically and it works.
>>>
>>> Now, is there any way to calculate the ClientConfiguration size? To
>>> avoid the issue mentioned in
>>> https://issues.apache.org/jira/browse/IGNITE-13401
>>>
>>> A <https://issues.apache.org/jira/browse/IGNITE-13401>lso, we were
>>> using thick client but we decided to migrate to thin client because we need
>>> interoperability between version. Is there any documentation about this?
>>> Detailing compatibility between client/server versions.
>>>
>>> Thanks!
>>> On 28 Jan 2021 9:08 -0300, Pavel Tupitsyn <pt...@apache.org>, wrote:
>>>
>>> Ilya,
>>>
>>> Normally you can use any combination of thin client and server versions,
>>> the highest common protocol version is negotiated automatically
>>> during the handshake.
>>>
>>> There are some exceptions to this - not all thin clients support very
>>> old protocols,
>>> but with recent versions it should work.
>>>
>>> On Thu, Jan 28, 2021 at 1:58 PM Ilya Kasnacheev <
>>> ilya.kasnacheev@gmail.com> wrote:
>>>
>>>> Hello!
>>>>
>>>> I don't think you can use a more recent version of thin client with
>>>> older server version.
>>>> New thin client features usually require support from the server side
>>>> as well.
>>>>
>>>> Regards,
>>>> --
>>>> Ilya Kasnacheev
>>>>
>>>>
>>>> ср, 27 янв. 2021 г. в 21:45, jjimeno <jj...@omp.com>:
>>>>
>>>>> Hello,
>>>>>
>>>>> Thanks for your answer.
>>>>> The server is already in version 2.9.1 and the c++ thin client is from
>>>>> master branch to get transactions support.
>>>>>
>>>>> José
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>>>>
>>>>

Re: [2.7.6] Unsupported protocol version: -76 with thin client.

Posted by Alex Plehanov <pl...@gmail.com>.
Ilya, you can find reproducer in test
IgniteBinaryTest.testBinaryTypeWithIdOfMarshallerHeader
In this thread, we are talking about a workaround for older versions where
this issue is not fixed.

пт, 29 янв. 2021 г. в 11:49, Ilya Kasnacheev <il...@gmail.com>:

> Hello!
>
> Do you have reproducer for that entity name issue? I would very much like
> to check that. Why do you need to add 'x' to it?
>
> Regards,
> --
> Ilya Kasnacheev
>
>
> чт, 28 янв. 2021 г. в 16:26, Maximiliano Gazquez <
> maximiliano.628@gmail.com>:
>
>> So we fixed it like this
>>
>> private static String fixEntityName(Function<String, Integer>
>> nameToTypeId, String name) {
>> String result = name;
>> while ((nameToTypeId.apply(result) & 0x000000FF) == 103) {
>> result = "x" + result;
>> }
>> return result;
>> }
>> Where nameToTypeId is BinaryBasicIdMapper#typeId basically and it works.
>>
>> Now, is there any way to calculate the ClientConfiguration size? To avoid
>> the issue mentioned in https://issues.apache.org/jira/browse/IGNITE-13401
>>
>> A <https://issues.apache.org/jira/browse/IGNITE-13401>lso, we were using
>> thick client but we decided to migrate to thin client because we need
>> interoperability between version. Is there any documentation about this?
>> Detailing compatibility between client/server versions.
>>
>> Thanks!
>> On 28 Jan 2021 9:08 -0300, Pavel Tupitsyn <pt...@apache.org>, wrote:
>>
>> Ilya,
>>
>> Normally you can use any combination of thin client and server versions,
>> the highest common protocol version is negotiated automatically
>> during the handshake.
>>
>> There are some exceptions to this - not all thin clients support very old
>> protocols,
>> but with recent versions it should work.
>>
>> On Thu, Jan 28, 2021 at 1:58 PM Ilya Kasnacheev <
>> ilya.kasnacheev@gmail.com> wrote:
>>
>>> Hello!
>>>
>>> I don't think you can use a more recent version of thin client with
>>> older server version.
>>> New thin client features usually require support from the server side as
>>> well.
>>>
>>> Regards,
>>> --
>>> Ilya Kasnacheev
>>>
>>>
>>> ср, 27 янв. 2021 г. в 21:45, jjimeno <jj...@omp.com>:
>>>
>>>> Hello,
>>>>
>>>> Thanks for your answer.
>>>> The server is already in version 2.9.1 and the c++ thin client is from
>>>> master branch to get transactions support.
>>>>
>>>> José
>>>>
>>>>
>>>>
>>>> --
>>>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>>>
>>>

Re: [2.7.6] Unsupported protocol version: -76 with thin client.

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

Do you have reproducer for that entity name issue? I would very much like
to check that. Why do you need to add 'x' to it?

Regards,
-- 
Ilya Kasnacheev


чт, 28 янв. 2021 г. в 16:26, Maximiliano Gazquez <maximiliano.628@gmail.com
>:

> So we fixed it like this
>
> private static String fixEntityName(Function<String, Integer>
> nameToTypeId, String name) {
> String result = name;
> while ((nameToTypeId.apply(result) & 0x000000FF) == 103) {
> result = "x" + result;
> }
> return result;
> }
> Where nameToTypeId is BinaryBasicIdMapper#typeId basically and it works.
>
> Now, is there any way to calculate the ClientConfiguration size? To avoid
> the issue mentioned in https://issues.apache.org/jira/browse/IGNITE-13401
>
> A <https://issues.apache.org/jira/browse/IGNITE-13401>lso, we were using
> thick client but we decided to migrate to thin client because we need
> interoperability between version. Is there any documentation about this?
> Detailing compatibility between client/server versions.
>
> Thanks!
> On 28 Jan 2021 9:08 -0300, Pavel Tupitsyn <pt...@apache.org>, wrote:
>
> Ilya,
>
> Normally you can use any combination of thin client and server versions,
> the highest common protocol version is negotiated automatically
> during the handshake.
>
> There are some exceptions to this - not all thin clients support very old
> protocols,
> but with recent versions it should work.
>
> On Thu, Jan 28, 2021 at 1:58 PM Ilya Kasnacheev <il...@gmail.com>
> wrote:
>
>> Hello!
>>
>> I don't think you can use a more recent version of thin client with older
>> server version.
>> New thin client features usually require support from the server side as
>> well.
>>
>> Regards,
>> --
>> Ilya Kasnacheev
>>
>>
>> ср, 27 янв. 2021 г. в 21:45, jjimeno <jj...@omp.com>:
>>
>>> Hello,
>>>
>>> Thanks for your answer.
>>> The server is already in version 2.9.1 and the c++ thin client is from
>>> master branch to get transactions support.
>>>
>>> José
>>>
>>>
>>>
>>> --
>>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>>
>>

Re: [2.7.6] Unsupported protocol version: -76 with thin client.

Posted by Alex Plehanov <pl...@gmail.com>.
Hello,

There are no public methods to calculate CacheConfiguration size.

As Pavel already said all versions of the client compatible with all
versions of the server, the features set will be determined by the highest
common version.

Here is the feature compatibility list for the java thin client:
Cache API since 2.5 (server-side since 2.4)
Binary since 2.5 (server-side since 2.4)
Queries since 2.5 (server-side since 2.4)
Authentication since 2.5 (server-side since 2.5)
Transactions since 2.8 (server-side since 2.8)
Expiry policy since 2.8 (server-side since 2.8)
Cluster API since 2.9 (server-side since 2.8)
User attributes since 2.9 (server-side since 2.9)
Cluster groups API since 2.9 (server-side since 2.9)
Compute since 2.9 (server-side since 2.9)
Services since 2.9 (server-side since 2.9)



чт, 28 янв. 2021 г. в 16:26, Maximiliano Gazquez <maximiliano.628@gmail.com
>:

> So we fixed it like this
>
> private static String fixEntityName(Function<String, Integer>
> nameToTypeId, String name) {
> String result = name;
> while ((nameToTypeId.apply(result) & 0x000000FF) == 103) {
> result = "x" + result;
> }
> return result;
> }
> Where nameToTypeId is BinaryBasicIdMapper#typeId basically and it works.
>
> Now, is there any way to calculate the ClientConfiguration size? To avoid
> the issue mentioned in https://issues.apache.org/jira/browse/IGNITE-13401
>
> A <https://issues.apache.org/jira/browse/IGNITE-13401>lso, we were using
> thick client but we decided to migrate to thin client because we need
> interoperability between version. Is there any documentation about this?
> Detailing compatibility between client/server versions.
>
> Thanks!
> On 28 Jan 2021 9:08 -0300, Pavel Tupitsyn <pt...@apache.org>, wrote:
>
> Ilya,
>
> Normally you can use any combination of thin client and server versions,
> the highest common protocol version is negotiated automatically
> during the handshake.
>
> There are some exceptions to this - not all thin clients support very old
> protocols,
> but with recent versions it should work.
>
> On Thu, Jan 28, 2021 at 1:58 PM Ilya Kasnacheev <il...@gmail.com>
> wrote:
>
>> Hello!
>>
>> I don't think you can use a more recent version of thin client with older
>> server version.
>> New thin client features usually require support from the server side as
>> well.
>>
>> Regards,
>> --
>> Ilya Kasnacheev
>>
>>
>> ср, 27 янв. 2021 г. в 21:45, jjimeno <jj...@omp.com>:
>>
>>> Hello,
>>>
>>> Thanks for your answer.
>>> The server is already in version 2.9.1 and the c++ thin client is from
>>> master branch to get transactions support.
>>>
>>> José
>>>
>>>
>>>
>>> --
>>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>>
>>

Re: [2.7.6] Unsupported protocol version: -76 with thin client.

Posted by Maximiliano Gazquez <ma...@gmail.com>.
So we fixed it like this

	private static String fixEntityName(Function<String, Integer> nameToTypeId, String name) {
		String result = name;
		while ((nameToTypeId.apply(result) & 0x000000FF) == 103) {
			result = "x" + result;
		}
		return result;
	}
Where nameToTypeId is BinaryBasicIdMapper#typeId basically and it works.

Now, is there any way to calculate the ClientConfiguration size? To avoid the issue mentioned in https://issues.apache.org/jira/browse/IGNITE-13401

Also, we were using thick client but we decided to migrate to thin client because we need interoperability between version. Is there any documentation about this? Detailing compatibility between client/server versions.

Thanks!
On 28 Jan 2021 9:08 -0300, Pavel Tupitsyn <pt...@apache.org>, wrote:
> Ilya,
>
> Normally you can use any combination of thin client and server versions,
> the highest common protocol version is negotiated automatically
> during the handshake.
>
> There are some exceptions to this - not all thin clients support very old protocols,
> but with recent versions it should work.
>
> > On Thu, Jan 28, 2021 at 1:58 PM Ilya Kasnacheev <il...@gmail.com> wrote:
> > > Hello!
> > >
> > > I don't think you can use a more recent version of thin client with older server version.
> > > New thin client features usually require support from the server side as well.
> > >
> > > Regards,
> > > --
> > > Ilya Kasnacheev
> > >
> > >
> > > > ср, 27 янв. 2021 г. в 21:45, jjimeno <jj...@omp.com>:
> > > > > Hello,
> > > > >
> > > > > Thanks for your answer.
> > > > > The server is already in version 2.9.1 and the c++ thin client is from
> > > > > master branch to get transactions support.
> > > > >
> > > > > José
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: [2.7.6] Unsupported protocol version: -76 with thin client.

Posted by Pavel Tupitsyn <pt...@apache.org>.
Ilya,

Normally you can use any combination of thin client and server versions,
the highest common protocol version is negotiated automatically
during the handshake.

There are some exceptions to this - not all thin clients support very old
protocols,
but with recent versions it should work.

On Thu, Jan 28, 2021 at 1:58 PM Ilya Kasnacheev <il...@gmail.com>
wrote:

> Hello!
>
> I don't think you can use a more recent version of thin client with older
> server version.
> New thin client features usually require support from the server side as
> well.
>
> Regards,
> --
> Ilya Kasnacheev
>
>
> ср, 27 янв. 2021 г. в 21:45, jjimeno <jj...@omp.com>:
>
>> Hello,
>>
>> Thanks for your answer.
>> The server is already in version 2.9.1 and the c++ thin client is from
>> master branch to get transactions support.
>>
>> José
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>

Re: [2.7.6] Unsupported protocol version: -76 with thin client.

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

I don't think you can use a more recent version of thin client with older
server version.
New thin client features usually require support from the server side as
well.

Regards,
-- 
Ilya Kasnacheev


ср, 27 янв. 2021 г. в 21:45, jjimeno <jj...@omp.com>:

> Hello,
>
> Thanks for your answer.
> The server is already in version 2.9.1 and the c++ thin client is from
> master branch to get transactions support.
>
> José
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: [2.7.6] Unsupported protocol version: -76 with thin client.

Posted by jjimeno <jj...@omp.com>.
Hello,

Thanks for your answer. 
The server is already in version 2.9.1 and the c++ thin client is from
master branch to get transactions support.

José 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: [2.7.6] Unsupported protocol version: -76 with thin client.

Posted by Alex Plehanov <pl...@gmail.com>.
Hello,

Can you please share your stacktrace? In 2.7.6 I think this bug
affects only cache configuration retrieval and binary metadata retrieval.
To avoid problems with binary metadata retrieval you should not use types
which typeId (IgniteClient.binary().typeId()) starts with byte 103 as cache
keys or values.

If you can't upgrade Ignite server to 2.9.1, perhaps you can upgrade only
the client? This will also solve the problem.

ср, 27 янв. 2021 г. в 19:46, maxi628 <ma...@gmail.com>:

> Hello everyone.
>
> I'm having an issue that appears randomly on my internal product testing.
> Looks like its related to
> https://issues.apache.org/jira/browse/IGNITE-13401
> but the stacktrace looks different.
> Basically I'm building a BinaryObject which ends up fetching
> BinaryObjectMetadata from the server and it fails with that exception.
>
>
>
> Upgrading to ignite 2.9.1 where it's patched isn't an option for me.
> The BinaryObjectMetadata is user-configured via some interfaces.
> Is there any workarounds for this?
> If we have a way to calculate the size of the metadata before sending it we
> could add a dummy field in those cases where it ends up matching the
> GridBinaryMarshaller.OBJ on the second byte of the stream.
>
> Here's the datagram in hex
>
>
> And a photo from the debugger in which it shows the problematic value
>
> Screen_Shot_2021-01-27_at_10.png
> <
> http://apache-ignite-users.70518.x6.nabble.com/file/t3058/Screen_Shot_2021-01-27_at_10.png>
>
>
> Thanks everyone.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>