当前位置:论坛首页 > BUG提交 > Linux面板

docker更新compose失败

发表在 BUG提交2024-3-21 18:10 [复制链接] 2 1710



更新时提示【模板内容格式错误,请输入有效的docker-compose模板!】,创建时能正常创建


  1. <blockquote>services:
复制代码
排除是因为version字段原因,填了version字段后提示【
检测失败: time="2024-03-21T18:10:00+08:00" level=warning msg="/www/server/panel/data/compose/nacos/template/nacos.yaml: `version` is obsolete"
使用道具 举报 只看该作者 回复
发表于 2024-6-12 14:10:56 | 显示全部楼层
同样的错误,感觉是面板有bug

同样的内容,创建时是可以的。但在已创建的模板中,更改,就提示错误
使用道具 举报 回复 支持 1 反对 0
发表于 2024-3-21 18:22:34 | 显示全部楼层
手动创建容器也报错
出错了,面板运行时发生错误!
docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.45/containers/create?name=nacos: Bad Request ("invalid restart policy: maximum retry count can only be used with 'on-failure'")
REQUEST_DATE: 2024-03-21 18:21:34
  VERSION: CentOS  7.9.2009 x86_64(Py3.7.9)  -   8.0.5
REMOTE_ADDR: 182.139.36.102
REQUEST_URI: POST /btdocker/container/run?
REQUEST_FORM: {'data': '{"name":"nacos","image":"nacos/nacos-server:latest","publish_all_ports":"0","ports":{"8848/tcp":"18848","9848/tcp":"19848"},"network":"bridge","ip_address":"","command":"","entrypoint":"","auto_remove":"0","privileged":"1","restart_policy":{"Name":"unless-stopped","MaximumRetryCount":5},"mem_reservation":"2048MB","cpu_quota":0.5,"mem_limit":"2048MB","labels":"","environment":"PREFER_HOST_MODE=hostname\\nMODE=standalone\\nSPRING_DATASOURCE_PLATFORM=mysql\\nMYSQL_SERVICE_HOST=\'docker.internal.krismile.cn\'\\nMYSQL_SERVICE_DB_NAME=nacos\\nMYSQL_SERVICE_PORT=13306\\nMYSQL_SERVICE_USER=nacos\\nMYSQL_SERVICE_PASSWORD=fmEjb5a4KWSXBhP5\\nMYSQL_SERVICE_DB_PARAM=\'characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true\'","remark":"","volumes":{"nacos-log":{"bind":"/home/nacos/logs","mode":"rw"}},"tty":"1","stdin_open":"1"}'}
  USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Traceback (most recent call last):
  File "/www/server/panel/BTPanel/__init__.py", line 2319, in publicObject
    res = run_obj.run(toObject, defs, get)
  File "/www/server/panel/BTPanel/__init__.py", line 2266, in run
    result = getattr(toObject, get.action)(get)
  File "class/panelController.py", line 86, in model
    raise public.PanelError(result['msg'])
public.PanelError: 面板运行时发生错误: 创建失败! Traceback (most recent call last):
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/docker/api/client.py", line 268, in _raise_for_status
    response.raise_for_status()
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.45/containers/create?name=nacos

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/www/server/panel/class/btdockerModel/containerModel.py", line 223, in run
    network=network,
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/docker/models/containers.py", line 812, in run
    detach=detach, **kwargs)
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/docker/models/containers.py", line 870, in create
    resp = self.client.api.create_container(**create_kwargs)
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/docker/api/container.py", line 430, in create_container
    return self.create_container_from_config(config, name)
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/docker/api/container.py", line 441, in create_container_from_config
    return self._result(res, True)
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/docker/api/client.py", line 274, in _result
    self._raise_for_status(response)
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/docker/api/client.py", line 270, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.45/containers/create?name=nacos: Bad Request ("invalid restart policy: maximum retry count can only be used with 'on-failure'")
很抱歉,面板运行时意外发生错误,请尝试按以下顺序尝试解除此错误:
修复方案一:在[首页]右上角点击修复面板,并退出面板重新登录。尝试点击修复
修复方案二:如上述尝试未能解除此错误,请截图此窗口到宝塔论坛发贴寻求帮助, 论坛地址:https://www.bt.cn/bbs
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

立即付费处理

工作时间:09:00至24:00

快速回复 返回顶部 返回列表