sdk
sdk copied to clipboard
dart:io#WebSocket: Low-level protocol error (1002) occurs
This is going to be a tough one to debug, as it only happens to me after a few hours of usage, but I'm happy to add any debugging/test versions of the VM/SDK in order to help debug this as much as possible - or copying the Socket
-implemented code and adding instrumentation.
Basically, after a few hours of connection, WebSocket.onDone
completes with no error message, but an error code of 1002
, which from a few searches seems to be from a "low-level protocol error" - i.e. likely not user code, but I could br wrong.
Here is a snippet of my code (very light wrapper around dart:io
):
https://github.com/matanlurey/din/blob/d08f9c36932f74d8fb8abb7fd7527a47eafe075d/lib/platform/vm.dart#L72-L108
I'm running it on GCE (Google Compute Engine), and my dart --version
is:
Dart VM version: 2.0.0-dev.4.0 (Wed Oct 18 16:35:12 2017) on "linux_x64"
(I'm going to update to latest now to see if that solves the issue)
I am now running at
Dart VM version: 2.0.0-dev.14.0 (Unknown timestamp) on "linux_x64"
... and will update this thread if the problem goes away.
Nope, still got a crash :-/
@matanlurey Did you manage to find a solution for this? I'm having the same problem, except that I got the unexpected close with code 1002 within a few minutes of connection, usually after a short period of inactivity.
@daniel-mf did you manage to find a fix for this? I am also having the same problem
@Jerome-Saltmarsh Unfortunately not. It has been a long time since I last worked at this, but my project still struggles with this issue. I'll probably end up migrating to some other library. I'll be really sorry to do that cause I enjoy coding in Dart so much.
I actually figured out what that it wasn't a code related issue. Rather my deployment configuration had a timeout of 300 seconds (I'm using google cloud run). Increasing this value resolved the issue for me.
Same problem.