"authelia config validate" should return 1 in case of invalid config
Sebclem opened this issue · comments
Version
v4.38.8
Deployment Method
Bare-metal
Reverse Proxy
HAProxy
Reverse Proxy Version
No response
Description
authelia config validate
exit code should be 1
in case of invalid config.
I'm using it in my ansible role to validate my config before deployment but this command exit code is always 0
even on if the config contain errors.
Reproduction
- Create invalid config
- Run
authelia config validate --config <your config file>
- Run
echo $?
=> print0
Expectations
authelia config validate
return code should not be 0
in case of invalid config.
Configuration (Authelia)
No response
Build Information
Last Tag: v4.38.8
State: tagged clean
Branch: v4.38.8
Commit: cd32d5ce0b3cc2d581f63700c5cec1174c027718
Build Number: 28628
Build OS: linux
Build Arch: amd64
Build Compiler: gc
Build Date: Mon, 15 Apr 2024 13:44:28 +1000
Extra:
Go:
Version: go1.22.1
Module Path: github.com/authelia/authelia/v4
Executable Path: github.com/authelia/authelia/v4/cmd/authelia
Logs (Authelia)
---
Logs (Proxy / Application)
No response
Documentation
No response
Pre-Submission Checklist
-
I agree to follow the Code of Conduct
-
This is a bug report and not a support request
-
I have read the security policy and this bug report is not a security issue or security related issue
-
I have either included the complete configuration file or I am sure it's unrelated to the configuration
-
I have either included the complete debug / trace logs or the output of the build-info command if the logs are not relevant
-
I have provided all of the required information in full with the only alteration being reasonable sanitization in accordance with the Troubleshooting Sanitization reference guide
-
I have checked for related proxy or application logs and included them if available
-
I have checked for related issues and checked the documentation
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 the behavior you're experiencing with the authelia config validate
command not returning a non-zero exit code on invalid configurations is indeed unexpected based on the intended functionality of the command. The authelia config validate
command is designed to check a configuration against Authelia's internal configuration validation mechanisms, and it should ideally return a non-zero exit code if the configuration is invalid.
This might be a bug or an oversight in the implementation of the command. I recommend reporting this issue on the Authelia GitHub repository to bring it to the attention of the developers. They can provide further insights or fixes to ensure that the command behaves as expected.
In the meantime, as a workaround, you might consider implementing additional checks in your Ansible role to parse the output of the authelia config validate
command for error messages, although this is not as reliable or clean as having the correct exit codes.
Here is the link to the Authelia GitHub repository where you can report this issue: Authelia GitHub Issues
This comment was generated by Glime.