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

Unhandled Exception: SocketException: OS Error: Connection reset by peer, errno = 104, address = chat.connectycube.com, port = 58158 #42

Closed
himanshukh opened this issue Nov 26, 2020 · 14 comments

Comments

@himanshukh
Copy link

himanshukh commented Nov 26, 2020

I'm using Audio and Video call API for flutter. I'm getting this error when application is active mode for some time. Could you help please me to resolve this.

@TatankaConCube
Copy link
Contributor

please, provide detailed steps, how can we reproduce this issue on our sample. Please, provide a full log, not only an error message, it will be more helpful.

Additional thing - if you had some issues with the internet connection, you can try using reconnection manager, more details here

@himanshukh
Copy link
Author

please, provide detailed steps, how can we reproduce this issue on our sample. Please, provide a full log, not only an error message, it will be more helpful.

Additional thing - if you had some issues with the internet connection, you can try using reconnection manager, more details here

This is not an internet connection issue. I'm using connectycube_sdk: ^0.3.0-beta1 version right now.
If any user available on application for some time user not able to get call or not able to dial a call due to this error. How to check connection and re-login for this version. Please suggest me any solution. Thanks.

@TatankaConCube
Copy link
Contributor

without logs, we can't understand, what happens with your internet connection, so, we need them anyway.

one more thing - why you don't use the latest version (at this moment it is 1.0.0) of our SDK?

@himanshukh
Copy link
Author

himanshukh commented Nov 26, 2020

Thanks @TatankaConCube. I have upgraded to latest version but having some issues in IOS version
CocoaPods could not find compatible versions for pod "GoogleWebRTC"
Is need to upgrade CocoaPods? or can get any solution for this. Please

@TatankaConCube
Copy link
Contributor

yes, just run 'pod update' in 'ios' directory

@himanshukh
Copy link
Author

yes, just run 'pod update' in 'ios' directory

Thanks. I have run pod update GoogleWebRTC and it's working fine now.

@himanshukh
Copy link
Author

himanshukh commented Dec 3, 2020

Hi @TatankaConCube I'm again facing issues when application reconnect with internet.

Application not able to connect automatically so I have used below code:

CubeChatConnectionSettings chatConnectionSettings = CubeChatConnectionSettings.instance;
chatConnectionSettings.totalReconnections = 5; // set 0 to disable internal reconnection manager or value more than 0 to set quantity of times to try to reconnect, default 5 times
chatConnectionSettings.reconnectionTimeout = 5000;

Connectivity().onConnectivityChanged.listen((connectivityType) {

  if (connectivityType != ConnectivityResult.none) {
    bool isChatDisconnected = CubeChatConnection.instance.chatConnectionState == CubeChatConnectionState.Closed;

    if (isChatDisconnected && CubeChatConnection.instance.currentUser != null) {
      CubeChatConnection.instance.relogin();
    }
  }
});

But not able to login again.. Is there any changes in re-login function ?

Please check below log:

[log] D/[Connection]: State: XmppConnectionState.Authenticated
[log] D/[ConnectionNegotiatorManager]: Found matching negotiator true
[log] ---Xmpp Sending:---
[log]
[log] D/[ConnectionNegotiatorManager]: ACTIVE FEATURE: {name: StreamManagementModule, name_space: null, priority: 1000, state: NegotiatorState.NEGOTIATING}, isReady: true
[log] D/[ConnectionNegotiatorManager]: Feature Started Parsing
[log] ---Xmpp Receiving:---
I/flutter (13240): CB-SDK: CubeChatConnection: Chat connection ForcefullyClosed
[log] <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='chat.connectycube.com' id='1528d3fd-e269-4bd4-bc4d-3df06c05a972' version='1.0' xml:lang='en'>
[log] D/[Connection]: processInitialStream
[log] D/[Connection]: Handle secured connection done
[log] D/[Connection]: State: XmppConnectionState.ForcefullyClosed
[log] D/[ReconnectionManager]: Connection forcefully closed!
[log] D/[ReconnectionManager]: TimeOut is: 10000 reconnection counter 0
F/OIC_SRM_DOXM(16342): UpdatePersistentStorage failed!
[log] D/[Connection]: State: XmppConnectionState.Reconnecting
I/flutter (13240): CB-SDK: CubeChatConnection: Chat connection Reconnecting
I/flutter (13240): CB-SDK: CubeChatConnection: Chat connection SocketOpening
[log] D/[Connection]: State: XmppConnectionState.SocketOpening
[log] D/[Connection]: State: XmppConnectionState.SocketOpened
[log] ---Xmpp Sending:---
I/flutter (13240): CB-SDK: CubeChatConnection: Chat connection SocketOpened
[log]
<stream:stream xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'
to='chat.connectycube.com'
xml:lang='en'

Can you please check and update me asap.

Thanks.

@TatankaConCube
Copy link
Contributor

@himanshukh in the provided log I can't see any errors after starting reconnection. Please provide a full log with the error.

@himanshukh
Copy link
Author

@himanshukh in the provided log I can't see any errors after starting reconnection. Please provide a full log with the error.

Whenever internet off it providing this:

ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: SocketException: OS Error: Software caused connection abort, errno = 103, address = chat.connectycube.com, port = 37726

After internet connected

Screenshot 2020-12-03 at 2 26 27 PM

Is this useful or need to provide more logs ?

@TatankaConCube
Copy link
Contributor

do you use Connectivity for listening connection as you provided in the previous message? looks like you use only default reconnection, and it does not wait for connection and tries to reconnect after the timeout.

@TatankaConCube
Copy link
Contributor

Is this useful or need to provide more logs ?

you said you get this error after reconnection, but provided error only when a lost connection (it is expected). I asked one more time - do you have the same error after the internet connection was established? If yes, please provide a full log.

@himanshukh
Copy link
Author

himanshukh commented Dec 3, 2020

Is this useful or need to provide more logs ?

you said you get this error after reconnection, but provided error only when a lost connection (it is expected). I asked one more time - do you have the same error after the internet connection was established? If yes, please provide a full log.

Okay let me share everything what i did..

After off the internet connection:

[log] D/[Connection]: Handle Secured Error SocketException: OS Error: Software caused connection abort, errno = 103, address = chat.connectycube.com, port = 40190
[log] D/[Connection]: State: XmppConnectionState.ForcefullyClosed
[log] D/[Connection]: Handle secured connection done
[log] D/[Connection]: State: XmppConnectionState.ForcefullyClosed
[log] D/[ReconnectionManager]: Connection forcefully closed!
I/flutter (12499): CB-SDK: CubeChatConnection: Chat connection ForcefullyClosed
[log] D/[ReconnectionManager]: TimeOut is: 10000 reconnection counter 0
I/flutter (12499): CB-SDK: CubeChatConnection: Chat connection ForcefullyClosed
[log] D/[ReconnectionManager]: Connection forcefully closed!
[log] D/[ReconnectionManager]: TimeOut is: 20000 reconnection counter 1
E/flutter (12499): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: SocketException: OS Error: Software caused connection abort, errno = 103, address = chat.connectycube.com, port = 40190
E/flutter (12499):
I/flutter (12499): connectivityType ConnectivityResult.none
I/flutter (12499): ConnectivityResult ConnectivityResult
I/ViewRootImpl@31d5d74MainActivity: MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager(12499): prepareNavigationBarInfo() DecorView@fea470a[MainActivity]
D/InputMethodManager(12499): getNavigationBarColor() -855310
[log] D/[Connection]: State: XmppConnectionState.Reconnecting
I/flutter (12499): CB-SDK: CubeChatConnection: Chat connection Reconnecting
[log] D/[Connection]: State: XmppConnectionState.SocketOpening
I/flutter (12499): CB-SDK: CubeChatConnection: Chat connection SocketOpening
I/flutter (12499): CB-SDK: CubeChatConnection: Chat connection ForcefullyClosed
[log] E/[Connection]: Socket ExceptionSocketException: Failed host lookup: 'chat.connectycube.com' (OS Error: No address associated with hostname, errno = 7)
[log] D/[Connection]: State: XmppConnectionState.ForcefullyClosed
[log] D/[ReconnectionManager]: Connection forcefully closed!
[log] D/[ReconnectionManager]: TimeOut is: 40000 reconnection counter 2
I/flutter (12499): CB-SDK: CubeChatConnection: Chat connection Reconnecting
[log] D/[Connection]: State: XmppConnectionState.Reconnecting
[log] D/[Connection]: State: XmppConnectionState.SocketOpening
I/flutter (12499): CB-SDK: CubeChatConnection: Chat connection SocketOpening
I/flutter (12499): CB-SDK: CubeChatConnection: Chat connection ForcefullyClosed
[log] E/[Connection]: Socket ExceptionSocketException: Failed host lookup: 'chat.connectycube.com' (OS Error: No address associated with hostname, errno = 7)
[log] D/[Connection]: State: XmppConnectionState.ForcefullyClosed
[log] D/[ReconnectionManager]: Connection forcefully closed!

After on internet connection repeatedly call:

[log] D/[Connection]: State: XmppConnectionState.Authenticated
[log] D/[ConnectionNegotiatorManager]: Found matching negotiator true
[log] ---Xmpp Sending:---
[log]
[log] D/[ConnectionNegotiatorManager]: ACTIVE FEATURE: {name: StreamManagementModule, name_space: null, priority: 1000, state: NegotiatorState.NEGOTIATING}, isReady: true
[log] D/[ConnectionNegotiatorManager]: Feature Started Parsing
[log] ---Xmpp Receiving:---
[log] <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='chat.connectycube.com' id='44b1cce7-a388-44be-ae0d-3f7967139bab' version='1.0' xml:lang='en'>
[log] D/[Connection]: processInitialStream
[log] ---Xmpp Receiving:---
E/flutter (12502): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: Bad state: Stream has already been listened to.
E/flutter (12502): #0 _StreamController._subscribe (dart:async/stream_controller.dart:710:7)
E/flutter (12502): #1 _ControllerStream._createSubscription (dart:async/stream_controller.dart:860:19)
E/flutter (12502): #2 _StreamImpl.listen (dart:async/stream_impl.dart:493:9)
E/flutter (12502): #3 ConnectionNegotiatorManager.negotiateNextFeature (package:xmpp_stone/src/features/ConnectionNegotatiorManager.dart:91:49)
E/flutter (12502): #4 ConnectionNegotiatorManager.negotiateFeatureList (package:xmpp_stone/src/features/ConnectionNegotatiorManager.dart:65:5)
E/flutter (12502): #5 Connection.handleResponse. (package:xmpp_stone/src/Connection.dart:311:43)
E/flutter (12502): #6 Iterable.forEach (dart:core/iterable.dart:283:30)
E/flutter (12502): #7 Connection.handleResponse (package:xmpp_stone/src/Connection.dart:310:12)
E/flutter (12502): #8 _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (12502): #9 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (12502): #10 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (12502): #11 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
E/flutter (12502): #12 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
E/flutter (12502): #13 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:127:11)
E/flutter (12502): #14 _MapStream._handleData (dart:async/stream_pipe.dart:224:10)
E/flutter (12502): #15 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:157:13)
E/flutter (12502): #16 _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (12502): #17 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (12502): #18 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (12502): #19 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
E/flutter (12502): #20 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
E/flutter (12502): #21 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:69:11)
E/flutter (12502): #22 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
E/flutter (12502): #23 _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)
E/flutter (12502): #24 _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243:7)
E/flutter (12502): #25 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317:20)
E/flutter (12502): #26 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)
E/flutter (12502): #27 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
E/flutter (12502): #28 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:121:24)
E/flutter (12502): #29 _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (12502): #30 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (12502): #31 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (12502): #32 CastStreamSubscription._onData (dart:_internal/async_cast.dart:85:11)
E/flutter (12502): #33 _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (12502): #34 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (12502): #35 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (12502): #36 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
E/flutter (12502): #37 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
E/flutter (12502): #38 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:808:19)
E/flutter (12502): #39 _StreamController._add (dart:async/stream_controller.dart:682:7)
E/flutter (12502): #40 _StreamController.add (dart:async/stream_controller.dart:624:5)
E/flutter (12502): #41 _Socket._onData (dart:io-patch/socket_patch.dart:2020:41)
E/flutter (12502): #42 _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (12502): #43 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (12502): #44 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (12502): #45 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
E/flutter (12502): #46 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
E/flutter (12502): #47 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:808:19)
E/flutter (12502): #48 _StreamController._add (dart:async/stream_controller.dart:682:7)
E/flutter (12502): #49 _StreamController.add (dart:async/stream_controller.dart:624:5)
E/flutter (12502): #50 _RawSecureSocket._sendReadEvent (dart:io/secure_socket.dart:1002:19)
E/flutter (12502): #51 _rootRun (dart:async/zone.dart:1182:47)
E/flutter (12502): #52 _CustomZone.run (dart:
I/flutter (12502): CB-SDK: CubeChatConnection: Chat connection ForcefullyClosed
I/flutter (12502): isme check kar555
[log] stream:featureszlib</stream:features>
[log] D/[ConnectionNegotiatorManager]: Negotiating features
[log] D/[ConnectionNegotiatorManager]: Found matching negotiator true
[log] ---Xmpp Sending:---
[log]
[log] D/[ConnectionNegotiatorManager]: ACTIVE FEATURE: {name: StreamManagementModule, name_space: null, priority: 1000, state: NegotiatorState.NEGOTIATING}, isReady: true
[log] D/[Connection]: Handle secured connection done
[log] D/[Connection]: State: XmppConnectionState.ForcefullyClosed
[log] D/[ReconnectionManager]: Connection forcefully closed!
[log] D/[ReconnectionManager]: TimeOut is: 10000 reconnection counter 0
E/flutter (12502): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: SocketException: OS Error: Broken pipe, errno = 32, address = chat.connectycube.com, port = 40846
E/flutter (12502):
F/OIC_SRM_DOXM(24387): UpdatePersistentStorage failed!
I/flutter (12502): CB-SDK: CubeChatConnection: Chat connection Reconnecting
I/flutter (12502): isme check kar555
[log] D/[Connection]: State: XmppConnectionState.Reconnecting
[log] D/[Connection]: State: XmppConnectionState.SocketOpening
I/flutter (12502): CB-SDK: CubeChatConnection: Chat connection SocketOpening
[log] D/[Connection]: State: XmppConnectionState.SocketOpened
[log] ---Xmpp Sending:---
I/flutter (12502): CB-SDK: CubeChatConnection: Chat connection SocketOpened
[log]
<stream:stream xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'
to='chat.connectycube.com'
xml:lang='en'

[log] ---Xmpp Receiving:---
[log] <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='chat.connectycube.com' id='4adf3362-1205-4726-8c9a-83e4591a9ffc' version='1.0' xml:lang='en'>
[log] D/[Connection]: processInitialStream
[log] ---Xmpp Receiving:---
[log] stream:featuresPLAINANONYMOUSPLAIN_FASTzlib</stream:features>
[log] D/[ConnectionNegotiatorManager]: Negotiating features
[log] D/[ConnectionNegotiatorManager]: Found matching negotiator true
[log] D/[StartTlsNegotiator]: negotiating starttls
[log] ---Xmpp Sending:---
[log]
[log] D/[ConnectionNegotiatorManager]: ACTIVE FEATURE: {name: StartTlsNegotiator, name_space: urn:ietf:params:xml:ns:xmpp-tls, priority: 1, state: NegotiatorState.NEGOTIATING}, isReady: true
[log] ---Xmpp Receiving:---
[log]
[log] D/[Connection]: startSecureSocket
[log] ---Xmpp Sending:---
[log]
<stream:stream xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'
to='chat.connectycube.com'
xml:lang='en'

Okay. Suggest me how i can reconnect to the server so can get calls i'm not able to reconnect after internet connection failed.

@TatankaConCube
Copy link
Contributor

hello @himanshukh today we released the new version, which contains the fixes and improvements for the chat connection, please try it.

If the issue was resolved, please close this ticket.

@himanshukh
Copy link
Author

Hi @TatankaConCube Thanks for update.. Now it's working fine thanks.

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

No branches or pull requests

2 participants