How to fix Quay Exception("Missing DATABASE_SECRET_KEY in config; did you perhaps forget to add it?")

Problem

When starting up the quay container registry, you see the following exception:

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 then restarts in an infinite loop

Solution

According to the official config fields documentation this field is used to encrypt sensitive fields within the database.

Therefore, we can use any string. Therefore, I recommmend to generate a random password using

pwgen 30 1

or similar tools and appending it to config.yaml:

DATABASE_SECRET_KEY: 'aiGh2eg2CheigiYiph2oFaith0iqua'

After that, restart Quay and the error should disappear