Skip to content

Check storage readiness and show meaningful error message when DB is busy #26011

Closed
@aku

Description

@aku

Feature Description

I've tried to install Gitea with PostgreSQL storage via Helm chart and faced the following problem.
When you try to access Gitea right after it has been installed, some actions will fail with 500 errors because PostgreSQL is doing some replication/recovery.

It would be nice to add some sort of DB readiness check and show a meaningful error explaining that we need to wait for some time until the DB is ready

Example of error in a log file:

2023/07/20 08:09:19 ...ers/web/auth/auth.go:543:createUserInContext() [E] CreateUser: pq: cannot set transaction read-write mode during recovery
2023/07/20 08:09:19 ...eb/routing/logger.go:102:func1() [I] router: completed POST /user/sign_up for 10.244.0.1:1504, 500 Internal Server Error in 0.8ms @ auth/auth.go:405(auth.SignUpPost)

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions