mchehab/rasdaemon

DBD::SQLite::db prepare failed

satishdotpatel opened this issue · 6 comments

How do i fix this issue?

Package version rasdaemon 0.6.5-1ubuntu1.1

# ras-mc-ctl --summary
No Memory errors.

No PCIe AER errors.

No Extlog errors.

DBD::SQLite::db prepare failed: no such table: devlink_event at /usr/sbin/ras-mc-ctl line 1181.
Can't call method "execute" on an undefined value at /usr/sbin/ras-mc-ctl line 1182.

I get a similar error in rasdaemon v0.6.7 on Fedora 35 with different lines referenced:

$ ras-mc-ctl --errors
No Memory errors.

DBD::SQLite::db prepare failed: no such column: dev_name at /usr/sbin/ras-mc-ctl line 1350.
Can't call method "execute" on an undefined value at /usr/sbin/ras-mc-ctl line 1351.

Other mentions of this type of error:
#53
#30

Did you upgrade your systems or rasdaemon? It sounds to me that it is using an outdated mysql database. Yeah, we probably need to add some feature at rasdaemon for it to update the database in case of changes between two versions.

Do you mean SQLite? I don't see any references to MySQL in rasdaemon.
I got this error, and I just installed rasdaemon (on Debian 11) for the first time today. Apart from deleting the database file on purge, I don't see anything in the Debian source which has anything to do with database management.

Just adding more context: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973053

It seems that Debian Bullseye ships a broken version. Fixed/newer version seems to be in unstable. Easiest workaround currently looks like to just add the missing table into the sqlite file.

Quick & dirty workaround for debian bullseye:

# sqlite3 /var/lib/rasdaemon/ras-mc_event.db
CREATE TABLE devlink_event (id INTEGER PRIMARY KEY, timestamp TEXT, bus_name TEXT, dev_name TEXT, driver_name TEXT, reporter_name TEXT, msg TEXT);
CREATE TABLE disk_errors (id INTEGER PRIMARY KEY, timestamp TEXT, dev TEXT, sector INTEGER, nr_sector INTEGER, error TEXT, rwbs TEXT, cmd TEXT);
.exit

I can confirm that the version in Debian "unstable" today works without error.