Modify

#1035 closed defect (fixed)

Connect to skyped fails with "Error while reading from server" / "global name 'done' is not defined"

Reported by: Jinn Ko <bitlbee@…> Owned by: Miklos Vajna
Priority: normal Milestone:
Component: Skype Version:
Keywords: skype Cc:
IRC client+version: Client-independent Operating System: MacOS
OS version/distro: OSX 10.8.2 x86_64

Description

The skype plugin fails to complete the connection to the skyped instance.

bitlbee is compiled from the bzr repo on OSX. skype4py is compiled from the latest git checkout on OSX.

skyped is running in 32bit mode to avoid the segfault on skype4py.attach().

arch -i386 python /usr/local/bin/skyped -c ~/.skyped/skyped.conf -n -d

skyped successfully connects to Skype and displays debug messages for events occurring within skype, such as ONLINESTATUS changes, etc.

When connecting from bitlbee the following messages appear:

14:25 user: acc skype on
14:25 root: skype - Logging in: Connecting
14:25 root: skype - Logging in: Connected to server, logging in
14:25 root: skype - Logging in: Logged in
14:25 root: skype - Error: Error while reading from server
14:25 root: skype - Signing off..
14:25 root: skype - Reconnecting in 5 seconds..

At the same time the following appears in skyped output:

2013-03-01 14:25:03: Username and password OK.
2013-03-01 14:25:03: >> SEARCH GROUPS CUSTOM
2013-03-01 14:25:03: << GROUPS 5....6, 5....4, 5....8, 4....4, 1....6, 4...0, 2...4, 2...2, 1...4, 1...2, 6..6, 6..6, 3..8, 2..6, 1..4, 9..
2013-03-01 14:25:03: Warning, sending 'GROUPS 5....6, 5....4, 5....8, 4....4, 1....6, 4...0, 2...4, 2...2, 1...4, 1...2, 6..6, 6..6, 3..8, 2..6, 1..4, 9..' failed (global name 'done' is not defined).
2013-03-01 14:25:03: Waiting for connection...

I do have a group chat with over 100 users, perhaps that could be an issue as I have seen other bugs filed relating to the user list being greater than 1024.

Attachments (0)

Change History (10)

comment:1 Changed at 2013-03-03T14:30:13Z by Miklos Vajna

Do you indeed have lines like "<< GROUPS 5....6, 5....4, 5....8" in the log, or you replaced sensitive data with dots?

comment:2 Changed at 2013-03-03T22:15:37Z by Jinn Ko <bitlbee@…>

I replaced the potentially sensitive data. They were complete numbers.

comment:3 Changed at 2013-03-06T19:59:08Z by Miklos Vajna

The problem is that the "Warning, sending '...' failed" message can be caused by multiple reasons.

Can you try this version:

https://raw.github.com/vmiklos/bitlbee/master/protocols/skype/skyped.py

And paste the same output? That should prefix lines with "skype.py:<number>", so there is a better chance to figure out what went wrong.

Thanks!

comment:4 Changed at 2013-03-07T10:45:24Z by Jinn Ko <bitlbee@…>

Here's the output, with <snip's /> where I've removed potentially sensitive data.

$ arch -i386 python /usr/local/bin/skyped -c ~/.skyped/skyped.conf -n -d
[2013-03-07 10:41:54] /usr/local/bin/skyped:492: Parsing config file '/Users/<snip/>/.skyped/skyped.conf' done, username is '<snip/>'.
[2013-03-07 10:41:54] /usr/local/bin/skyped:505: skyped is started on port 2727
[2013-03-07 10:41:55] /usr/local/bin/skyped:190: Waiting for connection...
[2013-03-07 10:42:26] /usr/local/bin/skyped:235: Username and password OK.
[2013-03-07 10:42:26] /usr/local/bin/skyped:372: >> SEARCH GROUPS CUSTOM
[2013-03-07 10:42:26] /usr/local/bin/skyped:348: << CONNSTATUS ONLINE
[2013-03-07 10:42:26] /usr/local/bin/skyped:352: Warning, sending 'CONNSTATUS ONLINE' failed (global name 'done' is not defined).
[2013-03-07 10:42:26] /usr/local/bin/skyped:356: -- CURRENTUSERHANDLE <snip/>
[2013-03-07 10:42:26] /usr/local/bin/skyped:356: -- USERSTATUS AWAY
[2013-03-07 10:42:27] /usr/local/bin/skyped:356: -- GROUPS <snip group numbers />
[2013-03-07 10:42:27] /usr/local/bin/skyped:190: Waiting for connection...

The output from bitlbee is:

10:42 root: skype - Logging in: Connecting
10:42 root: skype - Logging in: Connected to server, logging in
10:42 root: skype - Logging in: Logged in
10:42 root: skype - Error: Error while reading from server
10:42 root: skype - Signing off..

comment:5 Changed at 2013-03-07T11:10:31Z by Jinn Ko <bitlbee@…>

I believe part of the issue is the undefined "done" var used on line 153:"return done".

comment:6 Changed at 2013-03-07T11:15:13Z by Jinn Ko <bitlbee@…>

Looks like the following changes resolve the issue, not sure if they're exactly correct, but i looks like it works.

$ diff skyped.py /usr/local/bin/skyped
131c131
< 			sock.sendall(txt)
---
> 			done = sock.sendall(txt)
141c141
< 					 if options.conn: sock.sendall(txt)
---
> 					 if options.conn: done = sock.sendall(txt)

comment:7 Changed at 2013-03-07T11:46:10Z by Miklos Vajna

Ah, you probably don't have gobject's python binding installed. If that's the case, Philippe Crama added some code to make that work, but given I have gobject installed, it gets minimal testing from me. :-)

Could you please run 'diff -u', not 'diff'? That makes it easier to review your changes.

Thanks!

comment:8 Changed at 2013-03-07T11:47:49Z by Jinn Ko <bitlbee@…>

$ diff -u skyped.py /usr/local/bin/skyped
--- skyped.py	2013-03-07 11:14:06.000000000 +0000
+++ /usr/local/bin/skyped	2013-03-07 11:13:08.000000000 +0000
@@ -128,7 +128,7 @@
 	if hasgobject:
 		if not options.conn: return
 		try:
-			sock.sendall(txt)
+			done = sock.sendall(txt)
 		except socket.error as s:
 			dprint("Warning, sending '%s' failed (%s)." % (txt, s))
 			options.conn.close()
@@ -138,7 +138,7 @@
 			if not options.conn: break
 			if wait_for_lock(options.lock, 3, 10, "socket send"):
 				try:
-					 if options.conn: sock.sendall(txt)
+					 if options.conn: done = sock.sendall(txt)
 					 options.lock.release()
 				except socket.error as s:
 					options.lock.release()

comment:9 Changed at 2013-03-07T15:47:03Z by Miklos Vajna

Status: newaccepted

Thanks, that looks fine. I just commited it to my local branch, I'll close the ticket when the commit hit the bzr repo.

comment:10 Changed at 2013-03-24T20:38:02Z by Miklos Vajna

Resolution: fixed
Status: acceptedclosed

Fixed in r978.1.5.

Modify Ticket

Action
as closed The owner will remain Miklos Vajna.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.