go-vikunja/vikunja

User registration fails due to missing timezone

Closed this issue · 4 comments

Description

Fresh and vanilla instance fails to register new users from the register web view. The logs contain the following resuliting in 500 status code.

RegisterUser 261 unknown time zone <time zone set at service.timezone>

It does not seem to matter if service.timezone is set in the config.yml or not. Looking at the docs and code, even if unset it should fallback to GMT which it was doing fine in the previous version.

The user is actually created and the welcome mail is sent, however it subsequently fails during login since the response when querying the user profile after login contains literally timezone: "<time zone set at service.timezone>" (with the <>) in the settings object.

Vikunja Frontend Version

0.21.0

Vikunja API Version

0.21.0

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

This was resolved by realizing that the config.yml actually has those strings set at https://github.com/go-vikunja/api/blob/e5cd4897d6be52c5bacb39a4ddae322921bfc0ee/config.yml.sample#L333

Clearing those makes it fallback correctly to the service. properties. Maybe the sample file could have empty values and the current ones only as comments?

Maybe the sample file could have empty values and the current ones only as comments?

Yeah that's one improvement we'd like to make. The current sample configuration is also used to generate the config docs and this was the easiest way to let it handle default values.

This error pops up regardless of what's set in the config.yml. It only started working once I manually set the env variables when I started it. (Non docker version)

The config value is only read during creation of the user. Once the user exists, the setting is persisted into the database.