テクノロイド

コンピュータやゲーム他、色々日々思ったことをつづっていきます。

いつの間にかLXD2.0コンテナが起動できなくなってた[解決]

2018-11-08 02:38:15 | LXC/LXD,コンテナ,snaps
$ lxc list
+------------+---------+------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------------+---------+------+------+------------+-----------+
| u1810 | STOPPED | | | PERSISTENT | 0 |
+------------+---------+------+------+------------+-----------+
$ lxc start u1810
エラー: Error calling 'lxd forkstart u1810 /var/lib/lxd/containers /var/log/lxd/u1810/lxc.conf': err='Failed to run: /usr/bin/lxd forkstart u1810 /var/lib/lxd/containers /var/log/lxd/u1810/lxc.conf: '
lxc 20181107173945.719 ERROR lxc_conf - conf.c:setup_rootfs_pivot_root:997 - Permission denied - Error opening old-/ for fchdir
lxc 20181107173945.719 ERROR lxc_conf - conf.c:setup_pivot_root:1338 - failed to pivot root
lxc 20181107173945.719 ERROR lxc_conf - conf.c:lxc_setup:4076 - failed to set rootfs for 'u1810'
lxc 20181107173945.719 ERROR lxc_start - start.c:do_start:811 - Failed to setup container "u1810".
lxc 20181107173945.719 ERROR lxc_sync - sync.c:__sync_wait:57 - An error occurred in another process (expected sequence number 3)
lxc 20181107173945.770 ERROR lxc_start - start.c:__lxc_start:1358 - Failed to spawn container "u1810".
lxc 20181107173946.338 ERROR lxc_conf - conf.c:run_buffer:416 - Script exited with status 1.
lxc 20181107173946.338 ERROR lxc_start - start.c:lxc_fini:546 - Failed to run lxc.hook.post-stop for container "u1810".
更に情報を得るために `lxc info --show-log u1810` を実行してみてください
$ lxd --version
2.0.11
$ lsb_release -r
Release: 16.04
ーー
このマシンで最近やったことと言えば、Android-x86入れて、Ubuntu上で動かしてみようかとQEMU入れたことかなあ。関係ありそう。
ちょっと対処法が見つからない。/etcのsubuidやsubgid、passwdとかgroup辺りなのかなって気がするけど。
snapdのLXDだったら影響受けないのかな?

追記)
subuidとかgroupはおかしくないようだったし、新たにlxc launch ubuntu:18.10 u1810で作成しても起動できなかった。
$ systemctl status lxd
● lxd.service - LXD - main daemon
Loaded: loaded (/lib/systemd/system/lxd.service; indirect; vendor preset: ena
Active: inactive (dead)
Docs: man:lxd(1)
$ lxc start u16
エラー: Error calling 'lxd forkstart u16 /var/lib/lxd/containers /var/log/lxd/u16/lxc.conf': err='Failed to run: /usr/bin/lxd forkstart u16 /var/lib/lxd/containers /var/log/lxd/u16/lxc.conf: '
lxc 20181123102249.530 ERROR lxc_conf - conf.c:setup_rootfs_pivot_root:997 - Permission denied - Error opening old-/ for fchdir
lxc 20181123102249.530 ERROR lxc_conf - conf.c:setup_pivot_root:1338 - failed to pivot root
lxc 20181123102249.530 ERROR lxc_conf - conf.c:lxc_setup:4076 - failed to set rootfs for 'u16'
lxc 20181123102249.530 ERROR lxc_start - start.c:do_start:811 - Failed to setup container "u16".
lxc 20181123102249.530 ERROR lxc_sync - sync.c:__sync_wait:57 - An error occurred in another process (expected sequence number 3)
lxc 20181123102249.603 ERROR lxc_start - start.c:__lxc_start:1358 - Failed to spawn container "u16".
lxc 20181123102250.182 ERROR lxc_conf - conf.c:run_buffer:416 - Script exited with status 1.
lxc 20181123102250.182 ERROR lxc_start - start.c:lxc_fini:546 - Failed to run lxc.hook.post-stop for container "u16".

更に情報を得るために `lxc info --show-log u16` を実行してみてください
$ systemctl status lxd
● lxd.service - LXD - main daemon
Loaded: loaded (/lib/systemd/system/lxd.service; indirect; vendor preset: enabled)
Active: active (running) since 金 2018-11-23 19:22:49 JST; 16s ago
Docs: man:lxd(1)
Process: 2946 ExecStartPost=/usr/bin/lxd waitready --timeout=600 (code=exited, status=0/SUCCESS)
Process: 2934 ExecStartPost=/usr/lib/lxd/profile-config (code=exited, status=0/SUCCESS)
Process: 2911 ExecStartPre=/usr/lib/x86_64-linux-gnu/lxc/lxc-apparmor-load (code=exited, status=0/SUCCESS)
Main PID: 2933 (lxd)
Tasks: 12
Memory: 31.5M
CPU: 1.190s
CGroup: /system.slice/lxd.service
├─2933 /usr/bin/lxd --group lxd --logfile=/var/log/lxd/lxd.log
└─3026 /usr/lib/x86_64-linux-gnu/lxc/lxc-monitord /var/lib/lxd/containers 6

11月 23 19:22:49 UN42 systemd[1]: Starting LXD - main daemon...
11月 23 19:22:49 UN42 lxd[2933]: lvl=warn msg="CGroup memory swap accounting is disabled, swap limits will be ignored." t=2018-11-23T19:22:49+0900
11月 23 19:22:49 UN42 systemd[1]: Started LXD - main daemon.
11月 23 19:22:50 UN42 lxd[2933]: container=u16 err="Container is already running a start operation" lvl=eror msg="stop hook failed" t=2018-11-23T19:22:50+0900
11月 23 19:22:55 UN42 lxd[2933]: action=start creation date=2018-11-22T19:33:12+0900 ephemeral=false lvl=eror msg="Failed starting container" name=u16 stateful=false t=2018-11-23

コンテナは起動してないのに、「コンテナが既に動いてる」からエラー???

追記2019.02:解決)
SSHサーバが起動しなくなって調査したらルートパーティションのオーナーとパーミッションがおかしくなっていた。
それで正常に直したので「ひょっとして?」とLXCコンテナが起動するか試してみたら見事起動した。
直って良かった。というか原因が分かって良かった!
$ ls -ld /
drwxr-xr-x 26 root root 4096 12月 21 13:30 /

最新の画像もっと見る

コメントを投稿