Skip to content

Improve error when DB migrations fail #14248

Open
@angrycub

Description

@angrycub

When older coder executables encounter database schemas from newer builds that have newer migrations, they produce a somewhat inscrutable error that doesn't provide the user a meaningful call to action.

Current:

2024-08-12 17:51:10.327 [erro]  connect to postgres failed ...
    error= migrate up:
               github.com/coder/coder/v2/cli.ConnectToPostgres
                   /home/runner/work/coder/coder/cli/server.go:2157
             - up:
               github.com/coder/coder/v2/coderd/database/migrations.UpWithFS
                   /home/runner/work/coder/coder/coderd/database/migrations/migrate.go:82
             - no migration found for version 237: read down for version 237 .: file does not exist

Proposal:

2024-08-12 17:51:10.327 [erro]  connect to postgres failed ...
    error= Current database requires Coder version 2.14.0 or greater

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliArea: CLIobservabilityIssues related to observability (metrics, dashboards, alerts, opentelemetry)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions