
alist-strm报错flask无法启动
起因
一直在用alist-strm,这几天编辑了一下Docker容器就无法正常启动了报错可以参考一下
/usr/lib/python3/dist-packages/supervisor/options.py:474: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
self.warnings.warn(
2025-08-01 14:01:34,635 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
2025-08-01 14:01:34,637 INFO supervisord started with pid 1
2025-08-01 14:01:35,645 INFO spawned: 'cron' with pid 7
2025-08-01 14:01:35,649 INFO spawned: 'flask' with pid 8
2025-08-01 14:01:36,669 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-08-01 14:01:36,670 INFO success: flask entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-08-01 14:01:36,670 WARN exited: flask (exit status 1; not expected)
2025-08-01 14:01:37,676 INFO spawned: 'flask' with pid 9
2025-08-01 14:01:38,612 WARN exited: flask (exit status 1; not expected)
2025-08-01 14:01:39,618 INFO spawned: 'flask' with pid 10
2025-08-01 14:01:40,574 WARN exited: flask (exit status 1; not expected)
2025-08-01 14:01:42,581 INFO spawned: 'flask' with pid 11
2025-08-01 14:01:43,448 WARN exited: flask (exit status 1; not expected)
2025-08-01 14:01:46,456 INFO spawned: 'flask' with pid 12
2025-08-01 14:01:47,422 WARN exited: flask (exit status 1; not expected)
2025-08-01 14:01:48,424 INFO gave up: flask entered FATAL state, too many start retries too quickly
重新拉取镜像还是有问题,而且日志少的可怜,根本看不出是是什么阻止了程序启动
解决
进入容器看看能不能找到描述更细的日志
docker exec -it <容器ID或名称> /bin/bash # 默认使用Bash,还需要替换一下自己的容器名称
进入logs文件夹,找到了flask.out.log 发现是解压文件错误(file is not a zip),更懵了,因为不知道为什么会解压文件,只能翻源码。这是用python写的,源码就是app.py.
发现这个应用每次启动就会检查更新,但是作者维护的更新地址有问题了,所以才报错,所以我们这里禁用更新就行,在源码最下面把的check_and....这一行注解掉就可以
可能会用到的命令
#安装文本编辑器
apt-get update
apt-get install vim
#进入容器终端
docker exec -it <容器ID> /bin/bash
#进入指定目录
docker exec -it <容器ID> bash -c "cd /path && bash"
#宿主机复制容器文件
docker cp <容器ID>:/path/file ./<宿主机存放目录>
评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果