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

skypeweb reconnects in endless loop #287

Closed
powerman opened this issue Jul 4, 2015 · 18 comments

Comments

Projects
None yet
3 participants
@powerman
Copy link

commented Jul 4, 2015

I'm using latest (9dcb0c1) with pidgin-2.10.11 on Gentoo Linux.

Sometimes Skypeweb stop working while visually nothing changes - it appears to be "online", all contacts looks online too, but messages doesn't send/received. I'm usually noticing this by unusually high pidgin disk I/O activity, and strace shows pidgin every couple of seconds overwrite ~/.purple/certificates/x509/tls_peers/db3-client-s.gateway.messenger.live.com. Pidgin's Debug Window shows this message every 2 second:

(09:30:32) gnutls: Received a FIN on the TCP socket for db3-client-s.gateway.messenger.live.com. This either means that the remote server closed the socket without sending us a Close Notify alert or a man-in-the-middle injected a FIN into the TCP stream. Assuming it's the former.

Here is full output for one of such 2-second period with all loglevels enabled:

(09:31:20) skypeweb: getting url /v1/users/ME/endpoints/SELF/subscriptions/0/poll
(09:31:20) skypeweb: sending headers:
POST /v1/users/ME/endpoints/SELF/subscriptions/0/poll HTTP/1.0
Host: db3-client-s.gateway.messenger.live.com
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-length: 0
RegistrationToken: registrationToken=U2lnbmF0dXJlO…(I've cut it)
Referer: https://web.skype.com/main
Accept: application/json; ver=1.0;
ClientInfo: os=Windows; osVer=8.1; proc=Win32; lcid=en-us; deviceType=1; country=n/a; clientName=swx-skype.com; clientVer=908/1.5.108
Accept-Encoding: gzip
Accept-Language: C, C


(09:31:20) dnsquery: Performing DNS lookup for db3-client-s.gateway.messenger.live.com
(09:31:20) dns: Successfully sent DNS request to child 6731
(09:31:20) dns: Got response for 'db3-client-s.gateway.messenger.live.com'
(09:31:20) dnsquery: IP resolved for db3-client-s.gateway.messenger.live.com
(09:31:20) proxy: Attempting connection to 157.56.122.78
(09:31:20) proxy: Connecting to db3-client-s.gateway.messenger.live.com:443 with no proxy
(09:31:20) proxy: Connection in progress
(09:31:20) proxy: Connecting to db3-client-s.gateway.messenger.live.com:443.
(09:31:20) proxy: Connected to db3-client-s.gateway.messenger.live.com:443.
(09:31:20) gnutls: Starting handshake with db3-client-s.gateway.messenger.live.com
(09:31:20) gnutls: Handshake complete
(09:31:20) gnutls/x509: Key print: d8:37:ed:b4:17:7f:15:af:ba:4e:f3:6e:0d:9f:28:0a:cb:01:87:52
(09:31:20) gnutls/x509: Key print: ef:86:b4:13:f0:fc:25:ac:51:2b:8b:e9:b6:ec:70:f6:da:34:16:55
(09:31:20) gnutls/x509: Key print: 99:2a:d4:4d:7d:ce:29:8d:e1:7e:6f:2f:56:a7:b9:ca:a4:1d:b9:3f
(09:31:20) gnutls: Peer provided 3 certs
(09:31:20) gnutls: Lvl 0 SHA1 fingerprint: d8:37:ed:b4:17:7f:15:af:ba:4e:f3:6e:0d:9f:28:0a:cb:01:87:52
(09:31:20) gnutls: Serial: 18:95:02:9f:00:01:00:00:a9:cf
(09:31:20) gnutls: Cert DN: CN=api.chat.skype.net
(09:31:20) gnutls: Cert Issuer DN: DC=com,DC=microsoft,DC=corp,DC=redmond,CN=MSIT Machine Auth CA 2
(09:31:20) gnutls: Lvl 1 SHA1 fingerprint: ef:86:b4:13:f0:fc:25:ac:51:2b:8b:e9:b6:ec:70:f6:da:34:16:55
(09:31:20) gnutls: Serial: 61:5d:aa:d2:00:06:00:00:00:40
(09:31:20) gnutls: Cert DN: DC=com,DC=microsoft,DC=corp,DC=redmond,CN=MSIT Machine Auth CA 2
(09:31:20) gnutls: Cert Issuer DN: CN=Microsoft Internet Authority
(09:31:20) gnutls: Lvl 2 SHA1 fingerprint: 99:2a:d4:4d:7d:ce:29:8d:e1:7e:6f:2f:56:a7:b9:ca:a4:1d:b9:3f
(09:31:20) gnutls: Serial: 07:27:6f:ae
(09:31:20) gnutls: Cert DN: CN=Microsoft Internet Authority
(09:31:20) gnutls: Cert Issuer DN: C=IE,O=Baltimore,OU=CyberTrust,CN=Baltimore CyberTrust Root
(09:31:20) certificate/x509/tls_cached: Starting verify for db3-client-s.gateway.messenger.live.com
(09:31:20) certificate/x509/tls_cached: Checking for cached cert...
(09:31:20) certificate/x509/tls_cached: ...Found cached cert
(09:31:20) gnutls: Attempting to load X.509 certificate from /home/powerman/.purple/certificates/x509/tls_peers/db3-client-s.gateway.messenger.live.com
(09:31:20) certificate/x509/tls_cached: Peer cert matched cached
(09:31:20) util: Writing file /home/powerman/.purple/certificates/x509/tls_peers/db3-client-s.gateway.messenger.live.com
(09:31:20) certificate: Successfully verified certificate for db3-client-s.gateway.messenger.live.com
(09:31:20) skypeweb: post_or_get_ssl_connect_cb
(09:31:20) gnutls: Received a FIN on the TCP socket for db3-client-s.gateway.messenger.live.com. This either means that the remote server closed the socket without sending us a Close Notify alert or a man-in-the-middle injected a FIN into the TCP stream. Assuming it's the former.
(09:31:20) skypeweb: No data in response

After disabling/enabling skypeweb account to force full reconnection I may get few outdated skype messages (sent several hours ago which I didn't received before).

@vitalyster

This comment has been minimized.

Copy link
Contributor

commented Jul 4, 2015

Looks like the same as #258

@EionRobb

This comment has been minimized.

Copy link
Owner

commented Jul 4, 2015

"no data in response" is a valid response from the server, but to receive it every two seconds is not right.

Ideally, uncommenting the response debug line in skype_connection.c would be really helpful to see what the full server response is, maybe we can pick up on that to relogin or wherever the server is trying to tell us to do.

@vitalyster

This comment has been minimized.

Copy link
Contributor

commented Jul 4, 2015

what exactly need to uncomment? I will get a try

@EionRobb

This comment has been minimized.

Copy link
Owner

commented Jul 5, 2015

At approx line 242 of skypeweb_connection.c, uncomment the "got response" line, so that it'll dump out all the response from the server.

@powerman

This comment has been minimized.

Copy link
Author

commented Jul 5, 2015

This line isn't commented in revision I mention in first comment. According to the line:

(09:31:20) skypeweb: No data in response

control flow doesn't enter into this branch of parent's if.

@EionRobb

This comment has been minimized.

Copy link
Owner

commented Jul 5, 2015

Ah, that'll teach me for trying to look at code on a mobile device :)

Maybe if you could output skypewebcon->rx_buf (which should be the headers) before that 'no data in response' line?

@powerman

This comment has been minimized.

Copy link
Author

commented Jul 5, 2015

It set to NULL few lines before that if, so it's too late to output it right before 'no data in response'. If you wanna see it content right before setting it to NULL please give me a code snippet to insert there.

@EionRobb

This comment has been minimized.

Copy link
Owner

commented Jul 13, 2015

Any luck trying out the commit to get more debug info?

@powerman

This comment has been minimized.

Copy link
Author

commented Jul 13, 2015

Yeah, this is what happens right now every 2 seconds:

(15:37:34) skypeweb: getting url /v1/users/ME/endpoints/SELF/subscriptions/0/poll
(15:37:34) skypeweb: sending headers:
POST /v1/users/ME/endpoints/SELF/subscriptions/0/poll HTTP/1.0
Host: db3-client-s.gateway.messenger.live.com
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-length: 0
RegistrationToken: registrationToken=U2lnbm...(cut)...
Referer: https://web.skype.com/main
Accept: application/json; ver=1.0;
ClientInfo: os=Windows; osVer=8.1; proc=Win32; lcid=en-us; deviceType=1; country=n/a; clientName=swx-skype.com; clientVer=908/1.5.108
Accept-Encoding: gzip
Accept-Language: C, C


(15:37:34) dnsquery: Performing DNS lookup for db3-client-s.gateway.messenger.live.com
(15:37:34) dns: Successfully sent DNS request to child 31134
(15:37:34) dns: Got response for 'db3-client-s.gateway.messenger.live.com'
(15:37:34) dnsquery: IP resolved for db3-client-s.gateway.messenger.live.com
(15:37:34) proxy: Attempting connection to 157.56.122.78
(15:37:34) proxy: Connecting to db3-client-s.gateway.messenger.live.com:443 with no proxy
(15:37:34) proxy: Connection in progress
(15:37:34) proxy: Connecting to db3-client-s.gateway.messenger.live.com:443.
(15:37:34) proxy: Connected to db3-client-s.gateway.messenger.live.com:443.
(15:37:34) gnutls: Starting handshake with db3-client-s.gateway.messenger.live.com
(15:37:35) gnutls: Handshake complete
(15:37:35) gnutls/x509: Key print: d8:37:...(cut)...
(15:37:35) gnutls/x509: Key print: ef:86:...(cut)...
(15:37:35) gnutls/x509: Key print: 99:2a:...(cut)...
(15:37:35) gnutls: Peer provided 3 certs
(15:37:35) gnutls: Lvl 0 SHA1 fingerprint: d8:37:...(cut)...
(15:37:35) gnutls: Serial: 18:95:...(cut)...
(15:37:35) gnutls: Cert DN: CN=api.chat.skype.net
(15:37:35) gnutls: Cert Issuer DN: DC=com,DC=microsoft,DC=corp,DC=redmond,CN=MSIT Machine Auth CA 2
(15:37:35) gnutls: Lvl 1 SHA1 fingerprint: ef:86:...(cut)...
(15:37:35) gnutls: Serial: 61:5d:...(cut)...
(15:37:35) gnutls: Cert DN: DC=com,DC=microsoft,DC=corp,DC=redmond,CN=MSIT Machine Auth CA 2
(15:37:35) gnutls: Cert Issuer DN: CN=Microsoft Internet Authority
(15:37:35) gnutls: Lvl 2 SHA1 fingerprint: 99:2a:...(cut)...
(15:37:35) gnutls: Serial: 07:27:...(cut)...
(15:37:35) gnutls: Cert DN: CN=Microsoft Internet Authority
(15:37:35) gnutls: Cert Issuer DN: C=IE,O=Baltimore,OU=CyberTrust,CN=Baltimore CyberTrust Root
(15:37:35) certificate/x509/tls_cached: Starting verify for db3-client-s.gateway.messenger.live.com
(15:37:35) certificate/x509/tls_cached: Checking for cached cert...
(15:37:35) certificate/x509/tls_cached: ...Found cached cert
(15:37:35) gnutls: Attempting to load X.509 certificate from /home/powerman/.purple/certificates/x509/tls_peers/db3-client-s.gateway.messenger.live.com
(15:37:35) certificate/x509/tls_cached: Peer cert matched cached
(15:37:35) util: Writing file /home/powerman/.purple/certificates/x509/tls_peers/db3-client-s.gateway.messenger.live.com
(15:37:35) certificate: Successfully verified certificate for db3-client-s.gateway.messenger.live.com
(15:37:35) skypeweb: post_or_get_ssl_connect_cb
(15:37:35) gnutls: Received a FIN on the TCP socket for db3-client-s.gateway.messenger.live.com. This either means that the remote server closed the socket without sending us a Close Notify alert or a man-in-the-middle injected a FIN into the TCP stream. Assuming it's the former.
(15:37:35) skypeweb: Got response: HTTP/1.1 403 The provided registration token is expired, and no authentication ticket was provided.
Cache-Control: no-store, must-revalidate, no-cache
Keep-Alive: true
Pragma: no-cache
Content-Length: 0
ContextId: tcid=2528710491233744343,server=DB3MSGR5011002
Date: Mon, 13 Jul 2015 12:37:34 GMT
Connection: close


(15:37:35) skypeweb: No data in response
@EionRobb

This comment has been minimized.

Copy link
Owner

commented Jul 13, 2015

Aha "HTTP/1.1 403 The provided registration token is expired, and no
authentication ticket was provided." Is the useful bit from that

Should hopefully be able to handle that in the Plugin :)
On 14/07/2015 00:42, "Alex Efros" notifications@github.com wrote:

Yeah, this is what happens right now every 2 seconds:

(15:37:34) skypeweb: getting url /v1/users/ME/endpoints/SELF/subscriptions/0/poll
(15:37:34) skypeweb: sending headers:
POST /v1/users/ME/endpoints/SELF/subscriptions/0/poll HTTP/1.0
Host: db3-client-s.gateway.messenger.live.com
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-length: 0
RegistrationToken: registrationToken=U2lnbm...(cut)...
Referer: https://web.skype.com/main
Accept: application/json; ver=1.0;
ClientInfo: os=Windows; osVer=8.1; proc=Win32; lcid=en-us; deviceType=1; country=n/a; clientName=swx-skype.com; clientVer=908/1.5.108
Accept-Encoding: gzip
Accept-Language: C, C

(15:37:34) dnsquery: Performing DNS lookup for db3-client-s.gateway.messenger.live.com
(15:37:34) dns: Successfully sent DNS request to child 31134
(15:37:34) dns: Got response for 'db3-client-s.gateway.messenger.live.com'
(15:37:34) dnsquery: IP resolved for db3-client-s.gateway.messenger.live.com
(15:37:34) proxy: Attempting connection to 157.56.122.78
(15:37:34) proxy: Connecting to db3-client-s.gateway.messenger.live.com:443 with no proxy
(15:37:34) proxy: Connection in progress
(15:37:34) proxy: Connecting to db3-client-s.gateway.messenger.live.com:443.
(15:37:34) proxy: Connected to db3-client-s.gateway.messenger.live.com:443.
(15:37:34) gnutls: Starting handshake with db3-client-s.gateway.messenger.live.com
(15:37:35) gnutls: Handshake complete
(15:37:35) gnutls/x509: Key print: d8:37:...(cut)...
(15:37:35) gnutls/x509: Key print: ef:86:...(cut)...
(15:37:35) gnutls/x509: Key print: 99:2a:...(cut)...
(15:37:35) gnutls: Peer provided 3 certs
(15:37:35) gnutls: Lvl 0 SHA1 fingerprint: d8:37:...(cut)...
(15:37:35) gnutls: Serial: 18:95:...(cut)...
(15:37:35) gnutls: Cert DN: CN=api.chat.skype.net
(15:37:35) gnutls: Cert Issuer DN: DC=com,DC=microsoft,DC=corp,DC=redmond,CN=MSIT Machine Auth CA 2
(15:37:35) gnutls: Lvl 1 SHA1 fingerprint: ef:86:...(cut)...
(15:37:35) gnutls: Serial: 61:5d:...(cut)...
(15:37:35) gnutls: Cert DN: DC=com,DC=microsoft,DC=corp,DC=redmond,CN=MSIT Machine Auth CA 2
(15:37:35) gnutls: Cert Issuer DN: CN=Microsoft Internet Authority
(15:37:35) gnutls: Lvl 2 SHA1 fingerprint: 99:2a:...(cut)...
(15:37:35) gnutls: Serial: 07:27:...(cut)...
(15:37:35) gnutls: Cert DN: CN=Microsoft Internet Authority
(15:37:35) gnutls: Cert Issuer DN: C=IE,O=Baltimore,OU=CyberTrust,CN=Baltimore CyberTrust Root
(15:37:35) certificate/x509/tls_cached: Starting verify for db3-client-s.gateway.messenger.live.com
(15:37:35) certificate/x509/tls_cached: Checking for cached cert...
(15:37:35) certificate/x509/tls_cached: ...Found cached cert
(15:37:35) gnutls: Attempting to load X.509 certificate from /home/powerman/.purple/certificates/x509/tls_peers/db3-client-s.gateway.messenger.live.com
(15:37:35) certificate/x509/tls_cached: Peer cert matched cached
(15:37:35) util: Writing file /home/powerman/.purple/certificates/x509/tls_peers/db3-client-s.gateway.messenger.live.com
(15:37:35) certificate: Successfully verified certificate for db3-client-s.gateway.messenger.live.com
(15:37:35) skypeweb: post_or_get_ssl_connect_cb
(15:37:35) gnutls: Received a FIN on the TCP socket for db3-client-s.gateway.messenger.live.com. This either means that the remote server closed the socket without sending us a Close Notify alert or a man-in-the-middle injected a FIN into the TCP stream. Assuming it's the former.
(15:37:35) skypeweb: Got response: HTTP/1.1 403 The provided registration token is expired, and no authentication ticket was provided.
Cache-Control: no-store, must-revalidate, no-cache
Keep-Alive: true
Pragma: no-cache
Content-Length: 0
ContextId: tcid=2528710491233744343,server=DB3MSGR5011002
Date: Mon, 13 Jul 2015 12:37:34 GMT
Connection: close

(15:37:35) skypeweb: No data in response


Reply to this email directly or view it on GitHub
#287 (comment)
.

@powerman

This comment has been minimized.

Copy link
Author

commented Jul 14, 2015

I've updated to latest few hours ago, and I've just got pigdin's dialog "Failed to get registration token" or something like that. After clicking "Re-enable account" about 4 times it was successfully connected. I suppose this dialog is result of your attempt to handle this 403 error. In this case you probably should try several times to reconnect automatically with a couple of seconds delay, and only if all attempts fail show this dialog - otherwise account may became disconnected for a long time until user noticed.

@powerman

This comment has been minimized.

Copy link
Author

commented Jul 21, 2015

Well, it's not fixed yet. I'm now using latest (288e6ba) and have this in debug window every second:

...
(15:58:15) util: Writing file /home/powerman/.purple/certificates/x509/tls_peers/db3-client-s.gateway.messenger.live.com
(15:58:15) certificate: Successfully verified certificate for db3-client-s.gateway.messenger.live.com
(15:58:15) skypeweb: post_or_get_ssl_connect_cb
(15:58:15) gnutls: Received a FIN on the TCP socket for db3-client-s.gateway.messenger.live.com. This either means that the remote server closed the socket without sending us a Close Notify alert or a man-in-the-middle injected a FIN into the TCP stream. Assuming it's the former.
(15:58:15) skypeweb: Got response: HTTP/1.1 403 The provided registration token is expired, and no authentication ticket was provided.
Cache-Control: no-store, must-revalidate, no-cache
Keep-Alive: true
Pragma: no-cache
Content-Length: 0
ContextId: tcid=2900.....,server=DB3MS.....
Date: Tue, 21 Jul 2015 12:58:14 GMT
Connection: close


(15:58:15) skypeweb: No data in response
@EionRobb

This comment has been minimized.

Copy link
Owner

commented Jul 23, 2015

Ok, just committed what might be a fix: listen to when the server tells us that the token will expire and reconnect if we get a blank response after that time. Feedback welcome :)

@vitalyster

This comment has been minimized.

Copy link
Contributor

commented Jul 29, 2015

Standing online for a week without problems, great!

@powerman

This comment has been minimized.

Copy link
Author

commented Aug 4, 2015

Yeah, looks like main issue was resolved. But now there is a new one: a couple of times per day skypeweb gets disabled with error "Failed getting Registration Token" (I believe I've also seen some other error message, but don't remember it's text) and require me to manually click on "Re-enable" account. Re-enable always works, so it looks like some timeouts between re-login attempts should be increased, and/or amount of these attempts.

@vitalyster

This comment has been minimized.

Copy link
Contributor

commented Aug 4, 2015

'HTTP/1.1 401 The provided 'skypetoken' ticket failed authentication.

@EionRobb

This comment has been minimized.

Copy link
Owner

commented Dec 16, 2015

The original issue was fixed, going to close this issue. Please open new issues for new problems :)

@EionRobb EionRobb closed this Dec 16, 2015

@vitalyster

This comment has been minimized.

Copy link
Contributor

commented Dec 16, 2015

Maybe "Failed getting Registration Token" was added in debug purpose and it needs to be removed and silently reconnect when token expired?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.