authelia: mysql: error: storage error loading authelia due to schema collation change
Version
v4.37.0
Deployment Method
Docker
Reverse Proxy
SWAG
Reverse Proxy Version
No response
Description
Trying to start Authelia errors out, and naturally none of the containers I protect with Authelia are usable/accessible.
Reproduction
All I did was pull the latest Authelia image.
Expectations
No response
Logs
From the log:
time="2022-10-23T02:16:06-05:00" level=warning msg="Configuration: configuration key 'server.read_buffer_size' is deprecated in 4.36.0 and has been replaced by 'server.buffers.read': this has been automatically mapped for you but you will need to adjust your configuration to remove this message"
time="2022-10-23T02:16:06-05:00" level=warning msg="Configuration: configuration key 'server.write_buffer_size' is deprecated in 4.36.0 and has been replaced by 'server.buffers.write': this has been automatically mapped for you but you will need to adjust your configuration to remove this message"
time="2022-10-23T02:16:06-05:00" level=warning msg="Configuration: configuration key 'authentication_backend.disable_reset_password' is deprecated in 4.36.0 and has been replaced by 'authentication_backend.password_reset.disable': this has been automatically mapped for you but you will need to adjust your configuration to remove this message"
time="2022-10-23T02:16:06-05:00" level=info msg="Authelia v4.37.0 is starting"
time="2022-10-23T02:16:06-05:00" level=info msg="Log severity set to debug"
{"level":"debug","msg":"Registering client [oc]-portainer with policy two_factor (2)","time":"2022-10-23T02:16:06-05:00"}
{"level":"info","msg":"Storage schema is being checked for updates","time":"2022-10-23T02:16:06-05:00"}
{"level":"info","msg":"Storage schema migration from 5 to 6 is being attempted","time":"2022-10-23T02:16:06-05:00"}
{"level":"error","msg":"Failure running the storage provider startup check: error during schema migrate: error applying migration version 6 to version 5 for rollback: schema migration 6 (ConsentPreConfiguration) failed: Error 1051: Unknown table 'authelia.oauth2_authorization_code_session'. rollback caused by: schema migration 6 (ConsentPreConfiguration) failed: Error 3780: Referencing column 'subject' and referenced column 'identifier' in foreign key constraint 'oauth2_consent_preconfiguration_subjct_fkey' are incompatible.","stack":[{"File":"github.com/authelia/authelia/v4/internal/commands/root.go","Line":277,"Name":"doStartupChecks"},{"File":"github.com/authelia/authelia/v4/internal/commands/root.go","Line":87,"Name":"cmdRootRun"},{"File":"github.com/spf13/cobra@v1.6.0/command.go","Line":920,"Name":"(*Command).execute"},{"File":"github.com/spf13/cobra@v1.6.0/command.go","Line":1040,"Name":"(*Command).ExecuteC"},{"File":"github.com/spf13/cobra@v1.6.0/command.go","Line":968,"Name":"(*Command).Execute"},{"File":"github.com/authelia/authelia/v4/cmd/authelia/main.go","Line":10,"Name":"main"},{"File":"runtime/proc.go","Line":250,"Name":"main"},{"File":"runtime/asm_amd64.s","Line":1594,"Name":"goexit"}],"time":"2022-10-23T02:16:06-05:00"}
{"level":"debug","msg":"Notifier SMTP client attempting connection to smtp.gmail.com:465","time":"2022-10-23T02:16:06-05:00"}
{"level":"debug","msg":"Notifier SMTP client using submissions port 465. Make sure the mail server you are connecting to is configured for submissions and not SMTPS.","time":"2022-10-23T02:16:06-05:00"}
{"level":"debug","msg":"Notifier SMTP client connected successfully","time":"2022-10-23T02:16:06-05:00"}
{"level":"debug","msg":"Notifier SMTP connection is already encrypted, skipping STARTTLS","time":"2022-10-23T02:16:06-05:00"}
{"level":"debug","msg":"Notifier SMTP server supports authentication with the following mechanisms: LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH","time":"2022-10-23T02:16:06-05:00"}
{"level":"debug","msg":"Notifier SMTP client attempting AUTH PLAIN with server","time":"2022-10-23T02:16:06-05:00"}
{"level":"debug","msg":"Notifier SMTP client authenticated successfully with the server","time":"2022-10-23T02:16:06-05:00"}
{"level":"fatal","msg":"The following providers had fatal failures during startup: storage","stack":[{"File":"github.com/authelia/authelia/v4/internal/commands/root.go","Line":305,"Name":"doStartupChecks"},{"File":"github.com/authelia/authelia/v4/internal/commands/root.go","Line":87,"Name":"cmdRootRun"},{"File":"github.com/spf13/cobra@v1.6.0/command.go","Line":920,"Name":"(*Command).execute"},{"File":"github.com/spf13/cobra@v1.6.0/command.go","Line":1040,"Name":"(*Command).ExecuteC"},{"File":"github.com/spf13/cobra@v1.6.0/command.go","Line":968,"Name":"(*Command).Execute"},{"File":"github.com/authelia/authelia/v4/cmd/authelia/main.go","Line":10,"Name":"main"},{"File":"runtime/proc.go","Line":250,"Name":"main"},{"File":"runtime/asm_amd64.s","Line":1594,"Name":"goexit"}],"time":"2022-10-23T02:16:07-05:00"}
### Configuration
_No response_
### Documentation
_No response_
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (15 by maintainers)
This should be solved in #4262, would appreciate some users to test it. Instructions:
authelia\authelia:fix-sql-inconsistencies
.Alternative to the required steps is dropping ALL tables in the database if support is required at any stage in the future.
Important notes:
utf8mb4
charset.utf8mb4_unicode_520_ci
collation.webauthn_devices
tableskid
column which is aVARCHAR(512)
or 512 chars by 4 bytes.explicit_defaults_for_timestamp
setting being enabled as when it is not enabled it uses a deprecated time setting that is NOT ANSI standard.@newkindofworld unrelated. Open a new issue.
Edit: actually your issue is not a bug, it’s a error in your config, open a discussion if you can’t figure it out.