rodrigogs / mysql-events

A node package that watches a MySQL database and runs callbacks on matched events.
BSD 3-Clause "New" or "Revised" License
136 stars 52 forks source link

Cannot read property 'COLUMN_NAME' of undefined #4

Closed houyanchao closed 5 years ago

houyanchao commented 5 years ago

After starting the monitoring, I will encounter this error in about half a day, and I have encountered it many times.

wx20181023-115543

rodrigogs commented 5 years ago

It could happen when your binlog has event data from an already deleted column or schema. We can debug it together if you need to.

houyanchao commented 5 years ago

We can debug it together

There is another question,i did not listen to the table ha_health_check and always trigger ZONGJI_ERROR

image

image

rodrigogs commented 5 years ago

To filter your triggers we have to read every event from the binlogs. So, if there is some inconsistency there, it should throw errors.

houyanchao commented 5 years ago

How should we solve the problem of "Cannot read property 'COLUMN_NAME' of undefined"?

rodrigogs commented 5 years ago

If it's only logging this error, you could just ignore it.

houyanchao commented 5 years ago

When this error occurs, the listener will stop and it will not be monitored by subsequent changes to the data table. This affects business logic

rodrigogs commented 5 years ago

I'll check it as soon as I can. If you find the problem, a PR is also very welcome :)

rodrigogs commented 5 years ago

Problem is right here: https://github.com/rodrigogs/zongji/blame/5e313b3947891e404dc3b5dcc8e469efb9ad1997/lib/binlog_event.js#L195

I have no database configured to test it now, and it's 01:00 AM here hahaha

I'll try to have a look at it tomorrow. For sure we will solve this ;)

houyanchao commented 5 years ago

Hahahaha, I am here during the day. Thank you very much.

rodrigogs commented 5 years ago

Sorry @houyanchao, this issue is here for a long time. I've been quite busy and I don't have time to debug and fix it right now. I'll try to fix this as soon as possible.

taieb-tk commented 2 years ago

Is this solved? I seem to have the same problem..