hughsie / colord

Making color management just work
GNU General Public License v2.0
75 stars 51 forks source link

Fails badly if mapping.db is corrupted #111

Closed rossburton closed 4 years ago

rossburton commented 4 years ago

https://github.com/clearlinux/distribution/issues/1374 is reporting that the 'night light' functionality in GNOME isn't working. Digging into it, it turns out that colord isn't starting because mapping.db is corrupted.

$ /usr/libexec/colord --verbose
02:18:58        Verbose debugging enabled (on console 1)
02:18:58        CdMappingDb: trying to open database '/var/lib/colord/mapping.db'
02:18:58        CdMappingDb: creating table to repair: file is not a database
02:18:58        CdMappingDb: altering table to repair: file is not a database
02:18:58        CdMappingDb: altering table to convert: file is not a database
02:18:58        CdMain: failed to load mapping database: Failed to migrate mappings: SQL error: file is not a database

I don't (yet) have the actual file to see what the problem is, but maybe if the database can't be opened it should just blow it away and start again?

hughsie commented 4 years ago

maybe if the database can't be opened it should just blow it away and start again

Sane, that's what fwupd already does. A PR would be lovely, covered in kids at the moment.

rossburton commented 4 years ago

I'll try and find a moment. We've just done PE With Joe so I understand your situation well. ;)

rossburton commented 4 years ago

I got the file that the user has: it's 500kb of NULs.