root@zfi-PowerEdge-T640:/var/lib/incus/database# journalctl -u incus -n 30 | cat
11月 21 20:05:48 zfi-PowerEdge-T640 incusd[39165]: Error: Failed to initialize global database: Failed to prepare statements: “\nDELETE FROM projects WHERE name = ?\n”: no such table: main.auth_groups_permissions
11月 21 20:05:49 zfi-PowerEdge-T640 systemd[1]: incus.service: Main process exited, code=exited, status=1/FAILURE
11月 21 20:15:48 zfi-PowerEdge-T640 systemd[1]: incus.service: start-post operation timed out. Terminating.
11月 21 20:15:48 zfi-PowerEdge-T640 incus[39166]: Error: Daemon still not running after 600s timeout (Get “http://unix.socket/1.0”: EOF)
11月 21 20:15:48 zfi-PowerEdge-T640 systemd[1]: incus.service: Control process exited, code=exited, status=1/FAILURE
11月 21 20:15:48 zfi-PowerEdge-T640 systemd[1]: incus.service: Failed with result ‘exit-code’.
11月 21 20:15:48 zfi-PowerEdge-T640 systemd[1]: Failed to start incus.service - Incus - Main daemon.
11月 21 20:15:48 zfi-PowerEdge-T640 systemd[1]: incus.service: Scheduled restart job, restart counter is at 1.
11月 21 20:15:48 zfi-PowerEdge-T640 systemd[1]: Starting incus.service - Incus - Main daemon…
11月 21 20:15:49 zfi-PowerEdge-T640 incusd[89074]: time=“2025-11-21T20:15:49+08:00” 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: table certificates already exists”
11月 21 20:15:49 zfi-PowerEdge-T640 incusd[89074]: Error: Failed to initialize global database: failed to ensure schema: failed to execute queries from /var/lib/incus/database/patch.global.sql: table certificates already exists
11月 21 20:15:49 zfi-PowerEdge-T640 systemd[1]: incus.service: Main process exited, code=exited, status=1/FAILURE
11月 21 20:25:48 zfi-PowerEdge-T640 incus[89075]: Error: Daemon still not running after 600s timeout (Get “http://unix.socket/1.0”: EOF)
11月 21 20:25:48 zfi-PowerEdge-T640 systemd[1]: incus.service: Control process exited, code=exited, status=1/FAILURE
11月 21 20:25:48 zfi-PowerEdge-T640 systemd[1]: incus.service: Failed with result ‘exit-code’.
11月 21 20:25:48 zfi-PowerEdge-T640 systemd[1]: Failed to start incus.service - Incus - Main daemon.
11月 21 20:25:49 zfi-PowerEdge-T640 systemd[1]: incus.service: Scheduled restart job, restart counter is at 2.
11月 21 20:25:49 zfi-PowerEdge-T640 systemd[1]: Starting incus.service - Incus - Main daemon…
11月 21 20:25:49 zfi-PowerEdge-T640 incusd[138260]: time=“2025-11-21T20:25:49+08:00” 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: table certificates already exists”
11月 21 20:25:49 zfi-PowerEdge-T640 incusd[138260]: Error: Failed to initialize global database: failed to ensure schema: failed to execute queries from /var/lib/incus/database/patch.global.sql: table certificates already exists
11月 21 20:25:49 zfi-PowerEdge-T640 systemd[1]: incus.service: Main process exited, code=exited, status=1/FAILURE
11月 21 20:35:49 zfi-PowerEdge-T640 incus[138261]: Error: Daemon still not running after 600s timeout (Get “http://unix.socket/1.0”: EOF)
11月 21 20:35:49 zfi-PowerEdge-T640 systemd[1]: incus.service: Control process exited, code=exited, status=1/FAILURE
11月 21 20:35:49 zfi-PowerEdge-T640 systemd[1]: incus.service: Failed with result ‘exit-code’.
11月 21 20:35:49 zfi-PowerEdge-T640 systemd[1]: Failed to start incus.service - Incus - Main daemon.
11月 21 20:35:49 zfi-PowerEdge-T640 systemd[1]: incus.service: Scheduled restart job, restart counter is at 3.
11月 21 20:35:49 zfi-PowerEdge-T640 systemd[1]: Starting incus.service - Incus - Main daemon…
11月 21 20:35:50 zfi-PowerEdge-T640 incusd[187328]: time=“2025-11-21T20:35:50+08:00” 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: table certificates already exists”
11月 21 20:35:50 zfi-PowerEdge-T640 incusd[187328]: Error: Failed to initialize global database: failed to ensure schema: failed to execute queries from /var/lib/incus/database/patch.global.sql: table certificates already exists
11月 21 20:35:50 zfi-PowerEdge-T640 systemd[1]: incus.service: Main process exited, code=exited, status=1/FAILURE
patch.global.sql:
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 IF EXISTS on_auth_group_delete;
DROP TRIGGER IF EXISTS on_cluster_group_delete;
DROP TRIGGER IF EXISTS on_identity_delete;
DROP TRIGGER IF EXISTS on_identity_provider_group_delete;
DROP TRIGGER IF EXISTS on_image_alias_delete;
DROP TRIGGER IF EXISTS on_image_delete;
DROP TRIGGER IF EXISTS on_instance_backup_delete;
DROP TRIGGER IF EXISTS on_instance_delete;
DROP TRIGGER IF EXISTS on_instance_snaphot_delete;
DROP TRIGGER IF EXISTS on_network_acl_delete;
DROP TRIGGER IF EXISTS on_network_delete;
DROP TRIGGER IF EXISTS on_network_zone_delete;
DROP TRIGGER IF EXISTS on_node_delete;
DROP TRIGGER IF EXISTS on_operation_delete;
DROP TRIGGER IF EXISTS on_profile_delete;
DROP TRIGGER IF EXISTS on_project_delete;
DROP TRIGGER IF EXISTS on_storage_bucket_delete;
DROP TRIGGER IF EXISTS on_storage_pool_delete;
DROP TRIGGER IF EXISTS on_storage_volume_backup_delete;
DROP TRIGGER IF EXISTS on_storage_volume_delete;
DROP TRIGGER IF EXISTS on_storage_volume_snapshot_delete;
DROP TRIGGER IF EXISTS on_warning_delete;
DROP TRIGGER IF EXISTS on_instance_snaphot_delete;
DROP TABLE IF EXISTS identities_projects;
DROP TABLE IF EXISTS auth_groups_permissions;
DROP TABLE IF EXISTS auth_groups_identity_provider_groups;
DROP TABLE IF EXISTS identities_auth_groups;
DROP TABLE IF EXISTS identity_provider_groups;
DROP TABLE IF EXISTS identities;
DROP TABLE IF EXISTS auth_groups;
incus version : 6.0.0
How should I proceed to recover the service?
thanks~~