unittest not working, InterfaceError: 1156 (08S01): Got packets out of order

Bug #380528 reported by fanda
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MySQL Connector/Python
Fix Released
Medium
Geert JM Vanderkelen
Fedora
Fix Released
Medium

Bug Description

fanda@teckaNB:~/py/mysqlconnectorpy/main$ ./unittests.py
/mnt/sda7/fanda/py/mysqlconnectorpy/main/mysql/connector/protocol.py:21: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import string, sha, socket, re
EEEEE.F.EEEEEEEEEEEEEEEE....................EEEEEEEEEEE.............
======================================================================
ERROR: Inserts and retrives a latin1 string.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./unittests.py", line 588, in setUp
    self.db = mysql.MySQL(**MYSQL_CONFIG)
  File "/mnt/sda7/fanda/py/mysqlconnectorpy/main/mysql/connector/mysql.py", line 270, in __init__
    self.connect(*args, **kwargs)
  File "/mnt/sda7/fanda/py/mysqlconnectorpy/main/mysql/connector/mysql.py", line 351, in connect
    self._open_connection()
  File "/mnt/sda7/fanda/py/mysqlconnectorpy/main/mysql/connector/mysql.py", line 92, in _open_connection
    database=self.database)
  File "/mnt/sda7/fanda/py/mysqlconnectorpy/main/mysql/connector/protocol.py", line 86, in do_auth
    self.cmd_init_db(database)
  File "/mnt/sda7/fanda/py/mysqlconnectorpy/main/mysql/connector/protocol.py", line 334, in cmd_init_db
    self.conn.recv()[0]
  File "/mnt/sda7/fanda/py/mysqlconnectorpy/main/mysql/connector/connection.py", line 68, in recv
    self.protocol.is_error(buf)
  File "/mnt/sda7/fanda/py/mysqlconnectorpy/main/mysql/connector/protocol.py", line 142, in is_error
    self._handle_error(buf)
  File "/mnt/sda7/fanda/py/mysqlconnectorpy/main/mysql/connector/protocol.py", line 132, in _handle_error
    raise InterfaceError(err)
InterfaceError: 1156 (08S01): Got packets out of order

Related branches

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

Thanks for this report!

1) Which MySQL and Python versions?
2) Can you run the ./newunits.py? I'm moving gradually everything in new tests.

Cheers,

Geert

tags: added: tests
Changed in myconnpy:
assignee: nobody → Geert JM Vanderkelen (geertjmvdk)
Revision history for this message
fanda (fanda-vacek) wrote :

Connected to MySQL server 5.1.31-1ubuntu2 Localhost via UNIX socket
Current client: 5.1.31

Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
[GCC 4.3.3] on linux2

output of newunits.py is attached

cheers

Fanda

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

Please update MySQL Connector/Python branch you are using. The DeprecationWarning should not happen with a recent pull, so this looks old code.

Changed in myconnpy:
status: New → Incomplete
Revision history for this message
Alex L (alexl-users) wrote :

There seems to be the same issue with mythbox, which uses myconnpy on Fedora 11 with MySQL 5.1.37, get these errors:

"1156 (08S01): Got packets out of order"

More details on this bug:

http://code.google.com/p/mythbox/issues/detail?id=72

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

Alex,
2 interesting things htere:

a) Mythbox using MySQL Connector/Python already? Or just testing? :)

b) The packet numbers are indeed out of order:
..
MySQL Protocol
    Packet Length: 1
    Packet Number: 2
    EOF marker (254)
..
MySQL Protocol
    Packet Length: 12
    Packet Number: 0
    Command
        Command: Use Database (2)
        Schema: mythconverg

I think I know where to look for fixing that, thanks for that!

Changed in myconnpy:
status: Incomplete → New
Revision history for this message
Alex L (alexl-users) wrote :

a) mythbox is now actively using myconnpy in the script for public download, there's no other fallback way to access the MySQL mythtv database as far as I'm aware.

b) Glad to hear this helped you make some progress. Have you now managed to get the bottom of this, or manage to fix this in SVN? I'd be happy to help out by testing any patch that you make. mythbox distributes a local copy of the myconnpy code, which I have now switched to using the SVN version.

Revision history for this message
Alex L (alexl-users) wrote :

For what it's worth, I"m adding the output of the unittests.py script using the latest bzr version (sorry not SVN as I mistakenly said in my last comment).

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

@Alex L

Thanks for the output if the unittests. The two errors happening there are a different problem. One probably solved with
  ./unittests.py -uroot

Maybe I should download Fedora, as there seems to be problems there, which I find very odd.

(Still have to find time to reproduce and fix..)

Cheers,
Geert

Changed in myconnpy:
milestone: none → 0.1.0
Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

The problem is that after the Authentication, there should be an OK-Packet, but in both PHP and MyConnPy, in the dumps given, there is an EOF-Packet.
I haven't found a way to reproduce this.

However, I have put in an exception to handle EOF-Packet, as I'm considering this wrong. But, I'll have a chat with my colleagues from PHP about this.

Changed in myconnpy:
status: New → In Progress
Revision history for this message
Alex L (alexl-users) wrote :

Have you installed Fedora 11 (or 11) and tried running XBMC with the MythBox script? I'm sure you could reproduce it that way... :)

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

Hey Alex,

Fedora 11 .. or ?? Would it work on 10 or 12 as well to reproduce?
I don't have Fedora (stopped with it after 2 or 3 :-)) And downloading.. well, no broadband and traffic limited.

Still wondering what this is.. and checking if we can find somebody within MySQL/Sun to reproduce this. This EOF should, IMHO, not be there. Also not in PHP. But I could be wrong of course..

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

OK, found it! I hope! :)
Probably another case of using the old passwords.

Please confirm that you're using --old-password in the MySQL option file.

If you do, then I'm afraid you got a "broken" MySQL installation. We will not support old passwords in MySQL Connector/Python. You need to fix the passwords of your users and get rid of the --old-passwords.

I hope that's it!

I'm leaving the exception in place and give a better error message.

Revision history for this message
Markus Dobel (markus-dobel) wrote :

Hi,

I reported the bug with mythbox, and hence follow the ticket here, too.

I can confirm, that there was old_password=1 in /etc/my.cnf, which seems to be there by distribution default. I thought I switched that off, but obviously did not. After setting this option to 0 and re-setting the password, mythbox can connect to MySQL. Thanks for the heads-up.

Regards, Markus

Revision history for this message
Alex L (alexl-users) wrote :

Thanks! I can confirm that this works. Hopefully @analogue can add this as Q15 in the MythBox FAQ.

I'll look into it and see if old_password=1 still needs to be set for other packages in Fedora, and if not, open a bug.

Revision history for this message
In , Alex (alex-redhat-bugs) wrote :

Are there still apps using mysql 3.x on F-12 and newer? If not, could we possibly change the old_passwords options in /etc/my.cnf to be set to:

old_passwords=0

This causes problems for newer apps such as MythBox, see:

https://bugs.launchpad.net/myconnpy/+bug/380528

Revision history for this message
Alex L (alexl-users) wrote :

Reported https://bugzilla.redhat.com/show_bug.cgi?id=540735 against mysql package in Fedora

Changed in fedora:
importance: Undecided → Unknown
status: New → Unknown
Revision history for this message
Alex L (alexl-users) wrote :

Re comment #11 I meant to say "Fedora 11 (or 12)" not "Fedora 11 (or 11)".

Changed in fedora:
status: Unknown → Confirmed
Revision history for this message
In , Tom (tom-redhat-bugs) wrote :

Hm ... AFAIK there are no plans to support mysql 3.23 clients in RHEL6, and even if someone insists on that there seems no need to support it by default. So yeah, we could take that out now.

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

OK, this is great. The fix in rev142: an exception is raised when we receive an EOF after Authentication, saying:

 raise errors.InterfaceError("Found EOF after Auth, expecting OK. Using old passwords?")

That should give enough clues to the programmer.

Note that changing --old-password option might break lots of applications, but at one point this is going to be necessary. Most connectors don't support it anymore. The option was there to give time to upgrade.. since 4.1. We are not at 5.1. It's time to move one :)

Changed in myconnpy:
status: In Progress → Fix Committed
importance: Undecided → Medium
tags: added: compat protocol
removed: tests
Changed in fedora:
status: Confirmed → In Progress
Changed in myconnpy:
status: Fix Committed → Fix Released
Revision history for this message
In , Tom (tom-redhat-bugs) wrote :

Done in current builds, but I forgot to close this bug :-(

Revision history for this message
In , Alex (alex-redhat-bugs) wrote :

(In reply to comment #2)
> Done in current builds, but I forgot to close this bug :-(

What about F-11 and F-12? I don't see this change there as yet, are there pending updates? If so, you should add this bug to the bodhi update and let the update system close them.

Revision history for this message
In , Alex (alex-redhat-bugs) wrote :
Revision history for this message
In , Tom (tom-redhat-bugs) wrote :

I have no intention of trying to force such a change on existing installations. The only thing I did was to remove the setting from the default my.cnf for future installations. It's debatable whether there is much point in doing that in the F-11 or F-12 branches.

Revision history for this message
Dustin Wyatt (dustin-wyatt) wrote :

Downloaded 0.1.3 today. Attempts to run the unittests accessing MySQL remotely on Dreamhost result in tons of:

Found EOF after Auth, expecting OK. Using old passwords?

The thing is, they tell me they're not using --old-passwords.

Attached are the results of the unittests...

Revision history for this message
Dustin Wyatt (dustin-wyatt) wrote :

Disregard my last comment. Dreamhost now tells me they actually are using old-passwords.

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

Dustin,
Thanks for getting that information from Dreamhost. Good to know the Error message gives a useful hint :)

Changed in fedora:
importance: Unknown → Medium
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.