meolu / walle-web

walle - 瓦力 Devops开源项目代码部署平台
https://walle-web.io
Apache License 2.0
11.85k stars 2.76k forks source link

使用 docker-compose 部署时,提示 : Could not import "waller". #584

Open zhangyile opened 5 years ago

zhangyile commented 5 years ago

问题: 使用 docker-compose 部署时,提示 Error: Could not import "waller". Migration: [ fail ]

解决: 在 docker-compose.yml 中的找到 python ,然后修改 command: bash -c "/bin/bash /opt/walle-web/admin.sh migration && python /opt/walle-web/waller.py" =======>>> command: bash -c "cd /opt/walle-web/ && sleep 10 && /bin/bash /opt/walle-web/admin.sh migration && python /opt/walle-web/waller.py"

就是在启动命令前加上一句 cd /opt/walle-web/ && sleep 10

sleep 10 是为了等待 db 加载完成后再启动 flask ,否则会报

walle-python | sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (2003, 'Can\'t connect to MySQL server on \'db\' (111 "Connection refused")') (Background on this error at: http://sqlalche.me/e/e3q8)
walle-python | Migration:                 [ fail ]
walle-python | ************************************************
rmrfself commented 5 years ago

加了这个延时也不行呢。

zhangyile commented 5 years ago

加了这个延时也不行呢。

重新单独重启一下 waller-python 就好了 ,docker container restart walle-python, 如果重启后还是有报错,那就不是数据库加载的问题了,是你哪配置的不对