Using lxd 3.6 from snap in Ubuntu 16.04.5 and 18.04.1, If I create a project the ‘lxc list’ doesn’t work after I create a container. The new project manage container and profiles:
manuel@profe-asir2:~$ lxc project create DMZS -c features.images=false
Project DMZS created
manuel@profe-asir2:~$ lxc project list
+-----------------------+--------+----------+---------+
| NAME | IMAGES | PROFILES | USED BY |
+-----------------------+--------+----------+---------+
| DMZS | NO | YES | 1 |
+-----------------------+--------+----------+---------+
| balanceador (current) | NO | NO | 4 |
+-----------------------+--------+----------+---------+
| default | YES | YES | 12 |
+-----------------------+--------+----------+---------+
manuel@profe-asir2:~$ lxc project switch DMZS
manuel@profe-asir2:~$ lxc project list
+----------------+--------+----------+---------+
| NAME | IMAGES | PROFILES | USED BY |
+----------------+--------+----------+---------+
| DMZS (current) | NO | YES | 1 |
+----------------+--------+----------+---------+
| balanceador | NO | NO | 4 |
+----------------+--------+----------+---------+
| default | YES | YES | 12 |
+----------------+--------+----------+---------+
manuel@profe-asir2:~$ lxc list
+------+-------+------+------+------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+-------+------+------+------+-----------+
manuel@profe-asir2:~$ lxc launch xenial64 sint -p dmzint
Creating sint
Starting sint
manuel@profe-asir2:~$ lxc list
Error: not found
manuel@profe-asir2:~$ lxc exec sint bash
root@sint:~#
The container is working and it appears in the project:
Hm, the steps you pasted don’t quite make sense to me. You’re running lxc list before creating any container, so of course the list is empty. Then you run lxc project show DMZS and it shows as sint container, which I assume was created inbetween. What am I missing?
I can’t reproduce the problem here, using the exact same project name, ZFS backend and container name…
Can you try:
snap set lxd daemon.debug=true
systemctl reload snap.lxd.daemon
Then reproduce the failing lxc list and send us the content of /var/snap/lxd/common/lxd/logs/lxd.log, hopefully that’ll give us a clue as to what’s causing the failure.
lvl=info msg="LXD 3.6 is starting in normal mode" path=/var/snap/lxd/common/lxd t=2018-10-29T21:25:07+0100
lvl=info msg="Kernel uid/gid map:" t=2018-10-29T21:25:07+0100
lvl=info msg=" - u 0 0 4294967295" t=2018-10-29T21:25:07+0100
lvl=info msg=" - g 0 0 4294967295" t=2018-10-29T21:25:07+0100
lvl=info msg="Configured LXD uid/gid map:" t=2018-10-29T21:25:07+0100
lvl=info msg=" - u 0 1000000 1000000000" t=2018-10-29T21:25:07+0100
lvl=info msg=" - g 0 1000000 1000000000" t=2018-10-29T21:25:07+0100
lvl=warn msg="CGroup memory swap accounting is disabled, swap limits will be ignored." t=2018-10-29T21:25:07+0100
lvl=dbug msg="Failed to set NETLINK_DUMP_STRICT_CHK socket option" t=2018-10-29T21:25:07+0100
lvl=dbug msg="Running kernel does not support netnsid-based network retrieval" t=2018-10-29T21:25:07+0100
lvl=dbug msg="Running kernel does not support uevent injection" t=2018-10-29T21:25:07+0100
lvl=dbug msg="System supports unprivileged file capabilities" t=2018-10-29T21:25:07+0100
lvl=info msg="Initializing local database" t=2018-10-29T21:25:07+0100
lvl=info msg="Initializing database gateway" t=2018-10-29T21:25:07+0100
address= id=1 lvl=info msg="Start database node" t=2018-10-29T21:25:07+0100
lvl=info msg="Raft: Restored from snapshot 1-4143-1540765980815" t=2018-10-29T21:25:07+0100
lvl=info msg="Raft: Initial configuration (index=1): [{Suffrage:Voter ID:1 Address:0}]" t=2018-10-29T21:25:07+0100
lvl=info msg="Raft: Node at 0 [Leader] entering Leader state" t=2018-10-29T21:25:07+0100
lvl=info msg="Dqlite: starting event loop" t=2018-10-29T21:25:07+0100
lvl=dbug msg="Dqlite: accepting connections" t=2018-10-29T21:25:07+0100
lvl=info msg="LXD is socket activated" t=2018-10-29T21:25:07+0100
lvl=info msg="Starting /dev/lxd handler:" t=2018-10-29T21:25:07+0100
lvl=info msg=" - binding devlxd socket" socket=/var/snap/lxd/common/lxd/devlxd/sock t=2018-10-29T21:25:07+0100
lvl=info msg="REST API daemon:" t=2018-10-29T21:25:07+0100
lvl=info msg=" - binding Unix socket" socket=/var/snap/lxd/common/lxd/unix.socket t=2018-10-29T21:25:07+0100
lvl=info msg="Initializing global database" t=2018-10-29T21:25:07+0100
lvl=info msg="Dqlite: handling new connection (fd=22)" t=2018-10-29T21:25:07+0100
lvl=info msg="Dqlite: connected address=0 attempt=0" t=2018-10-29T21:25:07+0100
lvl=info msg="Initializing storage pools" t=2018-10-29T21:25:07+0100
lvl=dbug msg="Initializing and checking storage pool \"default\"" t=2018-10-29T21:25:07+0100
lvl=dbug msg="Checking ZFS storage pool \"default\"" t=2018-10-29T21:25:07+0100
lvl=info msg="Initializing networks" t=2018-10-29T21:25:07+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:07+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=lxdbr0 t=2018-10-29T21:25:07+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:08+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=wan t=2018-10-29T21:25:08+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:08+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=dmz t=2018-10-29T21:25:08+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:08+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=lan t=2018-10-29T21:25:08+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:09+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=internet t=2018-10-29T21:25:09+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:09+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=dmzint t=2018-10-29T21:25:09+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:09+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=dmzext t=2018-10-29T21:25:09+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:10+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=intranet t=2018-10-29T21:25:10+0100
lvl=dbug msg="Connecting to a remote simplestreams server" t=2018-10-29T21:25:10+0100
lvl=dbug msg="Connecting to a remote simplestreams server" t=2018-10-29T21:25:10+0100
lvl=info msg="Pruning leftover image files" t=2018-10-29T21:25:10+0100
lvl=info msg="Done pruning leftover image files" t=2018-10-29T21:25:10+0100
lvl=info msg="Loading configuration" t=2018-10-29T21:25:10+0100
lvl=dbug msg="Initialized inotify with file descriptor 3" t=2018-10-29T21:25:10+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:10+0100
lvl=eror msg="Failed to load containers: No such object" t=2018-10-29T21:25:10+0100
lvl=info msg="Connected to MAAS controller" t=2018-10-29T21:25:10+0100
lvl=info msg="Pruning expired images" t=2018-10-29T21:25:10+0100
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:25:10+0100 url=/1.0
lvl=info msg="Done pruning expired images" t=2018-10-29T21:25:10+0100
lvl=info msg="Expiring log files" t=2018-10-29T21:25:10+0100
lvl=info msg="Updating instance types" t=2018-10-29T21:25:10+0100
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:25:10+0100 url=/internal/ready
lvl=info msg="Updating images" t=2018-10-29T21:25:10+0100
lvl=info msg="Done expiring log files" t=2018-10-29T21:25:10+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:10+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"sql: no rows in result set\"}" t=2018-10-29T21:25:10+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:10+0100
err="No such object" lvl=eror msg="Problem loading containers list" t=2018-10-29T21:25:10+0100
alias=x fp=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Processing image" protocol=simplestreams server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:10+0100
lvl=dbug msg="Connecting to a remote simplestreams server" t=2018-10-29T21:25:10+0100
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:25:10+0100 url=/1.0
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:25:10+0100 url=/internal/ready
image=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Image already exists in the db" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Image already exists on storage pool \"default\"" t=2018-10-29T21:25:12+0100
fp=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Already up to date" t=2018-10-29T21:25:12+0100
alias=x/i386 fp=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Processing image" protocol=simplestreams server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
expiry=2018-10-29T22:25:12+0100 lvl=dbug msg="Using SimpleStreams cache entry" server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
image=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Image already exists in the db" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Image already exists on storage pool \"default\"" t=2018-10-29T21:25:12+0100
fp=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Already up to date" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"sql: no rows in result set\"}" t=2018-10-29T21:25:12+0100
alias=x fp=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Processing image" protocol=simplestreams server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
expiry=2018-10-29T22:25:12+0100 lvl=dbug msg="Using SimpleStreams cache entry" server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
image=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Image already exists in the db" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Image already exists on storage pool \"default\"" t=2018-10-29T21:25:12+0100
fp=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Already up to date" t=2018-10-29T21:25:12+0100
alias=x/i386 fp=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Processing image" protocol=simplestreams server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
expiry=2018-10-29T22:25:12+0100 lvl=dbug msg="Using SimpleStreams cache entry" server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
image=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Image already exists in the db" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Image already exists on storage pool \"default\"" t=2018-10-29T21:25:12+0100
fp=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Already up to date" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"sql: no rows in result set\"}" t=2018-10-29T21:25:12+0100
alias=x fp=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Processing image" protocol=simplestreams server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
expiry=2018-10-29T22:25:12+0100 lvl=dbug msg="Using SimpleStreams cache entry" server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
image=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Image already exists in the db" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Image already exists on storage pool \"default\"" t=2018-10-29T21:25:12+0100
fp=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Already up to date" t=2018-10-29T21:25:12+0100
alias=x/i386 fp=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Processing image" protocol=simplestreams server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
expiry=2018-10-29T22:25:12+0100 lvl=dbug msg="Using SimpleStreams cache entry" server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
image=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Image already exists in the db" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Image already exists on storage pool \"default\"" t=2018-10-29T21:25:12+0100
fp=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Already up to date" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"sql: no rows in result set\"}" t=2018-10-29T21:25:12+0100
alias=x fp=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Processing image" protocol=simplestreams server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
expiry=2018-10-29T22:25:12+0100 lvl=dbug msg="Using SimpleStreams cache entry" server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
image=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Image already exists in the db" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Image already exists on storage pool \"default\"" t=2018-10-29T21:25:12+0100
fp=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Already up to date" t=2018-10-29T21:25:12+0100
alias=x/i386 fp=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Processing image" protocol=simplestreams server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
expiry=2018-10-29T22:25:12+0100 lvl=dbug msg="Using SimpleStreams cache entry" server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
image=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Image already exists in the db" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Image already exists on storage pool \"default\"" t=2018-10-29T21:25:12+0100
fp=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Already up to date" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"sql: no rows in result set\"}" t=2018-10-29T21:25:12+0100
alias=x fp=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Processing image" protocol=simplestreams server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
expiry=2018-10-29T22:25:12+0100 lvl=dbug msg="Using SimpleStreams cache entry" server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
image=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Image already exists in the db" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Image already exists on storage pool \"default\"" t=2018-10-29T21:25:12+0100
fp=ee5129ec7855ae748a64d001a0f5de0f21740752175ce2223873da9d53fc3af1 lvl=dbug msg="Already up to date" t=2018-10-29T21:25:12+0100
alias=x/i386 fp=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Processing image" protocol=simplestreams server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
expiry=2018-10-29T22:25:12+0100 lvl=dbug msg="Using SimpleStreams cache entry" server=https://cloud-images.ubuntu.com/releases t=2018-10-29T21:25:12+0100
image=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Image already exists in the db" t=2018-10-29T21:25:12+0100
lvl=dbug msg="Image already exists on storage pool \"default\"" t=2018-10-29T21:25:12+0100
fp=eff69f00b5ec53490277aacc310780f9c888a8eedb63163899d7abd1c7500350 lvl=dbug msg="Already up to date" t=2018-10-29T21:25:12+0100
lvl=info msg="Done updating images" t=2018-10-29T21:25:12+0100
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:25:13+0100 url=/1.0
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:25:13+0100 url="/1.0/containers?project=DMZS&recursion=2"
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:13+0100
lvl=dbug msg="DBERR: containersGet: error \"No such object\"" t=2018-10-29T21:25:13+0100
lvl=info msg="Done updating instance types" t=2018-10-29T21:25:14+0100
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:26:10+0100 url=/1.0
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:26:10+0100 url="/1.0/projects?project=DMZS&recursion=1"
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:26:17+0100 url=/1.0
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:26:17+0100 url="/1.0/containers?project=DMZS&recursion=2"
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:26:17+0100
lvl=dbug msg="DBERR: containersGet: error \"No such object\"" t=2018-10-29T21:26:17+0100
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:26:51+0100 url=/1.0
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:26:51+0100 url="/1.0/containers?project=DMZS&recursion=2"
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:26:51+0100
lvl=dbug msg="DBERR: containersGet: error \"No such object\"" t=2018-10-29T21:26:51+0100
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:27:39+0100 url=/1.0
ip=@ lvl=dbug method=GET msg=handling t=2018-10-29T21:27:39+0100 url="/1.0/containers?project=DMZS&recursion=2"
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:27:39+0100
lvl=dbug msg="DBERR: containersGet: error \"No such object\"" t=2018-10-29T21:27:39+0100
I don’t know if these messages are normal but the networks (created using lxc network create) are running ok:
lvl=info msg="Initializing networks" t=2018-10-29T21:25:07+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:07+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=lxdbr0 t=2018-10-29T21:25:07+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:08+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=wan t=2018-10-29T21:25:08+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:08+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=dmz t=2018-10-29T21:25:08+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:08+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=lan t=2018-10-29T21:25:08+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:09+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=internet t=2018-10-29T21:25:09+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:09+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=dmzint t=2018-10-29T21:25:09+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:09+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=dmzext t=2018-10-29T21:25:09+0100
lvl=dbug msg="Database error: &errors.errorString{s:\"No such object\"}" t=2018-10-29T21:25:10+0100
err="No such object" lvl=eror msg="Failed to bring up network" name=intranet t=2018-10-29T21:25:10+0100
Looks like @freeekanayaka fixed most of this issue earlier today, though there’s still a slight problem with other callers of containerLoadNodeAll failing with the same error.
The project feature is a great idea and I’ll use a lot in my classes. My students will create a project for a concrete infrastruture with all containers and profiles. They’ll have all organized and will not mix containers/profiles of other projects.