Internal server error when logging in via GitLab OAuth

My version of HedgeDoc is: 1.8.2, running through the docker image quay.io/hedgedoc/hedgedoc:1.8.2. I’m using postgres as database, version 11.6.

What I expected to happen:

The login is successful, and the user’s last files are shown.

What actually happened:

Internal server error is displayed, and the login is not successful (when loading the index page, the user is not logged in).

I already tried:

I found a similar post, but I don’t think that it is related (logs show different internal errors).

After reading that post, reviewed that the configuration matches the documentation.

The logs show a SequelizeUniqueConstraintError, but that is not much to go on (at least for me). The relevant error log from the server is:

codimd_1    | 2021-07-14T23:34:20.952Z error: 	auth callback failed: SequelizeUniqueConstraintError: Validation error
codimd_1    | SequelizeUniqueConstraintError: Validation error
codimd_1    |     at Query.formatError (/hedgedoc/node_modules/sequelize/lib/dialects/postgres/query.js:324:18)
codimd_1    |     at /hedgedoc/node_modules/sequelize/lib/dialects/postgres/query.js:113:24
codimd_1    |     at tryCatcher (/hedgedoc/node_modules/bluebird/js/release/util.js:16:23)
codimd_1    |     at Promise._settlePromiseFromHandler (/hedgedoc/node_modules/bluebird/js/release/promise.js:547:31)
codimd_1    |     at Promise._settlePromise (/hedgedoc/node_modules/bluebird/js/release/promise.js:604:18)
codimd_1    |     at Promise._settlePromise0 (/hedgedoc/node_modules/bluebird/js/release/promise.js:649:10)
codimd_1    |     at Promise._settlePromises (/hedgedoc/node_modules/bluebird/js/release/promise.js:729:18)
codimd_1    |     at _drainQueueStep (/hedgedoc/node_modules/bluebird/js/release/async.js:93:12)
codimd_1    |     at _drainQueue (/hedgedoc/node_modules/bluebird/js/release/async.js:86:9)
codimd_1    |     at Async._drainQueues (/hedgedoc/node_modules/bluebird/js/release/async.js:102:5)
codimd_1    |     at Immediate.Async.drainQueues [as _onImmediate] (/hedgedoc/node_modules/bluebird/js/release/async.js:15:14)
codimd_1    |     at processImmediate (node:internal/timers:464:21)