Lvl=dbug msg="Database error: &errors.errorString{s:\"sql: no rows in result set\"}"

I had a hardware failure so I moved the disks into a new system. lxc list shows all the containers, but none of them start.

The lxd.log file shows,

lvl=info msg="LXD 3.3 is starting in normal mode" path=/mnt/myrpool/var/snap/lxd/common/lxd t=2018-09-18T08:10:20+0530
lvl=info msg="Kernel uid/gid map:" t=2018-09-18T08:10:20+0530
lvl=info msg=" - u 0 0 4294967295" t=2018-09-18T08:10:20+0530
lvl=info msg=" - g 0 0 4294967295" t=2018-09-18T08:10:20+0530
lvl=info msg="Configured LXD uid/gid map:" t=2018-09-18T08:10:20+0530
lvl=info msg=" - u 0 1000000 65536" t=2018-09-18T08:10:20+0530
lvl=info msg=" - g 0 1000000 65536" t=2018-09-18T08:10:20+0530
lvl=warn msg="AppArmor support has been disabled because of lack of kernel support" t=2018-09-18T08:10:20+0530
lvl=warn msg="Couldn't find the CGroup network class controller, network limits will be ignored." t=2018-09-18T08:10:20+0530
lvl=info msg="Initializing local database" t=2018-09-18T08:10:20+0530
lvl=info msg="Initializing database gateway" t=2018-09-18T08:10:20+0530
address= id=1 lvl=info msg="Start database node" t=2018-09-18T08:10:20+0530
lvl=info msg="Raft: Restored from snapshot 1-6309-1537238413166" t=2018-09-18T08:10:20+0530
lvl=info msg="Raft: Initial configuration (index=1): [{Suffrage:Voter ID:1 Address:0}]" t=2018-09-18T08:10:20+0530
lvl=info msg="Raft: Node at 0 [Leader] entering Leader state" t=2018-09-18T08:10:20+0530
lvl=info msg="LXD isn't socket activated" t=2018-09-18T08:10:20+0530
lvl=info msg="Starting /dev/lxd handler:" t=2018-09-18T08:10:20+0530
lvl=info msg=" - binding devlxd socket" socket=/mnt/myrpool/var/snap/lxd/common/lxd/devlxd/sock t=2018-09-18T08:10:20+0530
lvl=info msg="REST API daemon:" t=2018-09-18T08:10:20+0530
lvl=info msg=" - binding Unix socket" socket=/mnt/myrpool/var/snap/lxd/common/lxd/unix.socket t=2018-09-18T08:10:20+0530
lvl=info msg="Initializing global database" t=2018-09-18T08:10:20+0530
lvl=info msg="Initializing storage pools" t=2018-09-18T08:10:20+0530
lvl=dbug msg="Initializing and checking storage pool \"default\"" t=2018-09-18T08:10:20+0530
lvl=dbug msg="Initializing a ZFS driver" t=2018-09-18T08:10:20+0530
lvl=dbug msg="Checking ZFS storage pool \"default\"" t=2018-09-18T08:10:20+0530
lvl=dbug msg="Initializing a ZFS driver" t=2018-09-18T08:10:20+0530
lvl=info msg="Initializing networks" t=2018-09-18T08:10:20+0530
lvl=dbug msg="Connecting to a remote simplestreams server" t=2018-09-18T08:10:20+0530
lvl=info msg="Loading configuration" t=2018-09-18T08:10:20+0530
lvl=dbug msg="Initialized inotify with file descriptor 14" t=2018-09-18T08:10:20+0530
lvl=info msg="Connected to MAAS controller" t=2018-09-18T08:10:20+0530
lvl=info msg="Pruning expired images" t=2018-09-18T08:10:20+0530
lvl=info msg="Done pruning expired images" t=2018-09-18T08:10:20+0530
lvl=info msg="Expiring log files" t=2018-09-18T08:10:20+0530
lvl=info msg="Updating instance types" t=2018-09-18T08:10:20+0530
lvl=info msg="Updating images" t=2018-09-18T08:10:20+0530
lvl=info msg="Done expiring log files" t=2018-09-18T08:10:20+0530
lvl=dbug msg="Database error: &errors.errorString{s:\"sql: no rows in result set\"}" t=2018-09-18T08:10:20+0530
lvl=dbug msg="Database error: &errors.errorString{s:\"sql: no rows in result set\"}" t=2018-09-18T08:10:20+0530
lvl=info msg="Done updating images" t=2018-09-18T08:10:20+0530
lvl=info msg="Done updating instance types" t=2018-09-18T08:10:31+0530
ip=@ lvl=dbug method=GET msg=handling t=2018-09-18T08:12:22+0530 url=/1.0

The container log shows,

# lxc info --show-log unifi
Name: unifi
Remote: unix://
Architecture: x86_64
Created: 2018/07/14 13:40 UTC
Status: Stopped
Type: persistent
Profiles: default

Log:

lxc 20180918023610.545 TRACE    lxc_commands - commands.c:lxc_cmd:311 - Connection refused - Command "get_state" failed to connect command socket
lxc 20180918023610.548 TRACE    lxc_commands - commands.c:lxc_cmd:311 - Connection refused - Command "get_state" failed to connect command socket
lxc 20180918023610.548 TRACE    lxc_commands - commands.c:lxc_cmd:311 - Connection refused - Command "get_state" failed to connect command socket

Any idea how this can be fixed?

Not sure about the lxc error, but the “no rows in result set” debug message is harmless.