Giter Site home page Giter Site logo

Comments (10)

zuboje avatar zuboje commented on May 28, 2024 1

@jamiewest it looks like the problem is resolved. I am no longer receiving an error.

from signalr_core.

jamiewest avatar jamiewest commented on May 28, 2024

The access_token part in your logs looks off and might be the issue. Did you modify the output of the logs to replace the actual token with <token>?

from signalr_core.

KovalenkoILja avatar KovalenkoILja commented on May 28, 2024

The access_token part in your logs looks off and might be the issue. Did you modify the output of the logs to replace the actual token with <token>?

Yes, i remove actual token from logs for safety.

from signalr_core.

Emelio avatar Emelio commented on May 28, 2024

I keep getting this error

HttpConnection.stopConnection(Exception: WebSocket closed with status code: 1002 (null).) called while in state ConnectionState.connecting.

from signalr_core.

zuboje avatar zuboje commented on May 28, 2024

I am having the very same error, except my, I don't use access tokens, my SignalR server is open to everyone. I use .NET Core 3.1 on Windows server (for some reason on Linux server I had issues).

final hubConnection = HubConnectionBuilder().withUrl(rtcUrl, HttpConnectionOptions(logging: (level, message) => print(message))).withAutomaticReconnect().build();

Now the server does not disconnect if I start the connection and keep it sitting there, it disconnects at some point after data exchange starts. I just randomly receive the error below. I have noticed something when I set transport under connection options to HttpTransportType.longPolling it runs, yet at some point, it still disconnects. I tried reconnecting but I am unable to do so. I figure out the approximate time to disconnect is about 2 minutes (default SignalR time to disconnect is 110 seconds). I have tried to setup

if (hubConnection.state == HubConnectionState.disconnected && hubConnection.state != HubConnectionState.connecting && hubConnection.state != HubConnectionState.disconnecting){...}

I still receive the exception that I cannot call start HubConnection failed to start successfully because of error '{type 'NoSuchMethodError' is not a subtype of type 'Exception'.toString}'. All details are in the log below.

My Server:

image

I/flutter ( 9610): WebSocket connected to wss://URL?id=jOxUVuMauABfLhE4VmoOYw.
I/flutter ( 9610): (WebSockets transport) socket closed.
I/flutter ( 9610): HttpConnection.stopConnection(Exception: WebSocket closed with status code: 1002 (null).) called while in state ConnectionState.connecting.
I/flutter ( 9610): Call to HttpConnection.stopConnection(Exception: WebSocket closed with status code: 1002 (null).) was ignored because the connection is still in the connecting state.
E/flutter ( 9610): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: Exception: HttpConnection.stopConnection(Exception: WebSocket closed with status code: 1002 (null).) was called while the connection is still in the connecting state.
�[38;5;248mE/flutter ( 9610): #0 HttpConnection._stopConnection�[39;49m
package:signalr_core/src/http_connection.dart
�[38;5;248mE/flutter ( 9610): #1 HttpConnection._startTransport.�[39;49m
package:signalr_core/src/http_connection.dart
�[38;5;248mE/flutter ( 9610): #2 WebSocketTransport._close�[39;49m
package:signalr_core/…/transports/web_socket_transport.dart
�[38;5;248mE/flutter ( 9610): #3 WebSocketTransport.connect.�[39;49m
package:signalr_core/…/transports/web_socket_transport.dart
�[38;5;244mE/flutter ( 9610): #4 _rootRun (dart:async/zone.dart:1182:47)�[39;49m
�[38;5;244mE/flutter ( 9610): #5 _CustomZone.run (dart:async/zone.dart:1093:19)�[39;49m
�[38;5;244mE/flutter ( 9610): #6 _CustomZone.runGuarded (dart:async/zone.dart:997:7)�[39;49m
�[38;5;244mE/flutter ( 9610): #7 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:410:13)�[39;49m
�[38;5;244mE/flutter ( 9610): #8 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:420:15)�[39;49m
�[38;5;244mE/flutter ( 9610): #9 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:305:7)�[39;49m
�[38;5;244mE/flutter ( 9610): #10 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:101:10)�[39;49m
�[38;5;244mE/flutter ( 9610): #11 _ForwardingStreamSubscription._handleDone (dart:async/stream_pipe.dart:165:13)�[39;49m
�[38;5;244mE/flutter ( 9610): #12 _rootRun (dart:async/zone.dart:1182:47)�[39;49m
�[38;5;244mE/flutter ( 9610): #13 _CustomZone.run (dart:async/zone.dart:1093:19)�[39;49m
�[38;5;244mE/flutter ( 9610): #14 _CustomZone.runGuarded (dart:async/zone.dart:997:7)�[39;49m
�[38;5;244mE/flutter ( 9610): #15 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:410:13)�[39;49m
�[38;5;244mE/flutter ( 9610): #16 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:420:15)�[39;49m
�[38;5;244mE/flutter ( 9610): #17 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:305:7)�[39;49m
�[38;5;244mE/flutter ( 9610): #18 _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:816:19)�[39;49m
�[38;5;244mE/flutter ( 9610): #19 _StreamController._closeUnchecked (dart:async/stream_controller.dart:671:7)�[39;49m
�[38;5;244mE/flutter ( 9610): #20 _StreamController.close (dart:async/stream_controller.dart:664:5)�[39;49m
�[38;5;244mE/flutter ( 9610): #21 new _WebSocketImpl._fromSocket. (dart:_http/websocket_impl.dart:1157:19)�[39;49m
�[38;5;244mE/flutter ( 9610): #22 _rootRunBinary (dart:async/zone.dart:1214:47)�[39;49m
�[38;5;244mE/flutter ( 9610): #23 _CustomZone.runBinary (dart:async/zone.dart:1107:19)�[39;49m
�[38;5;244mE/flutter ( 9610): #24 _CustomZone.runBinaryGuarded (dart:async/zone.dart:1013:7)�[39;49m
�[38;5;244mE/flutter ( 9610): #25 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:376:15)�[39;49m
�[38;5;244mE/flutter ( 9610): #26 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:391:18)�[39;49m
�[38;5;244mE/flutter ( 9610): #27 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:294:7)�[39;49m
�[38;5;244mE/flutter ( 9610): #28 _SinkTransformerStreamSubscription._addError (dart:async/stream_transformers.dart:83:11)�[39;49m
�[38;5;244mE/flutter ( 9610): #29 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:123:7)�[39;49m
�[38;5;244mE/flutter ( 9610): #30 _HttpDetachedStreamSubscription._maybeScheduleData. (dart:_http/http_parser.dart:178:20)�[39;49m
�[38;5;244mE/flutter ( 9610): #31 _rootRun (dart:async/zone.dart:1182:47)�[39;49m
�[38;5;244mE/flutter ( 9610): #32 _CustomZone.run (dart:async/zone.dart:1093:19)�[39;49m
�[38;5;244mE/flutter ( 9610): #33 _CustomZone.runGuarded (dart:async/zone.dart:997:7)�[39;49m
�[38;5;244mE/flutter ( 9610): #34 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23)�[39;49m
�[38;5;244mE/flutter ( 9610): #35 _rootRun (dart:async/zone.dart:1190:13)�[39;49m
�[38;5;244mE/flutter ( 9610): #36 _CustomZone.run (dart:async/zone.dart:1093:19)�[39;49m
�[38;5;244mE/flutter ( 9610): #37 _CustomZone.runGuarded (dart:async/zone.dart:997:7)�[39;49m
�[38;5;244mE/flutter ( 9610): #38 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23)�[39;49m
�[38;5;244mE/flutter ( 9610): #39 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)�[39;49m
�[38;5;244mE/flutter ( 9610): #40 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)�[39;49m
E/flutter ( 9610):
I/flutter ( 9610): The HttpConnection connected successfully.
I/flutter ( 9610): Sending handshake request.
I/flutter ( 9610): Hub handshake failed with error 'NoSuchMethodError: The method 'send' was called on null.
I/flutter ( 9610): Receiver: null
I/flutter ( 9610): Tried calling: send("{"protocol":"json","version":1}\u001e")' during start(). Stopping HubConnection.
I/flutter ( 9610): HubConnection failed to start successfully because of error '{type 'NoSuchMethodError' is not a subtype of type 'Exception'.toString}'.

E/flutter ( 9610): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: Read failed
E/flutter ( 9610):
I/flutter ( 9610): The HttpConnection connected successfully.
I/flutter ( 9610): Sending handshake request.
I/flutter ( 9610): (WebSockets transport) sending data. String data of length '32'.
I/flutter ( 9610): Hub handshake failed with error 'NoSuchMethodError: The getter 'sink' was called on null.
I/flutter ( 9610): Receiver: null
I/flutter ( 9610): Tried calling: sink' during start(). Stopping HubConnection.
I/flutter ( 9610): HubConnection failed to start successfully because of error '{type 'NoSuchMethodError' is not a subtype of type 'Exception'.toString}'.

from signalr_core.

zuboje avatar zuboje commented on May 28, 2024

@jamiewest any ideas?

from signalr_core.

jamiewest avatar jamiewest commented on May 28, 2024

I think toString is getting called on an exception that hadn't been cast as an exception. I'm off today so I will see if i can track down the problems mentioned in the issue. Thanks all for everyone's patience on this.

from signalr_core.

jamiewest avatar jamiewest commented on May 28, 2024

@zuboje I committed a few bits earlier, could try them out and let me know the outcome?

Update your reference in pubspec.yaml to the following:

  signalr_core:
    git: 
      url: https://github.com/jamiewest/signalr_core.git
      ref: 3e8abe6e5ac1dd9dd2f18c0df91bfd9c8ba8a4af

from signalr_core.

joeyyy688 avatar joeyyy688 commented on May 28, 2024

Hello, I keep getting a similar error to this any help?
These are the error logs...
I/flutter (14832): Starting HubConnection.
I/flutter (14832): Starting connection with transfer format 'TransferFormat.text'.
I/flutter (14832): (WebSockets transport) Connecting.
I/flutter (14832): WebSocket connected to ws:// removed for privacy reasons
I/flutter (14832): The HttpConnection connected successfully.
I/flutter (14832): Sending handshake request.
I/flutter (14832): (WebSockets transport) socket closed.
I/flutter (14832): HttpConnection.stopConnection(Exception: WebSocket closed with status code: 1002 (null).) called while in state ConnectionState.connected.
I/flutter (14832): Connection disconnected with error 'Exception: WebSocket closed with status code: 1002 (null).'.
E/flutter (14832): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Bad state: Future already completed
E/flutter (14832): #0 _AsyncCompleter.complete (dart:async/future_impl.dart:45:31)
E/flutter (14832): #1 TransportSendQueue.stop
package:signalr_core/src/http_connection.dart:655
E/flutter (14832): #2 HttpConnection._stopConnection
package:signalr_core/src/http_connection.dart:291
E/flutter (14832): #3 HttpConnection._startTransport.
package:signalr_core/src/http_connection.dart:457
E/flutter (14832): #4 WebSocketTransport._close
package:signalr_core/…/transports/web_socket_transport.dart:130
E/flutter (14832): #5 WebSocketTransport.connect.
package:signalr_core/…/transports/web_socket_transport.dart:85
E/flutter (14832): #6 _rootRun (dart:async/zone.dart:1346:47)
E/flutter (14832): #7 _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (14832): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
E/flutter (14832): #9 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:394:13)
E/flutter (14832): #10 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:404:15)
E/flutter (14832): #11 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
E/flutter (14832): #12 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:99:10)
E/flutter (14832): #13 _ForwardingStreamSubscription._handleDone (dart:async/stream_pipe.dart:161:13)
E/flutter (14832): #14 _rootRun (dart:async/zone.dart:1346:47)
E/flutter (14832): #15 _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (14832): #16 _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
E/flutter (14832): #17 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:394:13)
E/flutter (14832): #18 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:404:15)
E/flutter (14832): #19 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
E/flutter (14832): #20 _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:741:19)
E/flutter (14832): #21 _StreamController._closeUnchecked (dart:async/stream_controller.dart:596:7)
E/flutter (14832): #22 _StreamController.close (dart:async/stream_controller.dart:589:5)
E/flutter (14832): #23 new _WebSocketImpl._fromSocket. (dart:_http/websocket_impl.dart:1157:19)
E/flutter (14832): #24 _rootRunBinary (dart:async/zone.dart:1378:47)
E/flutter (14832): #25 _CustomZone.runBinary (dart:async/zone.dart:1272:19)
E/flutter (14832): #26 _CustomZone.runBinaryGuarded (dart:async/zone.dart:1178:7)
E/flutter (14832): #27 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:360:15)
E/flutter (14832): #28 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:375:18)
E/flutter (14832): #29 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:280:7)
E/flutter (14832): #30 _SinkTransformerStreamSubscription._addError (dart:async/stream_transformers.dart:75:11)
E/flutter (14832): #31 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:113:7)
E/flutter (14832): #32 _HttpDetachedStreamSubscription._maybeScheduleData. (dart:_http/http_parser.dart:178:20)
E/flutter (14832): #33 _rootRun (dart:async/zone.dart:1346:47)
E/flutter (14832): #33 _rootRun (dart:async/zone.dart:1346:47)
E/flutter (14832): #34 _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (14832): #35 _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
E/flutter (14832): #36 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1202:23)
E/flutter (14832): #37 _rootRun (dart:async/zone.dart:1354:13)
E/flutter (14832): #38 _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (14832): #39 _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
E/flutter (14832): #40 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1202:23)
E/flutter (14832): #41 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter (14832): #42 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
E/flutter (14832):
I/flutter (14832): Hub handshake failed with error 'Exception: Connection stopped.' during start(). Stopping HubConnection.
I/flutter (14832): HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.
I/flutter (14832): HttpConnection.stopConnection(null) called while in state ConnectionState.disconnecting.
I/flutter (14832): Connection disconnected with error 'Exception: Connection stopped.'.
I/flutter (14832): HubConnection failed to start successfully because of error '{Bad state: Future already completed.toString()}'.

from signalr_core.

motasemloubani91 avatar motasemloubani91 commented on May 28, 2024

anyone has fixed this. The first request in the connection is authorized using the access token in the query string, but the next request are not authorized and keep giving me 401, any help please, we are stuck

from signalr_core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.