Lxd-to-incus failed: Failed to start the target server

I have Ubuntu 24.04.2 and I have LVM as a storage system.
I followed Migrating from LXD - Incus documentation
However, lxd-to-incus failed: Failed to start the target server
I then did “journalctl -xeu incus.service”
Output of “journalctl -xeu incus.service”:
Jun 27 13:43:05 crock-hp incusd[6776]: time=“2025-06-27T13:43:05Z” level=error msg="Failed to start the dae>
Jun 27 13:43:05 crock-hp incusd[6776]: Error: Failed to initialize global database: failed to ensure schema>
Jun 27 13:43:05 crock-hp systemd[1]: incus.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ An ExecStart= process belonging to unit incus.service has exited.
░░
░░ The process’ exit code is ‘exited’ and its exit status is 1.
Jun 27 13:53:04 crock-hp incus[6777]: Error: Daemon still not running after 600s timeout (Get "http://unix.>
Jun 27 13:53:04 crock-hp systemd[1]: incus.service: start-post operation timed out. Terminating.
Jun 27 13:53:04 crock-hp systemd[1]: incus.service: Control process exited, code=exited, status=1/FAILURE

If I type “incus list”, I get the error: Get “http://unix.socket/1.0”: EOF
If I do “incus version” it tells me:
Client version: 6.0.0
Server version: unreachable

What do I have to do? I am sorry, I am not proficient with Linux, only learning…

There should be a log file in /var/log related to the lxd-to-incus migration, could you show the content of that?

The output you showed above is truncated in a way that makes it rather unhelpful.
Can you also show journalctl -u incus -n 30

sudo cat /var/log/incus/incus.log
time=“2025-06-27T13:33:05Z” level=error msg=“Failed to start the daemon” err=“Failed to initialize global database: failed to ensure schema: failed to execute queries from /var/lib/incus/database/patch.global.sql: no such trigger: on_instance_snaphot_delete”

journalctl -u incus -n 30 | more
Jun 27 15:23:09 crock-hp incusd[13227]: time=“2025-06-27T15:23:09Z” level=error msg=“Failed to start the daemon” err=“Failed to initialize global database: failed to ensure schema: failed to execute queries from /var/lib/incus/database/patch.global.sql: no such trigger: on_instance_snaphot_delete”
Jun 27 15:23:09 crock-hp incusd[13227]: Error: Failed to initialize global database: failed to ensure schema: failed to execute queries from /var/lib/incus/database/patch.global.sql: no such trigger: on_instance_snaphot_delete
Jun 27 15:23:09 crock-hp systemd[1]: incus.service: Main process exited, code=exited, status=1/FAILURE
Jun 27 15:33:08 crock-hp incus[13228]: Error: Daemon still not running after 600s timeout (Get “http://unix.socket/1.0”: EOF)
Jun 27 15:33:08 crock-hp systemd[1]: incus.service: Control process exited, code=exited, status=1/FAILURE
Jun 27 15:33:08 crock-hp systemd[1]: incus.service: Failed with result ‘exit-code’.
Jun 27 15:33:09 crock-hp systemd[1]: Failed to start incus.service - Incus - Main daemon.
Jun 27 15:33:09 crock-hp systemd[1]: incus.service: Scheduled restart job, restart counter is at 12.
Jun 27 15:33:09 crock-hp systemd[1]: Starting incus.service - Incus - Main daemon…
Jun 27 15:33:10 crock-hp incusd[13524]: time=“2025-06-27T15:33:10Z” level=error msg=“Failed to start the daemon” err=“Failed to initialize global database: failed to ensure schema: failed to execute queries from /var/lib/incus/database/patch.global.sql: no such trigger: on_instance_snaphot_delete”

Do you still have a file at /var/lib/incus/database/patch.global.sql?
If you do, can you show its content?

sudo cat /var/lib/incus/database/patch.global.sql
[sudo] password for crock1:
UPDATE storage_pools_config SET value=‘/var/lib/incus/disks/default.img’ WHERE value=‘/var/snap/lxd/common/lxd/disks/default.img’;
UPDATE storage_pools_config SET value=‘/var/lib/incus/storage-pools/lxc_pool1’ WHERE value=‘/var/snap/lxd/common/lxd/storage-pools/lxc_pool1’;
UPDATE profiles SET description=‘Default Incus profile’ WHERE description=‘Default LXD profile’;
UPDATE projects SET description=‘Default Incus project’ WHERE description=‘Default LXD project’;
CREATE TABLE certificates (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
fingerprint TEXT NOT NULL,
type INTEGER NOT NULL,
name TEXT NOT NULL,
certificate TEXT NOT NULL,
restricted INTEGER NOT NULL DEFAULT 0,
UNIQUE (fingerprint)
);
CREATE TABLE “certificates_projects” (
certificate_id INTEGER NOT NULL,
project_id INTEGER NOT NULL,
FOREIGN KEY (certificate_id) REFERENCES certificates (id) ON DELETE CASCADE,
FOREIGN KEY (project_id) REFERENCES “projects” (id) ON DELETE CASCADE,
UNIQUE (certificate_id, project_id)
);
DELETE FROM schema WHERE version < 73;
UPDATE schema SET version=69 WHERE version=73;
INSERT INTO certificates (id, fingerprint, type, name, certificate, restricted) SELECT id, identifier, 1, name, json_extract(metadata, “$.cert”), 1 FROM identities WHERE type=1;
INSERT INTO certificates (id, fingerprint, type, name, certificate, restricted) SELECT id, identifier, 1, name, json_extract(metadata, “$.cert”), 0 FROM identities WHERE type=2;
INSERT INTO certificates (id, fingerprint, type, name, certificate, restricted) SELECT id, identifier, 2, name, json_extract(metadata, “$.cert”), 0 FROM identities WHERE type=3;
INSERT INTO certificates (id, fingerprint, type, name, certificate, restricted) SELECT id, identifier, 3, name, json_extract(metadata, “$.cert”), 1 FROM identities WHERE type=4;
INSERT INTO certificates (id, fingerprint, type, name, certificate, restricted) SELECT id, identifier, 3, name, json_extract(metadata, “$.cert”), 0 FROM identities WHERE type=6;
INSERT INTO certificates_projects (certificate_id, project_id) SELECT identity_id, project_id FROM identities_projects;
DROP TRIGGER on_auth_group_delete;
DROP TRIGGER on_cluster_group_delete;
DROP TRIGGER on_identity_delete;
DROP TRIGGER on_identity_provider_group_delete;
DROP TRIGGER on_image_alias_delete;
DROP TRIGGER on_image_delete;
DROP TRIGGER on_instance_backup_delete;
DROP TRIGGER on_instance_delete;
DROP TRIGGER on_instance_snaphot_delete;
DROP TRIGGER on_network_acl_delete;
DROP TRIGGER on_network_delete;
DROP TRIGGER on_network_zone_delete;
DROP TRIGGER on_node_delete;
DROP TRIGGER on_operation_delete;
DROP TRIGGER on_profile_delete;
DROP TRIGGER on_project_delete;
DROP TRIGGER on_storage_bucket_delete;
DROP TRIGGER on_storage_pool_delete;
DROP TRIGGER on_storage_volume_backup_delete;
DROP TRIGGER on_storage_volume_delete;
DROP TRIGGER on_storage_volume_snapshot_delete;
DROP TRIGGER on_warning_delete;
DROP TABLE identities_projects;
DROP TABLE auth_groups_permissions;
DROP TABLE auth_groups_identity_provider_groups;
DROP TABLE identities_auth_groups;
DROP TABLE identity_provider_groups;
DROP TABLE identities;
DROP TABLE auth_groups;

Okay, please do:

sudo sed -i "s/DROP TRIGGER/DROP TRIGGER IF EXISTS/g" /var/lib/incus/database/patch.global.sql
sudo sed -i "s/DROP TABLE/DROP TABLE IF EXISTS/g" /var/lib/incus/database/patch.global.sql
sudo systemctl start incus.service

That may take care of the issue.

Modern lxd-to-incus handles that just fine but you’re on 6.0.0 so that’s a rather old version of the logic.

It did not work:
Job for incus.service failed because the control process exited with error code.
See “systemctl status incus.service” and “journalctl -xeu incus.service” for details.

I had only one container that I could recreate, if necessary. If it is easier to set the incus server up freshly, than fixing the error, this would be ok. I would just be glad about instructions how to do that.

Can you do:

sudo systemctl daemon-reload
sudo systemctl start incus
journalctl -u incus -n 30

sudo systemctl daemon-reload
sudo systemctl start incus
journalctl -u incus -n 30
[sudo] password for crock1:
Job for incus.service failed because the control process exited with error code.
See “systemctl status incus.service” and “journalctl -xeu incus.service” for details.
Jun 27 16:53:12 crock-hp systemd[1]: incus.service: Control process exited, code=exited, status=1/FAILURE
Jun 27 16:53:12 crock-hp systemd[1]: incus.service: Failed with result ‘exit-code’.
Jun 27 16:53:12 crock-hp systemd[1]: Failed to start incus.service - Incus - Main daemon.
Jun 27 16:53:13 crock-hp systemd[1]: incus.service: Scheduled restart job, restart counter is at 20.
Jun 27 16:53:13 crock-hp systemd[1]: Starting incus.service - Incus - Main daemon…
Jun 27 16:53:13 crock-hp incusd[18915]: time=“2025-06-27T16:53:13Z” level=error msg=“Failed to start the daemon” err="Failed to >
Jun 27 16:53:13 crock-hp incusd[18915]: Error: Failed to initialize global database: Failed to prepare statements: "\nDELETE FRO>
Jun 27 16:53:13 crock-hp systemd[1]: incus.service: Main process exited, code=exited, status=1/FAILURE
Jun 27 17:03:13 crock-hp incus[18916]: Error: Daemon still not running after 600s timeout (Get “http://unix.socket/1.0”: EOF)

maybe do journalctl -u incus -n 30 | cat to try and get output that’s readable?

Also updated version of /var/lib/incus/database/patch.global.sql would be useful in combination with the readable journal output.

journalctl -u incus -n 30 | cat
Jun 27 17:53:16 crock-hp incusd[21168]: time=“2025-06-27T17:53:16Z” level=error msg=“Failed to start the daemon” err=“Failed to initialize global database: Failed to prepare statements: "\nDELETE FROM projects WHERE name = ?\n": no such table: main.auth_groups_permissions”
Jun 27 17:53:16 crock-hp incusd[21168]: Error: Failed to initialize global database: Failed to prepare statements: “\nDELETE FROM projects WHERE name = ?\n”: no such table: main.auth_groups_permissions
Jun 27 17:53:16 crock-hp systemd[1]: incus.service: Main process exited, code=exited, status=1/FAILURE
Jun 27 18:03:16 crock-hp incus[21169]: Error: Daemon still not running after 600s timeout (Get “http://unix.socket/1.0”: EOF)
Jun 27 18:03:16 crock-hp systemd[1]: incus.service: Control process exited, code=exited, status=1/FAILURE
Jun 27 18:03:16 crock-hp systemd[1]: incus.service: Failed with result ‘exit-code’.
Jun 27 18:03:16 crock-hp systemd[1]: Failed to start incus.service - Incus - Main daemon.

the file /var/lib/incus/database/patch.global.sql does no longer exist

Is it possible that it has something to do with the storage pool? For LXC, I had set it up like this:

lxc storage show default
name: default
description: “”
driver: lvm
status: Created
config:
lvm.thinpool_name: LXDThinPool
lvm.vg_name: default
size: 100GiB
source: /var/snap/lxd/common/lxd/disks/default.img
used_by: /1.0/profiles/default
locations: none

That’s not really a problem, no. lxd-to-incus handles the loop type pools just fine.

So there are two options now:

  1. We keep fixing this. It’s certainly fixable, at this point, I’d just have your re-create the patch.global.sql using what you gave me earlier and then re-apply the two sed -i commands. When you look at the file after that, all the DROP TRIGGER and DROP TABLE calls should have a IF EXISTS added to them so they don’t fail on missing tables. Once the file looks good, try starting Incus again so it gets run (systemctl daemon-reload && systemctl start incus).
  2. You go with a clean slate as you mentioned that you’d be fine with that. For that the easiest would likely be to do: mv /var/lib/incus /var/lib/incus.bak && mkdir /var/lib/incus and then reboot your system. That will ensure there’s no leftover kernel state or anything and you’ll basically get a clean installation while keeping a backup of things in case you change your mind.

I tried option 1. However it seems to me, as if it was the same we tried before. I recreated the /var/lib/incus/database/patch.global.sql, adapted it with the two sed commands and did sudo systemctl daemon-reload && systemctl start incus. It is still failing. I will now try option 2.

Thank you for your help. I appreciated it. I did now option 2 and it works : )