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

[Bug] v0.23 does not work with PostgreSQL #1956

Closed
3 of 4 tasks
simonszu opened this issue May 25, 2024 · 1 comment · Fixed by #1959
Closed
3 of 4 tasks

[Bug] v0.23 does not work with PostgreSQL #1956

simonszu opened this issue May 25, 2024 · 1 comment · Fixed by #1959
Labels
bug Something isn't working
Milestone

Comments

@simonszu
Copy link

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The startup of 0.23 apparently requires a certain postgresql database schema which is not present, even when upgrading from a 0.22 installation. It shows this error in the logs:

FTL Migration failed: FEHLER: Spalte »last_successful_update« von Relation »nodes« existiert nicht (SQLSTATE 42703) error="FEHLER: Spalte »last_successful_update« von Relation »nodes« existiert nicht (SQLSTATE 42703)"

Which roughly translates as "column last_successful_update from relation nodes does not exist".

This error occurs on a completely new database as well as upgrading from a 0.22 installation with an already pre-populated database (a tailnet and some nodes are present).

Expected Behavior

The headscale container comes up just fine, or is able to successfully complete the migration.

Steps To Reproduce

  1. Configure headscale to use postgres instead of sqlite
  2. Start a 0.23 container

Environment

- OS:Debian Bookworm
- Headscale version: 0.23.0-alpha11 and -alpha12
- Tailscale version: Does not matter yet

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Anything else?

No response

@simonszu simonszu added the bug Something isn't working label May 25, 2024
@kradalby kradalby added this to the v0.23.0 milestone May 26, 2024
kradalby added a commit to kradalby/headscale that referenced this issue May 27, 2024
most of the time we dont even check this error and checking
the string for particular errors is very flake as different
databases (sqlite and psql) use different error messages, and
some users might have it in other languages.

Fixes juanfont#1956

Signed-off-by: Kristoffer Dalby <[email protected]>
@kradalby
Copy link
Collaborator

Fix is up in #1959, we checked the postgres error by string, and since you have yours in German, it did not match.

I would recommend you to change the postgres language to english, we will try to avoid this in the future, but since there is no uniform error checking for us in postgres, I will not rule out that this can happen again in the future, if there is a larger necessity for a check like this, then we might opt for not supporting other languages if necessary.

kradalby added a commit to kradalby/headscale that referenced this issue May 27, 2024
most of the time we dont even check this error and checking
the string for particular errors is very flake as different
databases (sqlite and psql) use different error messages, and
some users might have it in other languages.

Fixes juanfont#1956

Signed-off-by: Kristoffer Dalby <[email protected]>
kradalby added a commit that referenced this issue May 27, 2024
most of the time we dont even check this error and checking
the string for particular errors is very flake as different
databases (sqlite and psql) use different error messages, and
some users might have it in other languages.

Fixes #1956

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.

2 participants