Config is not migrated properly #637

Closed
opened 2025-12-29 02:21:28 +01:00 by adam · 6 comments
Owner

Originally created by @TotoTheDragon on GitHub (Feb 15, 2024).

Bug description

When upgrading to the new version v0.23.0-alpha4, the config is not migrated accordingly. This causes issues with starting up until the config migration is done by hand.

Environment

  • OS: N/A
  • Headscale version: v0.23.0-alpha4
  • Tailscale version: N/A

To Reproduce

  1. Set up a v0.23.0-alpha3 install.
  2. Now upgrade to v0.23.0-alpha4.
  3. When starting headscale it will give an error.

Known affected fields:

  • db_type -> database.type

  • db_path -> database.sqlite.path

  • Most likely all other database fields

How to resolve

  1. Accept that config is not migrated automatically and instead write a HOW-TO-UPGRADE within the changelog.
    OR
  2. Fix config migration

I personally would choose option 1 to avoid more problems

Originally created by @TotoTheDragon on GitHub (Feb 15, 2024). <!-- Before posting a bug report, discuss the behaviour you are expecting with the Discord community to make sure that it is truly a bug. The issue tracker is not the place to ask for support or how to set up Headscale. Bug reports without the sufficient information will be closed. Headscale is a multinational community across the globe. Our language is English. All bug reports needs to be in English. --> ## Bug description When upgrading to the new version v0.23.0-alpha4, the config is not migrated accordingly. This causes issues with starting up until the config migration is done by hand. ## Environment <!-- Please add relevant information about your system. For example: - Version of headscale used - Version of tailscale client - OS (e.g. Linux, Mac, Cygwin, WSL, etc.) and version - Kernel version - The relevant config parameters you used - Log output --> - OS: N/A - Headscale version: v0.23.0-alpha4 - Tailscale version: N/A ## To Reproduce 1. Set up a v0.23.0-alpha3 install. 2. Now upgrade to v0.23.0-alpha4. 3. When starting headscale it will give an error. Known affected fields: - db_type -> database.type - db_path -> database.sqlite.path - Most likely all other database fields ## How to resolve 1. Accept that config is not migrated automatically and instead write a HOW-TO-UPGRADE within the changelog. OR 2. Fix config migration I personally would choose option 1 to avoid more problems
adam added the bug label 2025-12-29 02:21:28 +01:00
adam closed this issue 2025-12-29 02:21:28 +01:00
Author
Owner

@kradalby commented on GitHub (Feb 15, 2024):

The config should have aliases so I'll try to investigate why they don't work, this should be a non breaking change

@kradalby commented on GitHub (Feb 15, 2024): The config should have aliases so I'll try to investigate why they don't work, this should be a non breaking change
Author
Owner

@TotoTheDragon commented on GitHub (Feb 15, 2024):

The config should have aliases so I'll try to investigate why they don't work, this should be a non breaking change

In the long run it might be better to migrate it somehow anyway, or you will have a lot of legacy to keep track of. Whether that is done manually or automatically does not matter much.

If we do choose to have it migrated (config gets saved with new things) automatically, we would have to keep track of upgrade stops.

@TotoTheDragon commented on GitHub (Feb 15, 2024): > The config should have aliases so I'll try to investigate why they don't work, this should be a non breaking change In the long run it might be better to migrate it somehow anyway, or you will have a lot of legacy to keep track of. Whether that is done manually or automatically does not matter much. If we do choose to have it migrated (config gets saved with new things) automatically, we would have to keep track of upgrade stops.
Author
Owner

@kradalby commented on GitHub (Feb 16, 2024):

hmm, you have a good point, 0.23 already has a lot of breaking changes, so might as well rip of the plaster and make all change.

@kradalby commented on GitHub (Feb 16, 2024): hmm, you have a good point, 0.23 already has a lot of breaking changes, so might as well rip of the plaster and make all change.
Author
Owner

@troycarpenter commented on GitHub (Feb 16, 2024):

Just another question...is the database also supposed to be migrated as well? My system accidentally "upgraded" to the 2.3-alpha4 but the database didn't appear to be migrated either, in addition to the config not migrating. Even after the config was changed to the new format, no nodes were in the database and every device generated a new key. (reverting everything to 0.22.3 worked).

@troycarpenter commented on GitHub (Feb 16, 2024): Just another question...is the database also supposed to be migrated as well? My system accidentally "upgraded" to the 2.3-alpha4 but the database didn't appear to be migrated either, in addition to the config not migrating. Even after the config was changed to the new format, no nodes were in the database and every device generated a new key. (reverting everything to 0.22.3 worked).
Author
Owner

@TotoTheDragon commented on GitHub (Feb 16, 2024):

Just another question...is the database also supposed to be migrated as well? My system accidentally "upgraded" to the 2.3-alpha4 but the database didn't appear to be migrated either, in addition to the config not migrating. Even after the config was changed to the new format, no nodes were in the database and every device generated a new key. (reverting everything to 0.22.3 worked).

If you are using postgres there is an issue rn

@TotoTheDragon commented on GitHub (Feb 16, 2024): > Just another question...is the database also supposed to be migrated as well? My system accidentally "upgraded" to the 2.3-alpha4 but the database didn't appear to be migrated either, in addition to the config not migrating. Even after the config was changed to the new format, no nodes were in the database and every device generated a new key. (reverting everything to 0.22.3 worked). If you are using postgres there is an issue rn
Author
Owner

@troycarpenter commented on GitHub (Feb 17, 2024):

I'm use sqlite3. But honestly I don't expect alpha level software to do those migrations. I would expect later in Beta when all the database changes are shaken out, then write a conversion routine.

@troycarpenter commented on GitHub (Feb 17, 2024): I'm use sqlite3. But honestly I don't expect alpha level software to do those migrations. I would expect later in Beta when all the database changes are shaken out, then write a conversion routine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#637