[GH-ISSUE #4148] Management service won't start due to management/server/migration.go trying to create duplicate index. #8796

Open
opened 2026-08-05 01:19:35 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @ressys1978 on GitHub (Jul 14, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/4148

Describe the problem

Management service won't start due to managemnt/server/migration.go trying to create duplicate index.

I'm using MySQL as the storage engine.

I upgraded to v0.50.0, which went fine. I then restarted the management service and it errors out with:

Error: failed creating Store: /var/lib/netbird/: migratePostAuto: failed to create index idx_account_ip: Error 1061 (42000): Duplicate key name 'idx_account_ip'

Then it goes into a restart loop.

To Reproduce

Steps to reproduce the behavior:

  1. Upgrade to v0.50.0
  2. Restart the management service a few minutes after the upgrade is complete.

Expected behavior

I'd expect the management service to run, and not error out and enter a restart loop.

Are you using NetBird Cloud?

Self-hosted

NetBird version

v0.50.0 (can duplicate right up to v0.50.3)

Is any other VPN software installed?

No

Debug output

From the management service logs:

2025-07-14T12:48:06Z INFO [context: SYSTEM] management/server/migration/migration.go:407: executing index creation: CREATE UNIQUE INDEX idx_account_ip ON peers (account_id, ip(64))
Error: failed creating Store: /var/lib/netbird/: migratePostAuto: failed to create index idx_account_ip: Error 1061 (42000): Duplicate key name 'idx_account_ip'

Screenshots

N/A

Additional context

Seems the changes in commit 22678bc to management/server/migration.go have failed to consider that the index may already exist when the storage engine is MySQL.

If I custom compile the management service and comment out lines 402 to 412, I can get the management service to run successfully.

Have you tried these troubleshooting steps?

  • Reviewed client troubleshooting (if applicable)
  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client
  • Disabled other VPN software
  • Checked firewall settings
Originally created by @ressys1978 on GitHub (Jul 14, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/4148 **Describe the problem** Management service won't start due to managemnt/server/migration.go trying to create duplicate index. I'm using MySQL as the storage engine. I upgraded to v0.50.0, which went fine. I then restarted the management service and it errors out with: Error: failed creating Store: /var/lib/netbird/: migratePostAuto: failed to create index idx_account_ip: Error 1061 (42000): Duplicate key name 'idx_account_ip' Then it goes into a restart loop. **To Reproduce** Steps to reproduce the behavior: 1. Upgrade to v0.50.0 2. Restart the management service a few minutes after the upgrade is complete. **Expected behavior** I'd expect the management service to run, and not error out and enter a restart loop. **Are you using NetBird Cloud?** Self-hosted **NetBird version** v0.50.0 (can duplicate right up to v0.50.3) **Is any other VPN software installed?** No **Debug output** From the management service logs: 2025-07-14T12:48:06Z INFO [context: SYSTEM] management/server/migration/migration.go:407: executing index creation: CREATE UNIQUE INDEX idx_account_ip ON peers (account_id, ip(64)) Error: failed creating Store: /var/lib/netbird/: migratePostAuto: failed to create index idx_account_ip: Error 1061 (42000): Duplicate key name 'idx_account_ip' **Screenshots** N/A **Additional context** Seems the changes in commit 22678bc to management/server/migration.go have failed to consider that the index may already exist when the storage engine is MySQL. If I custom compile the management service and comment out lines 402 to 412, I can get the management service to run successfully. **Have you tried these troubleshooting steps?** - [X] Reviewed [client troubleshooting](https://docs.netbird.io/how-to/troubleshooting-client) (if applicable) - [X] Checked for newer NetBird versions - [X] Searched for similar issues on GitHub (including closed ones) - [X] Restarted the NetBird client - [X] Disabled other VPN software - [X] Checked firewall settings
saavagebueno added the triage-neededself-hosting labels 2026-08-05 01:19:35 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#8796