Probably avoidable (unclear) IndexError when connecting.

Bug #528449 reported by tormen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Connector/Python
New
Undecided
Unassigned

Bug Description

I am not sure what exactly causes the below problem, but I can pretty good predict /when/ it will happen:

I open a ssh tunnel to the mysql server and use this in the ~/.ssh/config:
    LocalForward 10101 127.0.0.1:3306
I open a db connection with python to 127.0.0.1 port 10101.
I put my notebook to standby <<< here I am not sure if the above connection is still open or already closed.
The next morning I power on the notebook the ssh connection still sits there but timed out.
If I now try to connect with python to 127.0.0.1 port 10101 I get the below traceback.
If I then reestablish the ssh tunnel everything works fine.

But if I try to connect to 127.0.0.1 port 10101 with no ssh tunnel established, I get a nice and clean:
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on '127.0.0.1:10101' (111)

Traceback (most recent call last):
  File "/home/cypra/Desktop/dev/api/api/cypra/src/cypra/dl/db/user/session.py", line 7, in <module>
    import cypra.dl.db as db
  File "/home/cypra/Desktop/dev/api/api/cypra/src/cypra/dl/db/__init__.py", line 6, in <module>
    import cypra.dblogger as log
  File "/home/cypra/Desktop/dev/api/api/cypra/src/cypra/dblogger.py", line 13, in <module>
    __LOG_DB_CONN__ = db.connect(**config.SYSTEMDBPARAMS)
  File "/usr/lib/python3.1/site-packages/mysql/connector/__init__.py", line 45, in Connect
    return MySQL(*args, **kwargs)
  File "/usr/lib/python3.1/site-packages/mysql/connector/mysql.py", line 317, in __init__
    self.connect(*args, **kwargs)
  File "/usr/lib/python3.1/site-packages/mysql/connector/mysql.py", line 418, in connect
    self._open_connection()
  File "/usr/lib/python3.1/site-packages/mysql/connector/mysql.py", line 91, in _open_connection
    self.conn.open_connection()
  File "/usr/lib/python3.1/site-packages/mysql/connector/connection.py", line 163, in open_connection
    buf = self.recv()[0]
  File "/usr/lib/python3.1/site-packages/mysql/connector/connection.py", line 82, in recv
    (pktsize, pktnr) = self.protocol.handle_header(header)
  File "/usr/lib/python3.1/site-packages/mysql/connector/protocol.py", line 61, in handle_header
    pktnr = utils.int1read(buf[3])
IndexError: index out of range

Any idea what causes this?

Revision history for this message
tormen (quickhelp) wrote :

Sorry this is a duplicate of Bug #528451.

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.