Loading config file for the container failed


#1

Hi,
i installed tree lxd-Container and everything works fine. As i wanted to restart one container, i got the error:

Fehler: Error calling 'lxd forkstart test2 /var/lib/lxd/containers /var/log/lxd/test2/lxc.conf': err='Failed to run: /usr/bin/lxd forkstart test2 /var/lib/lxd/containers /var/log/lxd/test2/lxc.conf: error: Error opening startup config file: "loading config file for the container failed"'
Versuchen Sie `lxc info --show-log test2` um mehr Informationen zu erhalten

Also a new created container (test 2) didn’t start, same error.
What can i do?
Thanks
Jan

Last login: Fri May  3 12:42:04 2019 from 10.16.25.1
root@hphost03:~# lxc list
+-----------+---------+----------------------+------+------------+-----------------+
|   NAME    | STATUS  |         IPV4         | IPV6 |    TYP     | SCHNAPPSCHÜSSE |
+-----------+---------+----------------------+------+------------+-----------------+
| ldaptest  | STOPPED |                      |      | PERSISTENT | 0               |
+-----------+---------+----------------------+------+------------+-----------------+
| nextcloud | RUNNING | 192.168.100.6 (eth0) |      | PERSISTENT | 0               |
+-----------+---------+----------------------+------+------------+-----------------+
| test1     | STOPPED |                      |      | PERSISTENT | 0               |
+-----------+---------+----------------------+------+------------+-----------------+
| test2     | STOPPED |                      |      | PERSISTENT | 0               |
+-----------+---------+----------------------+------+------------+-----------------+
root@hphost03:~# lxc start test2
Fehler: Error calling 'lxd forkstart test2 /var/lib/lxd/containers /var/log/lxd/test2/lxc.conf': err='Failed to run: /usr/bin/lxd forkstart test2 /var/lib/lxd/containers /var/log/lxd/test2/lxc.conf: error: Error opening startup config file: "loading config file for the container failed"'
Versuchen Sie `lxc info --show-log test2` um mehr Informationen zu erhalten
root@hphost03:~# lxc info --show-log test2
Name: test2
Remote: unix://
Architektur: x86_64
Erstellt: 2019/05/03 10:43 UTC
Status : Stopped
Type: persistent
Profile: default

Protokoll:

root@hphost03:~# lxc info
config:
  core.https_address: '[::]:8443'
  core.proxy_http: http://16.16.1.1:3128
  core.proxy_https: http://16.16.1.1:3128
  core.trust_password: true
api_extensions:
- id_map
- id_map_base
- resource_limits
api_status: stable
api_version: "1.0"
auth: trusted
auth_methods: []
public: false
environment:
  addresses:
  - 172.16.1.10:8443
  - 10.16.3.219:8443
  - 10.16.3.6:8443
  - 10.16.3.40:8443
  - 10.16.3.76:8443
  - 192.168.100.1:8443
  - 10.0.3.1:8443
  architectures:
  - x86_64
  - i686
  certificate: |
    -----BEGIN CERTIFICATE-----
    MIIFSTCCAzGgAwIBAgIQB7Il6B8NMYjwYwmUtM2AFDANBgkqhkiG9w0BAQsFADA1
    MRwwGgYDVQQKExNsaW51eGNvbnRhaW5lcnMub3JnMRUwEwYDVQQDDAxyb290QHVu
    a25vd24wHhcNMTkwMzI3MTUzNzM0WhcNMjkwMzI0MTUzNzM0WjA1MRwwGgYDVQQK
    ExNsaW51eGNvbnRhaW5lcnMub3JnMRUwEwYDVQQDDAxyb290QHVua25vd24wggIi
    MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCz5+SlAwwwAP8l8osX4lzrVvjy
    8sXnSFrdwVEGC2hpupygW+N2p/a5Qfi9Fl/UXH52FSQSYI/DlbcXIQm52bS6fB1/
    RyHBb+Jc6yft/jk55qL2PO4hBWQg/lrY3YKe2GKMzocKJwgPWcjSesjfCszV0HHu
    TuOHJa74oP7mU7Ibm5BY3sFjFF0pmUPSY9QvpFY/QZU90ZJ4CPHqEQ4qTMzQ2TgF
    T8n0gQr4MYa24+m9OypmQQCVECvQJld5r/T6knMQP/JuMAwVrMNSOXOqYQvBtDG9
    exZEhEFuF6HcML3vDg5JhmrwU8m+WDkezYHB3OfURcACBwQeWfwuLzTLv17AKoOx
    Fv/BDZ+wmHIjJ8ktn5Y5OuUaFcYv7vfqkIOCuYGtKM0A/cSUaY/p8A6Fx80xk0Vn
    bmj0/3oA0VO6GXRM7ciue/IPq/AK3wCFmBU/wHMHaq+LGXldrtacPveNaEAbN6WM
    /R2S2Hoo0+n2JcW/U3t+xn/+VYJPr1n9NvNq8QztKxEcxHD9BjlUyMJ5eGDhyou/
    +UcAVN/Hpt9P0iFsa2eouwaNoegKj1+CkDZhXPUZhNBPpOWV0UQx0opKkBFPv6Vm
    Q9hmkQ/OMTUXewdj0pJQQVdi3l/H3AQwZLw6woIdBJQBoac/l6Ye1Wy1/JMSC5Sg
    oiEIaUCmt+BT6xyCMQIDAQABo1UwUzAOBgNVHQ8BAf8EBAMCBaAwEwYDVR0lBAww
    CgYIKwYBBQUHAwEwDAYDVR0TAQH/BAIwADAeBgNVHREEFzAVggd1bmtub3duhwSs
    EAEKhwQKEAPbMA0GCSqGSIb3DQEBCwUAA4ICAQAVuR5STDOvTLCiQmvneHFVfmkP
    NFXQw8vulr4GmF2m/gD2Si3ruU+WsgwjAe11QBr/9yD9C5VNuJxppXVxZS6qDoID
    DPF8i0B550RtdUGU3kGo3wGGq+XZbZGAJXun8pue9SSdDUngz4G9nAVH3NjeY+xY
    6O5w92uiiocPgZmTgbMwhxCKjUoJGtKZaVCTb8ANzonFjF/2k1HAOm++GM143Hq0
    ge384b+eAADJdKvXPfGzyr6hY3rY6xRpaNz+wnJZwBkxuZ3RTt3zwX2pwmEMqu5M
    KJIJKb0HD9fq3AfbcrAZN7pPfCOaflPnitvyPDQ1foyWmgQ4BB0vpdKzlV6P95a2
    1eTOchsfURtlY65s/DidC1k+/cNboRXlUxJOdP75c3H18eQeckwyoiQpSfPqW61C
    e/ewcvScvhUnAntJGY5U6szvHUsk3QmhfS5nI+xud4N0+ELtWpEW40NEx7hJhk2j
    dixl/nTRudrOjAgOR6FENvNVrzC0OmIKOhc2l0HpKktwDCi3CIQHRWguPmLHCqcJ
    zQGJ3LizBLHlTt8DW0fyO9isul47RrCoTaUGeKSDiLcAGG0KdTBOTU0q/oRfrxRc
    naKi7vLb8Icz6nGQRG9BsGkCXDYrDwT9bcCUrRT8g+Em09piFBN6iQ+xZj7k1NOV
    KbVRluZjNTZbhoeEYA==
    -----END CERTIFICATE-----
  certificate_fingerprint: 4c2ab733929c87df3dcf06d9b03980f4c35686cc65a21fc827a8a70ba7e2fc8d
  driver: lxc
  driver_version: 2.0.8
  kernel: Linux
  kernel_architecture: x86_64
  kernel_version: 4.4.0-143-generic
  server: lxd
  server_pid: 11029
  server_version: 2.0.11
  storage: dir
  storage_version: ""
root@hphost03:~#  lxc config show test2 --expanded
architecture: x86_64
config:
  environment.http_proxy: ""
  user.network_mode: ""
  volatile.apply_template: create
  volatile.base_image: 5b72cf46f628b3d60f5d99af48633539b2916993c80fc5a2323d7d841f66afbe
  volatile.eth0.hwaddr: 00:16:3e:71:83:ac
  volatile.idmap.base: "0"
  volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
  volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: lxdbr0
    type: nic
  root:
    path: /
    type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""
root@hphost03:~# lxc config show test1 --expanded
architecture: x86_64
config:
  environment.http_proxy: ""
  user.network_mode: ""
  volatile.base_image: 663f6663aed66a22dd708c4b07514748221522b810008c55002fcc1dd81af377
  volatile.eth0.hwaddr: 00:16:3e:6f:3d:63
  volatile.idmap.base: "0"
  volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},                             {"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
  volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":6                             5536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
  volatile.last_state.power: STOPPED
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: lxdbr0
    type: nic
  root:
    path: /
    type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""


architecture: x86_64
config:
  environment.http_proxy: ""
  user.network_mode: ""
  volatile.base_image: 663f6663aed66a22dd708c4b07514748221522b810008c55002fcc1dd81af377
  volatile.eth0.hwaddr: 00:16:3e:88:ce:43
  volatile.idmap.base: "0"
  volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
  volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
  volatile.last_state.power: RUNNING
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: lxdbr0
    type: nic
  root:
    path: /
    type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""

(Stéphane Graber) #2

What’s in /var/log/lxd/test2/lxc.conf and /var/log/lxd/test2/lxc.log?


#3

Hi!

Generally, the message error: Error opening startup config file: “loading config file for the container failed” indicates that something is wrong with the configuration. For example, you may be running the deb LXD and the snap LXD at the same time? Or, the upgrade from deb to snap did not complete properly?

The message adds Versuchen Sie lxc info --show-log test2 um mehr Informationen zu erhalten, therefore you can give the output of that as well.

I noticed that the container has an IP address of the range 192.168.x.y while the host has a 10.x.y.z IP address. Often it is the other way round. Can you describe your LXD setup, adding info on how it would differ from a stock LXD installation?


#4

This is test2/lxc.config:

lxc.cap.drop = sys_time sys_module sys_rawio
lxc.mount.auto = proc:rw sys:rw
lxc.autodev = 1
lxc.pts = 1024
lxc.mount.entry = /dev/fuse dev/fuse none bind,create=file,optional
lxc.mount.entry = /dev/net/tun dev/net/tun none bind,create=file,optional
lxc.mount.entry = /proc/sys/fs/binfmt_misc proc/sys/fs/binfmt_misc none rbind,create=dir,optional
lxc.mount.entry = /sys/fs/fuse/connections sys/fs/fuse/connections none rbind,create=dir,optional
lxc.mount.entry = /sys/fs/pstore sys/fs/pstore none rbind,create=dir,optional
lxc.mount.entry = /sys/kernel/debug sys/kernel/debug none rbind,create=dir,optional
lxc.mount.entry = /sys/kernel/security sys/kernel/security none rbind,create=dir,optional
lxc.mount.entry = /dev/mqueue dev/mqueue none rbind,create=dir,optional
lxc.include = /usr/share/lxc/config/common.conf.d/
lxc.logfile = /var/log/lxd/test2/lxc.log
lxc.loglevel = warn
lxc.arch = linux64
lxc.hook.pre-start = /usr/bin/lxd callhook /var/lib/lxd 5 start
lxc.hook.post-stop = /usr/bin/lxd callhook /var/lib/lxd 5 stop
lxc.tty = 0
lxc.utsname = test2
lxc.mount.entry = /var/lib/lxd/devlxd dev/lxd none bind,create=dir 0 0
lxc.aa_profile = lxd-test2_</var/lib/lxd>//&:lxd-test2_:
lxc.seccomp = /var/lib/lxd/security/seccomp/test2
lxc.id_map = u 0 100000 65536
lxc.id_map = g 0 100000 65536
lxc.environment = http_proxy=
lxc.rootfs.backend = dir
lxc.rootfs = /var/lib/lxd/containers/test2/rootfs
lxc.network.0.type = veth
lxc.network.0.flags = up
lxc.network.0.link = lxdbr0
lxc.network.0.hwaddr = 00:16:3e:71:83:ac
lxc.network.0.name = eth0
lxc.mount.entry = /var/lib/lxd/shmounts/test2 dev/.lxd-mounts none bind,create=dir 0 0

The lxc.log file is empty.

The version is:
root@hphost03:~# lxc --version
2.0.11
root@hphost03:~# lxd --version
2.0.11
root@hphost03:~# which lxd lxc
/usr/bin/lxd
/usr/bin/lxc


(Stéphane Graber) #5

@brauner any idea?


(Christian Brauner) #6

The mount entries look unclean. They should all have a 0 0 at the end. Depending on the libc version the mountent parser will otherwise fail.


#7

Thank You for reply. What can I do for cleaning the entries?