Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config is not migrated properly #1758

Closed
TotoTheDragon opened this issue Feb 15, 2024 · 6 comments · Fixed by #1766
Closed

Config is not migrated properly #1758

TotoTheDragon opened this issue Feb 15, 2024 · 6 comments · Fixed by #1766
Labels
bug Something isn't working
Milestone

Comments

@TotoTheDragon
Copy link
Contributor

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

@TotoTheDragon TotoTheDragon added the bug Something isn't working label Feb 15, 2024
@kradalby
Copy link
Collaborator

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

@TotoTheDragon
Copy link
Contributor Author

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.

@kradalby kradalby added this to the v0.23.0 milestone Feb 16, 2024
@kradalby
Copy link
Collaborator

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 added a commit to kradalby/headscale that referenced this issue Feb 16, 2024
A lot of things are breaking in 0.23 so instead of having this
be a long process, just rip of the plaster.

Updates juanfont#1758

Signed-off-by: Kristoffer Dalby <[email protected]>
@kradalby kradalby linked a pull request Feb 16, 2024 that will close this issue
@troycarpenter
Copy link

troycarpenter commented 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).

@TotoTheDragon
Copy link
Contributor Author

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

@troycarpenter
Copy link

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.

kradalby added a commit that referenced this issue Feb 17, 2024
A lot of things are breaking in 0.23 so instead of having this
be a long process, just rip of the plaster.

Updates #1758

Signed-off-by: Kristoffer Dalby <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants