解决Proxmox容器升级Debian 10后无法启动的问题

本文记录了在Proxmox虚拟化环境中,Debian 10容器系统升级后无法启动的故障排查过程。通过分析LXC日志和Perl脚本版本检测逻辑,揭示了版本号识别机制的问题,并提供了官方更新和手动修复两种解决方案。

Proxmox Container with Debian 10 does not work after upgrade

2019年9月8日

我刚完成一个Debian 10容器的apt update/upgrade操作,重启后出现以下错误:

1
2
3
4
# pct start 105
Job for pve-container@105.service failed because the control process exited with error code.
See "systemctl status pve-container@105.service" and "journalctl -xe" for details.
command 'systemctl start pve-container@105' failed: exit code 1

使用更详细的启动参数后得到以下信息:

1
2
3
4
5
6
# lxc-start -n 105 -F -l DEBUG -o /tmp/lxc-ID.log
lxc-start: 105: conf.c: run_buffer: 335 Script exited with status 25
lxc-start: 105: start.c: lxc_init: 861 Failed to run lxc.hook.pre-start for container "105"
lxc-start: 105: start.c: __lxc_start: 1944 Failed to initialize container "105"
lxc-start: 105: tools/lxc_start.c: main: 330 The container failed to start
lxc-start: 105: tools/lxc_start.c: main: 336 Additional information can be obtained by setting the --logfile and --logpriority options

查看/tmp/lxc-ID.log日志文件发现具体问题:

1
2
3
lxc-start 105 20190908130857.595 DEBUG conf - conf.c:run_buffer:326 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 105 lxc pre-start with output: unsupported debian version '10.1'
lxc-start 105 20190908130857.604 ERROR conf - conf.c:run_buffer:335 - Script exited with status 25
lxc-start 105 20190908130857.604 ERROR start - start.c:lxc_init:861 - Failed to run lxc.hook.pre-start for container "105"

问题的根源在于Debian版本从10.0升级到10.1后,Proxmox脚本无法识别新版本号。相关代码位于/usr/share/perl5/PVE/LXC/Setup/Debian.pm文件中。

实际上我无需手动修改任何内容,只需要将Proxmox主机更新到最新小版本即可解决问题,因为开发人员已经在Debian.pm文件中修复了此问题。分享这个案例是因为错误报告在这种情况下不够明确,可能对其他遇到相同问题的用户有所帮助。

评论反馈

Frank Neuber (2019年9月12日): 感谢,这节省了我一天时间。需要修改/usr/share/perl5/PVE/LXC/Setup/Debian.pm文件第32行,将Debian版本支持上限改为11。

robert (2019年9月16日): 谢谢,我知道apt更新会按照你描述的方式修改文件。

Uwe Degenhardt (2022年3月16日): 嗨Robert!优秀的文章!谢谢你。这拯救了我的一天/夜晚。

comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计