goauthentik / goauthentik/authentik

Read replica support on initial deploy broken

Open
#15,191 4 comments 1 reaction 1 assignee Claimed by @rissson View on GitHub
bug status/reviewing
Dominant language
Python
Stars
25.6k
Forks
2k
Avg merge
1d 2h
Merged PRs (30d)
651

Description

**Describe the bug**
When deploying Authentik with [Postgres read replica support](https://docs.goauthentik.io/docs/install-config/configuration/#read-replicas) on first deploy the database migrations fail and the instance comes up with the "Not found screen".
Deploying Authentik without read replica support to let the migrations finish and then adding read replica support by redeploying the container is a work-around. But this makes deployment via CI/CD pipeline very painful.

This has previously been reported in these issues, but has still not been fixed:
#14319 #9866 #6712 #2559

**To Reproduce**
Steps to reproduce the behavior:

1. Configure Authentik initially with read replicas enabled
2. Deploy Authentik (first deployment)
3. Wait for Authentik to fully deploy (database migrations appear to run correctly)
4. Open Authentik web site and see "Not found" error

**Expected behavior**
Authentik should fully deploy without any errors (as it does with Read Replicas disabled)

**Screenshots**

![Image](https://github.com/user-attachments/assets/442a4a4f-49d7-48ec-b905-b829ff382fe2)

**Logs**
Nothing relevant in the logs that I can find. The migrations all appear to run without any errors.

**Version and Deployment (please complete the following information):**

- authentik version: [e.g. 2025.2.0] 2025.6.2
- Deployment: [e.g. docker-compose, helm] AWS CloudFormation with additional env variables to configure read replicas

**Additional context**
Values being set for the read replica configuration are:
AUTHENTIK_POSTGRESQL__READ_REPLICAS__0__HOST:
AUTHENTIK_POSTGRESQL__READ_REPLICAS__0__NAME: 'authentik'
AUTHENTIK_POSTGRESQL__READ_REPLICAS__0__PORT: '5432'
AUTHENTIK_POSTGRESQL__READ_REPLICAS__0__USER:
AUTHENTIK_POSTGRESQL__READ_REPLICAS__0__PASSWORD:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.