I think I am affected by a very similar issue as described in this thread. However, LXD 5.4 (which contains the above-mentioned pull-request) doesn’t solve this for me.
My lxd server runs seven containers of which I almost daily use about three. I can tell that these were running until I granted the server a well-deserved reboot about two days ago. I noticed that before the reboot, lxc ls was taking a very long time and already showed the ERROR state on all containers. However I thought the reboot that I had scheduled anyway would fix the situation. If only I had known…
If I try to start a container the error message reads Error: Failed to get snapshots: Failed to fetch from "instance_snapshot_config" table: sql: Rows are closed So for me it is a table related to snapshots that seems to time out.
I thought this could be related to the fact that I create daily snapshots for backup purposes, which I used to transfer to another lxd instance over night. I have not yet implemented a deletion process for older snapshots so I am sure that a few hundred for every container will have accumulated by now.
The backup process has not been working for a while but still sends nightly emails, so I can tell that since June 30th the process errors out with the message Error: Failed to get snapshots: Failed to fetch from "config" table: sql: Rows are closed. Sometimes, it will show Error: Failed to get snapshots: Failed to fetch from "instances_profiles" table: sql: transaction has already been committed or rolled back instead.
This is around the time that this thread was started and LXD 5.4 was released so it has likely also been introduced with this version.
If you need any more information, please let me know! Would love to have my containers back up running as fast as possible :).