Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Streaming][Kraken] Fixed bug that caused invalid WebSocket Extension handshake message. #3803

Merged

Conversation

nielsdraaisma
Copy link
Contributor

Fixed a bug in the Kraken streaming client that started today resulting in the following error

Caused by: io.netty.handler.codec.CodecException: invalid WebSocket Extension handshake for "permessage-deflate; client_no_context_takeover"

Relates to netty/netty#10191 , this change reuses the existing CoinbasePro handler which i moved to streaming-core-netty.

@mdvx
Copy link
Contributor

mdvx commented Nov 11, 2020

ah good, was just about to look into that

@mdvx
Copy link
Contributor

mdvx commented Nov 11, 2020

umm, still getting errors from unit test (after applying patch)

info.bitrich.xchangestream.kraken.KrakenManualExample

18:29:28.085 [main] INFO info.bitrich.xchangestream.kraken.KrakenStreamingService - Connecting to wss://ws.kraken.com
18:29:28.106 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework
18:29:28.130 [main] DEBUG io.netty.util.internal.PlatformDependent - Platform: Windows
18:29:28.133 [main] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
18:29:28.133 [main] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 11
18:29:28.136 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
18:29:28.137 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
18:29:28.139 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
18:29:28.144 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: unavailable
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31)
at io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:238)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at io.netty.util.internal.PlatformDependent0.(PlatformDependent0.java:232)
at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:293)
at io.netty.util.internal.PlatformDependent.(PlatformDependent.java:92)
at io.netty.handler.ssl.OpenSsl.(OpenSsl.java:124)
at io.netty.handler.ssl.SslContext.defaultProvider(SslContext.java:123)
at io.netty.handler.ssl.SslContext.defaultClientProvider(SslContext.java:119)
at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:814)
at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:576)
at info.bitrich.xchangestream.service.netty.NettyStreamingService.lambda$openConnection$3(NettyStreamingService.java:177)

I am using JDK 11, if that helps

@nielsdraaisma
Copy link
Contributor Author

umm, still getting errors from unit test (after applying patch)

info.bitrich.xchangestream.kraken.KrakenManualExample

18:29:28.085 [main] INFO info.bitrich.xchangestream.kraken.KrakenStreamingService - Connecting to wss://ws.kraken.com
18:29:28.106 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework
18:29:28.130 [main] DEBUG io.netty.util.internal.PlatformDependent - Platform: Windows
18:29:28.133 [main] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
18:29:28.133 [main] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 11
18:29:28.136 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
18:29:28.137 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
18:29:28.139 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
18:29:28.144 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: unavailable
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31)
at io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:238)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at io.netty.util.internal.PlatformDependent0.(PlatformDependent0.java:232)
at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:293)
at io.netty.util.internal.PlatformDependent.(PlatformDependent.java:92)
at io.netty.handler.ssl.OpenSsl.(OpenSsl.java:124)
at io.netty.handler.ssl.SslContext.defaultProvider(SslContext.java:123)
at io.netty.handler.ssl.SslContext.defaultClientProvider(SslContext.java:119)
at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:814)
at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:576)
at info.bitrich.xchangestream.service.netty.NettyStreamingService.lambda$openConnection$3(NettyStreamingService.java:177)

I am using JDK 11, if that helps

This PR doesn't address these errors, i'm seeing them locally as well, it only addresses the problem described in the linked issue in the netty repo.

@earce
Copy link
Collaborator

earce commented Nov 12, 2020

Thank you guys for getting this out so quickly, I just had a patch ready and you folks had beat me to it!

@nielsdraaisma
Copy link
Contributor Author

Would be great if @badgerwithagun or @timmolter could merge this in, travis build failed due to a failure to download a dependency, should be fine aside from that.

@earce
Copy link
Collaborator

earce commented Nov 12, 2020

Are you guys seeing any issues with the actual parsing of messages now?

@earce
Copy link
Collaborator

earce commented Nov 12, 2020

@mdvx @nielsdraaisma

@earce
Copy link
Collaborator

earce commented Nov 12, 2020

please ignore my comments, an issue on my end

@timmolter timmolter merged commit f2b1b5f into knowm:develop Nov 12, 2020
@nielsdraaisma nielsdraaisma deleted the nielsdraaisma/kraken-stream-handler branch November 12, 2020 22:38
@mdvx
Copy link
Contributor

mdvx commented Nov 14, 2020

confirm fixed for me too
only other change I made was
okhttp-version 3.13.1
to
okhttp-version 4.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants