Skip to content

IndexError in TableMapEvent #36

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

Closed
lxyu opened this issue Jun 6, 2013 · 13 comments
Closed

IndexError in TableMapEvent #36

lxyu opened this issue Jun 6, 2013 · 13 comments
Labels
Milestone

Comments

@lxyu
Copy link
Contributor

lxyu commented Jun 6, 2013

Traceback (most recent call last):
  File "/srv/virtualenvs/zeus/local/lib/python2.7/site-packages/pymysqlreplication/binlogstream.py", line 118, in fetchone
    self._ctl_connection)
  File "/srv/virtualenvs/zeus/local/lib/python2.7/site-packages/pymysqlreplication/packet.py", line 88, in __init__
    ctl_connection)
  File "/srv/virtualenvs/zeus/local/lib/python2.7/site-packages/pymysqlreplication/row_event.py", line 488, in __init__
    column_schema = self.column_schemas[i]
IndexError: tuple index out of range

More info:

>>> print column_types
['\x03', '\x03', '\x03', '\x0f', '\x0f', '\x03', '\x0c', '\x0c']
>>> print self.columns
[]
>>> print table_map
{}
>>> print self.column_schemas
()

And the self.packet.read_length_coded_binary() at L485 returns 4.

Put this line in the first line of TableMapEvent init shows this:

>>> print repr(self.packet.read(58))
'N\x01\x00\x00\x00\x00\x01\x00\x06sentry\x00\x19sentry_messagefiltervalue\x00\x08\x03\x03\x03\x0f\x0f\x03\x0c\x0c\x04`\x00X\x02\xe0'
@dvirsky
Copy link

dvirsky commented Jun 10, 2013

what caused this to happen? a rotation maybe?

@lxyu
Copy link
Contributor Author

lxyu commented Jun 14, 2013

I don't know what caused it, knows nothing more than the packet info pasted above.

It happened in our production server, very rare but it happened randomly. And I just bypass the table map event cause I don't really care about it.

@bjoernhaeuser
Copy link
Collaborator

The problem is probably that you try to create events for a table which is already dropped. Just figured out that I have the same problem. The application creates a table and after finishing the work it gets dropped. This module tries afterwards to decode the table data and fails, because it cannot read the information out of the information_schema.

I am currently thinking of a fix but haven't figured out a clean way, maybe @noplay can jump in

@bjoernhaeuser
Copy link
Collaborator

@julien-duponchelle
Copy link
Owner

You are right i'm not a big fan of your fix, but i didn't see a good way to do that.

@lxyu
Copy link
Contributor Author

lxyu commented Jul 28, 2013

@bjoernhaeuser my tmp fix is very like your fix.

refer to lxyu@a384964

I only add one line to skip it, though.

@bjoernhaeuser
Copy link
Collaborator

@noplay can we can up with a more elegant solution? What are your thoughts?

@julien-duponchelle
Copy link
Owner

No idea about a better way :( Perhaps we can merge and add an issue about that as a reminder.

@bjoernhaeuser
Copy link
Collaborator

I will come up with a pull request today.

@psypuff
Copy link

psypuff commented May 5, 2015

Hi, looks like this issue has been open for a while... 😁

We've recently got this similar exception on our production env:

Traceback (most recent call last):
  File "my_script.py", line 107, in <module>
    for binlogevent in stream:
  File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/binlogstream.py", line 244, in fetchone
    only_schemas = self.__only_schemas)
  File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/packet.py", line 94, in __init__
    only_schemas = only_schemas)
  File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/row_event.py", line 512, in __init__
    column_schema = self.column_schemas[i]
IndexError: tuple index out of range

I guess the issue is still open `cause there's no fix yet...
Is there any fix planned?

@julien-duponchelle
Copy link
Owner

@bjoernhaeuser @lxyu what did you think? I can add the fix you proposed if you didn't have another idea since.

@bjoernhaeuser
Copy link
Collaborator

@noplay No idea from me :-(

@julien-duponchelle
Copy link
Owner

0.6 has been released with the fix from @bjoernhaeuser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants