Title:
Error: sql: transaction has already been committed or rolled back during instance creation
Description:
While attempting to launch a new instance using the following command:
lxc launch ubuntu:24.04 test --profile profile-STG-2
I encountered the following error:
Error: Failed instance creation: Fetch project database object: Failed to fetch from "projects" table:
Failed to fetch from "projects" table: Failed to fetch from "projects" table:
sql: transaction has already been committed or rolled back
LXD Version:
snap list lxd
Name Version Rev Tracking Publisher Notes
lxd 5.21.3-c5ae129 33110 5.21/stable canonical✓ in-cohort
Logs:
The following warnings are repeatedly appearing in /var/snap/lxd/common/lxd/logs/lxd.log:
time="2025-10-08T12:15:32+05:00" level=warning msg="Failed to rollback transaction after error (Fetch project database object: Failed to fetch from \"projects\" table: ... sql: transaction has already been committed or rolled back)"
time="2025-10-08T12:15:32+05:00" level=warning msg="Failed to rollback transaction after error (Fetch project database object: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: sql: transaction has already been committed or rolled back): sql: transaction has already been committed or rolled back"
time="2025-10-08T12:24:28+05:00" level=warning msg="Failed to rollback transaction after error (Fetch project database object: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: sql: transaction has already been committed or rolled back): sql: transaction has already been committed or rolled back"
time="2025-10-08T12:33:19+05:00" level=warning msg="Failed to rollback transaction after error (Fetch project database object: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: sql: transaction has already been committed or rolled back): sql: transaction has already been committed or rolled back"
time="2025-10-08T12:42:48+05:00" level=warning msg="Failed to rollback transaction after error (Fetch project database object: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: sql: transaction has already been committed or rolled back): sql: transaction has already been committed or rolled back"
time="2025-10-08T12:48:58+05:00" level=warning msg="Failed to rollback transaction after error (Fetch project database object: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: sql: transaction has already been committed or rolled back): sql: transaction has already been committed or rolled back"
time="2025-10-08T12:54:19+05:00" level=warning msg="Failed to rollback transaction after error (Fetch project database object: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: sql: transaction has already been committed or rolled back): sql: transaction has already been committed or rolled back"
time="2025-10-08T17:41:08+05:00" level=warning msg="Failed to rollback transaction after error (Fetch project database object: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: Failed to fetch from \"projects\" table: sql: transaction has already been committed or rolled back): sql: transaction has already been committed or rolled back"
These warnings continue to repeat at different timestamps, indicating a possible database transaction issue in LXD.
Request:
Please advise how to resolve or recover from this database-related error. Should I perform a database restore, or is there a known fix for this issue in version 5.21.3?