Colord: CdMain: failed to load mapping database

Hi all,

I am currently facing a difficulty in attempting to add a color profile. Specifically, I am unable to add the color profile by double-clicking on the .icc file, as this action does not produce any effect. Additionally, I do not find any option within the system settings to manually add the profile.

I have also tried to install the gnome-color-manager package, but it is already installed on my system. Despite this, the issue persists.

I would greatly appreciate your support in resolving this issue.

Sincerely,

The issue persist now i have
Installed version: 42870

#System: HP 550-132nl [1.04]
#Board: HP 2B47
#Kernel: 6.12.9-1535.native x86_64
#Processor: Intel(R) Core™ i7-6700 CPU @ 3.40GHz (6/94/3)

Here’s what my color profile looks like–see below screenshot. My guess is that CL just doesn’t bother with this sort of niceties. (And yes, I got gnome-color-manager installed.)

I feel like I am getting closer to the solution. Today, when running this command, I got this output:

$ sudo systemctl status colord.service
Password:
Ă— colord.service - Manage, Install and Generate Color Profiles
     Loaded: loaded (/usr/lib/systemd/system/colord.service; static)
     Active: failed (Result: exit-code) since Sun 2025-02-02 11:55:54 CET; 20s ago
    Process: 856 ExecStart=/usr/libexec/colord (code=exited, status=1/FAILURE)
   Main PID: 856 (code=exited, status=1/FAILURE)

feb 02 11:55:54 sal8 systemd[1]: Starting colord.service...
feb 02 11:55:54 sal8 colord[856]: CdMain: failed to load mapping database: Failed to migrate mappings: SQL error: no su>
feb 02 11:55:54 sal8 systemd[1]: colord.service: Main process exited, code=exited, status=1/FAILURE
feb 02 11:55:54 sal8 systemd[1]: colord.service: Failed with result 'exit-code'.
feb 02 11:55:54 sal8 systemd[1]: Failed to start colord.service.

I will file a bug report in GitHub.

I have made further attempts, but I couldn’t make any progress.

Steps Taken:

  1. Verification of Directories and Permissions:
  • The directory /var/lib/colord exists and has the correct permissions:
ls -la /var/lib/colord
drwxr-xr-x  3 colord colord 4096 Feb  3 20:43 .
drwxr-xr-x 25 root   root   4096 Feb  3 20:10 ..
drwxr-xr-x  2 colord colord 4096 Feb  3 20:03 icc
  • Ensured the permissions are correct for safety:
sudo chown -R colord:colord /var/lib/colord
sudo chmod -R 755 /var/lib/colord
  1. Removal of Database Files:
  • Removed the mapping.db and storage.db files:
sudo rm /var/lib/colord/mapping.db
sudo rm /var/lib/colord/storage.db
  • Verified that there are no temporary files:
sudo rm /var/lib/colord/*.db-*
  1. Manual Creation of the Database:
  • Manually created an empty database:
sudo -u colord sqlite3 /var/lib/colord/mapping.db "CREATE TABLE IF NOT EXISTS mappings (id INTEGER PRIMARY KEY);"
  • Set the correct permissions:
sudo chown colord:colord /var/lib/colord/mapping.db
sudo chmod 644 /var/lib/colord/mapping.db
  1. Verification of Dependencies:
  • Ensured there are no missing libraries:
ldd /usr/libexec/colord | grep "not found"
  1. Manual Execution of colord :
  • Executed colord in verbose mode:
sudo -u colord /usr/libexec/colord --verbose

6.Output:

20:46:30        Verbose debugging enabled (on console 1)
20:46:30        CdMappingDb: trying to open database '/var/lib/colord/mapping.db'
20:46:30        CdMappingDb: creating table to repair: no such table: mappings
20:46:30        CdMappingDb: altering table to convert: no such table: mappings_v2
20:46:30        CdDeviceDb: trying to open database '/var/lib/colord/storage.db'
20:46:30        CdDeviceDb: creating table to repair: no such table: devices
20:46:30        CdProfileDb: trying to open database '/var/lib/colord/storage.db'
free(): invalid pointer
Aborted
  1. System Logs Verification:
  • Checked detailed logs:
sudo journalctl -xeu colord.service

8.Output:

Feb 03 20:44:28 sal8 systemd[1]: Starting colord.service...
Feb 03 20:44:28 sal8 colord[648]: CdMain: failed to load mapping database: Can't open database: unable to open database file
Feb 03 20:44:28 sal8 systemd[1]: colord.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 20:44:28 sal8 systemd[1]: colord.service: Failed with result 'exit-code'.
Feb 03 20:44:28 sal8 systemd[1]: Failed to start colord.service.

Results and Next Steps:

Despite numerous attempts, colord continues to encounter “invalid pointer” errors and is unable to create or access its database.

At this point, I give up. It’s a shame because if I had managed to fix colord, the night mode in GNOME would most likely work as well.

Installed version: 42920
6.12.11-1537.native

Thanks Devs
now with 42950 works color profile and night light!!!

Curious how you made it work. I’m on 42950 too, but I see no change in Settings/Color.

Hi, I am trying on another workstation, and indeed colord is not working for me. So at this point, I think it might be related to what I did before, and then the update fixed it. Now I will try to list the steps I took and see if it works on this PC as well.

1 Like

Hello Cristian,

I started with a clean installation to have the most generic situation possible. I executed these commands:

First, check the contents of the directory where colord stores its data.

ls -l /var/lib/colord/

Expected Output:

total 4
drwxr-xr-x 2 colord colord 4096 Feb 10 11:55 icc

Step 2: Remove Any Corrupted Database Files

Delete any database files that might be corrupted or incomplete.

sudo rm -f /var/lib/colord/*.db

When prompted, enter your administrative password.

Step 3: Set Correct Permissions and Ownership

Ensure that the directory and colord’s files have the correct permissions and ownership.

bash

sudo chown -R colord:colord /var/lib/colord
sudo chmod 755 /var/lib/colord

Explanation:

  • sudo chown -R colord:colord /var/lib/colord: Changes the owner and group of the directory and all its contents to colord.
  • sudo chmod 755 /var/lib/colord: Sets the directory permissions so that the owner has full access, and others can read and execute.

Step 4: Manually Run colord in Verbose Mode

Manually start colord to allow it to regenerate the necessary databases.

bash

sudo -u colord /usr/libexec/colord --verbose

Expected Output:

11:58:19        Verbose debugging enabled (on console 1)
11:58:19        CdMappingDb: trying to open database '/var/lib/colord/mapping.db'
11:58:19        CdMappingDb: creating table to repair: no such table: mappings
11:58:19        CdMappingDb: altering table to convert: no such table: mappings_v2
11:58:19        CdDeviceDb: trying to open database '/var/lib/colord/storage.db'
11:58:19        CdDeviceDb: creating table to repair: no such table: devices
11:58:19        CdProfileDb: trying to open database '/var/lib/colord/storage.db'
free(): invalid pointer
Aborted

Note:

  • The free(): invalid pointer error may appear, but in this context, it can be ignored since colord has still regenerated the necessary databases.

Step 5: Reboot the System

To apply the changes, reboot your system.

and now:

$ systemctl status colord.service
â—Ź colord.service - Manage, Install and Generate Color Profiles
     Loaded: loaded (/usr/lib/systemd/system/colord.service; static)
     Active: active (running) since Mon 2025-02-10 11:58:42 CET; 11s ago
   Main PID: 746 (colord)
      Tasks: 5 (limit: 8494)
     Memory: 7.6M (peak: 8.0M)
        CPU: 66ms
     CGroup: /system.slice/colord.service
             └─746 /usr/libexec/colord

Feb 10 11:58:42 PT-IT02 systemd[1]: Starting colord.service...
Feb 10 11:58:42 PT-IT02 systemd[1]: Started colord.service.
1 Like

Thanks! It worked like a charm! :slightly_smiling_face: