-
Notifications
You must be signed in to change notification settings - Fork 202
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
Successfully installed the nginx-ldap-auth module but errors when i execute #107
Comments
I've encountered this problem testing LDAP authentication using the python module as well (https://github.com/caltechads/nginx-ldap-auth-service). I've created an issue there in case the problem is with the python module. Unable to start: ValidationError: 5 validation errors for Settings Did you find any solutions? |
You need to export some environment variables into your shell before running the server. See here https://nginx-ldap-auth-service.readthedocs.io/en/latest/configuration.html#environment. The error means that the server can't find those environment variables. |
Thanks @cmalek, I'm calling the module by supervisord (https://supervisord.org/) to daemonize the module and I've configured it to use the environment settings (--env-file) passed as follows:
supervisord is passing the file to the module according to the logs:
I'll do some more digging to see why the env file is not being passed to the module. |
Ugh, what it actually is is that I pass the value of that The relevant bit is in Try passing them in with with supervisor.conf config instead of using See: https://stackoverflow.com/questions/12900402/supervisor-and-environment-variables |
Does anyone know how to debug this. I am trying to setup nginx to authenticate using LDAP and installed the nginx-ldap-auth perl moudule but getting these errors:
nginx-ldap-auth settings
Traceback (most recent call last):
File "/opt/.venv/python-env/bin/nginx-ldap-auth", line 8, in
sys.exit(main())
File "/opt/.venv/python-env/lib64/python3.9/site-packages/nginx_ldap_auth/main.py", line 7, in main
from .cli import cli
File "/opt/.venv/python-env/lib64/python3.9/site-packages/nginx_ldap_auth/cli/init.py", line 2, in
from .server import * # noqa:F403,F401
File "/opt/.venv/python-env/lib64/python3.9/site-packages/nginx_ldap_auth/cli/server.py", line 11, in
settings = Settings()
File "/opt/.venv/python-env/lib64/python3.9/site-packages/pydantic_settings/main.py", line 84, in init
super().init(
File "/opt/.venv/python-env/lib64/python3.9/site-packages/pydantic/main.py", line 176, in init
self.pydantic_validator.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 5 validation errors for Settings
secret_key
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.7/v/missing
ldap_uri
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.7/v/missing
ldap_binddn
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.7/v/missing
ldap_password
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.7/v/missing
ldap_basedn
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.7/v/missing
The text was updated successfully, but these errors were encountered: