"Configuration: session: option 'cookies' is required" despite being provided #6912
-
Hi there, I've just upgraded from v4.37 to v4.38.2 and I've encountered a problem after attempting to address the warnings in the container logs around configuration changes. {
"level": "warning",
"msg": "Configuration: session: option 'domain' is deprecated in v4.38.0 and has been replaced by a multi-domain configuration: this has automatically been mapped for you but you will need to adjust your configuration to remove this message and receive the latest messages",
"time": "2024-03-16T16:55:07Z"
} I like to set my configuration as much as possible through environment variables, but had to move some to the config file due to the new The environment variables I set are: AUTHELIA_SESSION_EXPIRATION: 1h
AUTHELIA_SESSION_INACTIVITY: 5m
AUTHELIA_SESSION_NAME: authelia_session
AUTHELIA_SESSION_REMEMBER_ME: 1M
AUTHELIA_SESSION_SAME_SITE: lax
AUTHELIA_SESSION_SECRET_FILE: /run/secrets/authelia_session_secret With the following in the config file: session:
cookies:
- domain: example.com
authelia_url: https://login.example.com
default_redirection_url: https://www.example.com The errors in the logs with stack traces are below: [{
"level": "error",
"msg": "Configuration: session: option 'cookies' is required",
"stack": [
{
"File": "github.com/authelia/authelia/v4/internal/commands/context.go",
"Line": 312,
"Name": "(*CmdCtx).ConfigValidateLogRunE"
},
{
"File": "github.com/authelia/authelia/v4/internal/commands/context.go",
"Line": 183,
"Name": "NewRootCmd.(*CmdCtx).ChainRunE.func1"
},
{
"File": "github.com/spf13/cobra@v1.8.0/command.go",
"Line": 968,
"Name": "(*Command).execute"
},
{
"File": "github.com/spf13/cobra@v1.8.0/command.go",
"Line": 1115,
"Name": "(*Command).ExecuteC"
},
{
"File": "github.com/spf13/cobra@v1.8.0/command.go",
"Line": 1039,
"Name": "(*Command).Execute"
},
{
"File": "github.com/authelia/authelia/v4/cmd/authelia/main.go",
"Line": 10,
"Name": "main"
},
{
"File": "runtime/internal/atomic/types.go",
"Line": 194,
"Name": "(*Uint32).Load"
},
{
"File": "runtime/asm_amd64.s",
"Line": 1695,
"Name": "goexit"
}
],
"time": "2024-03-16T16:15:54Z"
},
{
"level": "fatal",
"msg": "Can't continue due to the errors loading the configuration",
"stack": [
{
"File": "github.com/authelia/authelia/v4/internal/commands/context.go",
"Line": 315,
"Name": "(*CmdCtx).ConfigValidateLogRunE"
},
{
"File": "github.com/authelia/authelia/v4/internal/commands/context.go",
"Line": 183,
"Name": "NewRootCmd.(*CmdCtx).ChainRunE.func1"
},
{
"File": "github.com/spf13/cobra@v1.8.0/command.go",
"Line": 968,
"Name": "(*Command).execute"
},
{
"File": "github.com/spf13/cobra@v1.8.0/command.go",
"Line": 1115,
"Name": "(*Command).ExecuteC"
},
{
"File": "github.com/spf13/cobra@v1.8.0/command.go",
"Line": 1039,
"Name": "(*Command).Execute"
},
{
"File": "github.com/authelia/authelia/v4/cmd/authelia/main.go",
"Line": 10,
"Name": "main"
},
{
"File": "runtime/internal/atomic/types.go",
"Line": 194,
"Name": "(*Uint32).Load"
},
{
"File": "runtime/asm_amd64.s",
"Line": 1695,
"Name": "goexit"
}
],
"time": "2024-03-16T16:15:54Z"
}] I'm happy to revert my changes and ignore the warnings for now. I looked through the new example configuration files and I can't see what I've done wrong here. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Please note this response was created using generative AI leveraging previously available information from the repository. This information may be helpful however it is our strong recommendation that you carefully consider the information before blindly applying it. It appears that your configuration issue stems from the way Authelia handles the merging of environment variables and YAML configuration files, especially with the introduction of the Based on the information provided and the error logs, it seems that Authelia is not recognizing the To address this issue, ensure that your entire session configuration, including the Here's a revised configuration example that consolidates all session-related settings in the YAML file: session:
name: authelia_session
secret: insecure_session_secret # Ensure this is securely managed
expiration: 1h
inactivity: 5m
remember_me: 1M
same_site: lax
cookies:
- domain: example.com
authelia_url: https://login.example.com
default_redirection_url: https://www.example.com Please replace Given the complexity of the configuration and the potential for specific nuances in how Authelia processes these settings, if this approach does not resolve your issue, I recommend reaching out to the Authelia support channels or reviewing the latest documentation and examples provided by Authelia for version 4.38.2 and beyond. This comment was generated by Glime. |
Beta Was this translation helpful? Give feedback.
-
Can you show your full config and the full logs? |
Beta Was this translation helpful? Give feedback.
-
authelia_url does not work I think you have to use the subdomain setting which will autogenerate the authelia_url to subdomain.domain.... |
Beta Was this translation helpful? Give feedback.
In preparing my reply, I discovered my error. Sorry for the false report!
Months ago I changed the way in which I was mounting the configuration file. Turns out, I forgot to change the
--config <path>
value to the new location, meaning the changes I was making weren't taking effect. User error as is often the case...Thanks for the recent updates!