Forums > MaxMSP

[bug+workaround] corrupted metadata database is not detected

October 14, 2009 | 3:32 pm

So I somehow got the metadata database file themroc–applications-audio-max5.0.8.db3 in ~/Library/Preferences/Max 5 Preferences Folder corrupted, which made the metadata harvesting very slow and hang at 100% and filled up syslog with error messages (see below), consuming 80% CPU for syslogd, and so on.
I had to find it and delete all .db3 files by hand to get things going again.

The sqlite error 10 (I/O error) should therefore be intercepted and the database rebuilt.

Here’s the syslog, showing Max’s vain attempts to rebuild the database, when something more serious was wrong:

Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: PRAGMA integrity_check
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: CREATE TABLE IF NOT EXISTS environment ( id INTEGER PRIMARY KEY NOT NULL, key VARCHAR(256), value TEXT )
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: CREATE TABLE IF NOT EXISTS paths ( path_id INTEGER PRIMARY KEY NOT NULL, path_ref INTEGER, pathname VARCHAR(256), fullpath VARCHAR(512), date_modified VARCHAR(256) )
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: CREATE TABLE IF NOT EXISTS files ( file_id INTEGER PRIMARY KEY NOT NULL, path_id_ext INTEGER, type_id_ext INTEGER, filename VARCHAR(256), date_created VARCHAR(256), date_modified VARCHAR(256), size INTEGER, validity INTEGER )
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: CREATE TABLE IF NOT EXISTS objects ( object_id INTEGER PRIMARY KEY NOT NULL, file_id_ext INTEGER, name VARCHAR(256), role_id_ext INTEGER, usage_count INTEGER, session_usage_count INTEGER, typed_usage_count INTEGER, date_lastaccessed VARCHAR(256), flags INTEGER, tags TEXT, description TEXT )
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: CREATE TABLE IF NOT EXISTS metadata ( metadata_id INTEGER PRIMARY KEY NOT NULL, object_id_ext INTEGER, class VARCHAR(256), data TEXT, object_name VARCHAR(256), object_role_id_ext INTEGER )
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: CREATE TABLE IF NOT EXISTS types ( type_id INTEGER PRIMARY KEY NOT NULL, fcc CHAR(4), suffix VARCHAR(64), description VARCHAR(256))
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: CREATE TABLE IF NOT EXISTS roles ( role_id INTEGER PRIMARY KEY NOT NULL, rolename VARCHAR(256), show_suffix INTEGER)
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:24 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: CREATE TABLE IF NOT EXISTS docs ( doc_id INTEGER PRIMARY KEY NOT NULL, object_id_ext INTEGER, doc_title VARCHAR(256), doc_type VARCHAR(256), doc_content INTEGER)
Oct 14 17:11:25 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:25 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: SELECT DISTINCT type_id FROM types WHERE fcc = ‘fold’ AND suffix LIKE "
Oct 14 17:11:25 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:25 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: SELECT DISTINCT type_id FROM types WHERE fcc = ‘fold’ AND suffix = "
Oct 14 17:11:25 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: ERROR: 10
Oct 14 17:11:25 m1646 [0x0-0x34034].com.cycling74.MaxMSP[510]: SQL: INSERT INTO types (‘fcc’, ‘suffix’, ‘description’) VALUES (‘fold’, ", ‘Folder’)

Wow, you read through until the end! You must be really curious to see how the database is built! =-)

Cheers…
…Diemo


Viewing 1 post (of 1 total)