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

"authelia config validate" should return 1 in case of invalid config #7262

Open
8 tasks done
Sebclem opened this issue May 2, 2024 · 1 comment · May be fixed by #7364
Open
8 tasks done

"authelia config validate" should return 1 in case of invalid config #7262

Sebclem opened this issue May 2, 2024 · 1 comment · May be fixed by #7364
Labels
priority/6/very-low Very Low priority items status/in-progress Work is in progress type/bug Confirmed Bugs

Comments

@Sebclem
Copy link

Sebclem commented May 2, 2024

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 $? => print 0

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

@Sebclem Sebclem added priority/4/normal Normal priority items status/needs-triage Issues which have not expressly been classified by a team member yet type/bug/unconfirmed Unconfirmed Bugs labels May 2, 2024
Copy link

glime-ai bot commented May 2, 2024

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.

@james-d-elliott james-d-elliott added type/bug Confirmed Bugs status/in-progress Work is in progress priority/6/very-low Very Low priority items and removed priority/4/normal Normal priority items type/bug/unconfirmed Unconfirmed Bugs status/needs-triage Issues which have not expressly been classified by a team member yet labels May 29, 2024
@james-d-elliott james-d-elliott linked a pull request May 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/6/very-low Very Low priority items status/in-progress Work is in progress type/bug Confirmed Bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants