question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EOFException handling permessage-deflate response with OkHttp4.5 Websocket

See original GitHub issue

Hello. I use latest version of OKHttp4.5 and send websocket request with permessage-deflate header which is a compression protocol. But sometime reponse message data is parsed wrong, may be the response message data (original is 140K) is too large. the system error log as follows. Bofore Version of 4.5, everything is ok. I doubt this version is not stable for permessage-deflate protocol.

2020-04-20 18:15:53.144 32664-32689/com. W/System.err: java.io.EOFException: source exhausted prematurely
2020-04-20 18:15:53.144 32664-32689/com. W/System.err:     at okio.InflaterSource.read(InflaterSource.kt:75)
2020-04-20 18:15:53.144 32664-32689/com. W/System.err:     at okhttp3.internal.ws.MessageInflater.inflate(MessageInflater.kt:58)
2020-04-20 18:15:53.144 32664-32689/com. W/System.err:     at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.kt:241)
2020-04-20 18:15:53.144 32664-32689/com. W/System.err:     at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:106)
2020-04-20 18:15:53.144 32664-32689/com. W/System.err:     at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293)
2020-04-20 18:15:53.144 32664-32689/com. W/System.err:     at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195)
2020-04-20 18:15:53.144 32664-32689/com. W/System.err:     at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:504)
2020-04-20 18:15:53.144 32664-32689/com. W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
2020-04-20 18:15:53.144 32664-32689/com. W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
2020-04-20 18:15:53.144 32664-32689/com. W/System.err:     at java.lang.Thread.run(Thread.java:761)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Black-Memorycommented, Apr 23, 2020

@yschimke we have not empty message

1reaction
Black-Memorycommented, Apr 21, 2020

@yschimke This is a simple and normal websocket server using Netty. It’s good for web brower, not for version of OkHttp4.5.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EOFException on websocket · Issue #3113 · square/okhttp
After connecting to webservice every single minute (seems like some ping) I'm getting the below exception (which forces me to reconnect).
Read more >
Websocket closes connection with EOF exception on "101 ...
After a successful connection and a short period of inactivity, the OKHttp3 websocket throws an EOFException in response to a 101 Switching ...
Read more >
Tomcat: EOFException when trying to reconnect via Websockets
I have a problem using ktor websockets, I had two different client types: ... Text(JSON.stringify(params))) } } catch (e: Exception) { println(e.message) ...
Read more >
Intermittent connection to? - Dremio Community
The error is about sockets being closed unexpectedly, which is not a problem since it can happen when users close browsers for example....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found