如何修复 Quay Exception("Missing DATABASE_SECRET_KEY in config; did you perhaps forget to add it?")
问题
启动 quay 容器仓库时,你看到以下异常:
quay_traceback.txt
Traceback (most recent call last):
File "/quay-registry/conf/init/data_migration.py", line 4, in <module>
from app import app
File "/quay-registry/app.py", line 328, in <module>
raise Exception("Missing DATABASE_SECRET_KEY in config; did you perhaps forget to add it?")
Exception: Missing DATABASE_SECRET_KEY in config; did you perhaps forget to add it?quay 然后在无限循环中重启
解决方案
根据官方配置字段文档,此字段用于加密数据库中的敏感字段。
因此,我们可以使用任何字符串。因此,我建议使用以下命令生成随机密码
generate_db_secret.sh
pwgen 30 1或类似工具并将其附加到 config.yaml:
config.gettyaml
DATABASE_SECRET_KEY: 'aiGh2eg2CheigiYiph2oFaith0iqua'之后,重启 Quay,错误应该消失
Check out similar posts by category:
Docker
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow