😢

Proxmox上のCTでDockerを動かしていたら突然全Dockerコンテナが止まった話

に公開

環境について

Proxmox

CPU 8 x Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz (1 ソケット)
RAM 32 GB
カーネルバージョン Linux 6.8.12-5-pve (2024-12-03T10:26Z)
Bootモード EFI (Secure Boot)
マネージャバージョン pve-manager/8.3.2/3e76eec21c4a14a7

CT

PRETTY_NAME="Ubuntu 24.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.3 LTS (Noble Numbat)"
CPU 3コア
メモリ 8GB

問題の発生

先日,Proxmox上のCT内でCTFdの問題作成を行っていたところ,突然接続が切れてしまった.

VSCodeでCTに接続したところ,どういう訳か全てのDockerコンテナが停止していた.

全コンテナが停止している

docker compose upを試みるも...

ひとまず再起動試みるも...

再起動を試みるも

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open sysctl net.ipv4.ip_unprivileged_port_start file: reopen fd 8: permission denied: unknown

というエラーが出て起動できない.

下記,最も簡単なhello-worldイメージで試しても同様のエラーが出た.

docker run hello-world

hello-world

試した対処法

ひとまず,CTやProxmoxホストマシンの再起動を試みるも改善せず...

docker system prune -aも試すが,変化がなし...

検索してみると

この問題について検索してみると,GithubにていくつかIssueが立っていることが分かった.

Docker container don't start after update from v2.12.6 --> v2.13.1

Docker/Komodo Install Error - failed to create task for container

内容を確認すると, AppArmor関係が原因であるということが分かり,有識者が下記のコメントを残していた

https://github.com/community-scripts/ProxmoxVE/issues/8890#issuecomment-3492891975

Are you good in Proxmox?

Can you try following:

pct stop CTID

nano /etc/pve/lxc/CTID.conf

Add below:
lxc.apparmor.profile: unconfined

pct start CTID

Go into LXC, /opt/komodo and hit docker compose up -d

AppArmorの設定を変更してみる

上記のコメントを参考に,AppArmorの設定を変更してみた.

alt text

docker: Error response from daemon: Could not check if docker-default AppArmor profile was loaded: open /sys/kernel/security/apparmor/profiles: permission denied

Run 'docker run --help' for more information

AppArmorのプロファイルが読み込めないというエラーが出た.

containerd.io関係のエラー?

冷静にGithubのIssueを見返すと,containerd.io関係のエラーが出ていることが分かった.

https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4849#issuecomment-3495904254

そのため,containerd.ioのダウングレードを試みた

1.7.29-1~ubuntu.24.04~noble1.7.28-1~ubuntu.24.04~noble

ooo@ctf:/home/ooo/llm# cd
ooo@ctf:~# apt install  containerd.io
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
containerd.io is already the newest version (1.7.29-1~ubuntu.24.04~noble).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

ooo@ctf:~# apt install containerd.io=1.7.28-1~ubuntu.24.04~noble
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be DOWNGRADED:
  containerd.io
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 31.9 MB of archives.
After this operation, 119 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 https://download.docker.com/linux/ubuntu noble/stable amd64 containerd.io amd64 1.7.28-1~ubuntu.24.04~noble [31.9 MB]
Fetched 31.9 MB in 0s (82.8 MB/s)      
dpkg: warning: downgrading containerd.io from 1.7.29-1~ubuntu.24.04~noble to 1.7.28-1~ubuntu.24.04~noble
(Reading database ... 21097 files and directories currently installed.)
Preparing to unpack .../containerd.io_1.7.28-1~ubuntu.24.04~noble_amd64.deb ...
Unpacking containerd.io (1.7.28-1~ubuntu.24.04~noble) over (1.7.29-1~ubuntu.24.04~noble) ...
Setting up containerd.io (1.7.28-1~ubuntu.24.04~noble) ...
Processing triggers for man-db (2.12.0-4build2) ...

その後,CTを再起動したところ...

復活!!

復活していた(歓喜)

(crontabにdocker compose up -dを仕込んでいたため,自動で起動していた)

まとめ

container.io関係のパッケージが原因であるので,いったんダウングレードを行えばOK

20251124追記

ダウングレードしたcontainerd.ioのバージョンを固定する方法

containerd.ioのバージョン固定について,Bacalhauさんが記事にて取り上げていただいていたので,僭越ながら引用させていただきます.

https://qiita.com/Bacalhau/items/96cfb54d9de7ebd65ffa

おまけ: container.io のダウングレードでも対応できる
以下の記事に記載されている通り、container.io のダウングレードでも対応できるので、
この方法で対応する場合、以下のように container.io が apt upgrade でアップデートされないように固定する。

sudo apt-mark hold container.io

上記の apt-mark hold の設定を解除するには以下のコマンドを実行。

sudo apt-mark hold container.io

以下の記事でも containerd.io のバージョンを 1.7.28 1 に固定することで、Docker が実行できない問題に対応している。

ありがとうございました!!

2.1.5-1での動作確認

2025年11月24日現在,containerd.ioの最新版は2.1.5-1となっているが,こちらでも問題が解消されていない模様.

AppArmorの設定を変更することで,解消する例があるようなので,参考リンクを掲載しておきます.

https://zenn.dev/haru_iida/articles/proxmox-lxc-docker-apparmor-fix#設定内容の詳細

https://github.com/community-scripts/ProxmoxVE/issues/8890#issuecomment-3498543091

Proxmoxのアップグレードが必要...?

議論の中に下記のようなコメントがあった(読みやすいように改行を追加しています)

sadly lxc-pve 6.0.5-3 isnt available on proxmox 8.4
edit:
Hello world, this is for the next sorry sucker who finds this issue on here.
My solution was to update Proxmox to 9, thankfully no issues with my upgrade. 
But as of today the 19th of November, PVE 9.1 came out and some scripts, 
for example the post-install script, don't support anything but 8.x and 9.0. 
Therefore you may have some issues with other things today.
Also I want to mention this problem with Docker in an LXC was not limited to 
Debian or Ubuntu but also affected my systems running Alpine.
After manually starting Docker on each container again I'm back in business.

https://github.com/community-scripts/ProxmoxVE/issues/8890#issuecomment-3553869082

解決策としてProxmoxを9にアップグレードすることが挙げられている.

こちらについては後日検証しようと思う.

(また,記事内の誤字を修正しました)

20251126追記

本件根本的に解決できる策が判明したため,改めて記事を執筆しました.

https://zenn.dev/yama_seasky/articles/df40a79abe4295

Discussion