Skip to content

Migration MySQL error on start: Error 1061 (42000): Duplicate key name 'idx_services_domain' #5562

@th3-sh0w3r

Description

@th3-sh0w3r

Describe the problem

In tonights update (I have automatic updates enabled via watchtower in composer) the netbird-server breaks because of this:

2026-03-10T08:43:16.498Z INFO combined/cmd/root.go:289: Management server created
2026-03-10T08:43:16.499Z INFO combined/cmd/root.go:305: Signal server created
2026-03-10T08:43:16.500Z INFO management/server/store/store.go:369: using MySQL store engine
2026-03-10T08:43:16.522Z INFO management/server/store/sql_store.go:104: Setting transaction timeout to 5m0s
2026-03-10T08:43:16.522Z INFO management/server/store/sql_store.go:118: Set max open db connections to 2, max idle to 2, max lifetime to 1h0m0s, max idle time to 3m0s
2026-03-10T08:43:16.561Z INFO management/server/migration/migration.go:263: No plain setup keys found in table setup_keys, no migration needed
2026-03-10T08:43:16.561Z INFO management/server/migration/migration.go:301: Migration of plain setup key to hashed setup key completed
2026-03-10T08:43:16.567Z INFO management/server/migration/migration.go:344: No rows with empty enabled found in table network_resources, no migration needed
2026-03-10T08:43:16.568Z INFO management/server/migration/migration.go:358: Migration of empty enabled to default value in table network_resources completed
2026-03-10T08:43:16.574Z INFO management/server/migration/migration.go:344: No rows with empty enabled found in table network_routers, no migration needed
2026-03-10T08:43:16.575Z INFO management/server/migration/migration.go:358: Migration of empty enabled to default value in table network_routers completed
2026-03-10T08:43:16.601Z INFO management/server/migration/migration.go:344: No rows with empty name found in table users, no migration needed
2026-03-10T08:43:16.601Z INFO management/server/migration/migration.go:358: Migration of empty name to default value in table users completed
2026-03-10T08:43:16.609Z INFO management/server/migration/migration.go:344: No rows with empty email found in table users, no migration needed
2026-03-10T08:43:16.609Z INFO management/server/migration/migration.go:358: Migration of empty email to default value in table users completed
2026-03-10T08:43:16.981Z FATL management/internals/server/boot.go:64: failed to create store: auto migratePreAuto: Error 1061 (42000): Duplicate key name 'idx_services_domain'

I had to delete the key manually now and restart so that it works and doesn't hang in a boot loop.
I have to turn off automatic updates now, because I can't trust the updates before personally checking them...

To Reproduce

Steps to reproduce the behavior:

  1. Have version 0.66.2 installed
  2. Automatic update with restart at night
  3. ERROR

Expected behavior

The netbird-server container should start already

Are you using NetBird Cloud?

No, self-hosted

NetBird version

0.66.2

Is any other VPN software installed?

No

Debug output

Is shown above

Screenshots

Additional context

Have you tried these troubleshooting steps?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions