Skip to content

DB migrations fail with multiple Coderd replicas #8210

Closed
@spikecurtis

Description

@spikecurtis

When starting a new Coder deployment with multiple replicas, they can fail to start throwing an error during DB migration:

│ running command "coder server": connect to postgres:                                                                                                                                                                                  │
│     github.com/coder/coder/cli.(*RootCmd).Server.func1                                                                                                                                                                                │
│         /home/runner/actions-runner/_work/coder/coder/cli/server.go:596                                                                                                                                                               │
│   - migrate up:                                                                                                                                                                                                                       │
│     github.com/coder/coder/cli.connectToPostgres                                                                                                                                                                                      │
│         /home/runner/actions-runner/_work/coder/coder/cli/server.go:1814                                                                                                                                                              │
│   - up:                                                                                                                                                                                                                               │
│     github.com/coder/coder/coderd/database/migrations.Up                                                                                                                                                                              │
│         /home/runner/actions-runner/_work/coder/coder/coderd/database/migrations/migrate.go:81                                                                                                                                        │
│   - Dirty database version 74. Fix and force version.

Metadata

Metadata

Assignees

Labels

s1Bugs that break core workflows. Only humans may set this.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions