bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
9.06k stars 9.24k forks source link

Unquoted .Values.ldap.basedn in bitnami/airflow:22.2.0 causing fatal error during startup #30619

Open viesturseihentals-saf opened 5 days ago

viesturseihentals-saf commented 5 days ago

Name and Version

bitnami/airflow:22.2.0

What architecture are you using?

None

What steps will reproduce the bug?

  1. Deploy bitnami/airflow:22.2.0 chart.
  2. Configure LDAP settings in values.yaml especially ldap.basedn.
  3. Start the airflow-web container.

What is the expected behavior?

Successful web container startup

What do you see instead?

/opt/bitnami/airflow/venv/lib/python3.12/site-packages/airflow/configuration.py:859 FutureWarning: section/key [core/sql_alchemy_conn] has been deprecated, you should use[database/sql_alchemy_conn] instead. Please update your `conf.get*` call to use the new name
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/gunicorn/__main__.py", line 10, in <module>
    run(prog="gunicorn")
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 66, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]", prog=prog).run()
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/gunicorn/app/base.py", line 235, in run
    super().run()
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/gunicorn/app/base.py", line 71, in run
    Arbiter(self).run()
    ^^^^^^^^^^^^^
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 57, in __init__
    self.setup(app)
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 117, in setup
    self.app.wsgi()
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/gunicorn/app/base.py", line 66, in wsgi
    self.callable = self.load()
                    ^^^^^^^^^^^
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 57, in load
    return self.load_wsgiapp()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 47, in load_wsgiapp
    return util.import_app(self.app_uri)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/gunicorn/util.py", line 423, in import_app
    app = app(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/airflow/www/app.py", line 196, in cached_app
    app = create_app(config=config, testing=testing)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/airflow/www/app.py", line 85, in create_app
    flask_app.config.from_pyfile(webserver_config, silent=True)
  File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask/config.py", line 185, in from_pyfile
    exec(compile(config_file.read(), filename, "exec"), d.__dict__)
  File "/opt/bitnami/airflow/webserver_config.py", line 10, in <module>
    AUTH_LDAP_SEARCH = DC=saf,DC=lan
                                 ^^^
NameError: name 'lan' is not defined. Did you mean: 'len'?

Additional information

Suggested Fix: In the bitnami/airflow/templates/web/configmap.yaml file, quote the .Values.ldap.basedn as follows:

[..]
AUTH_TYPE = AUTH_LDAP
AUTH_LDAP_SERVER = {{ .Values.ldap.uri | squote }}
AUTH_LDAP_SEARCH = {{ .Values.ldap.basedn | squote }}
AUTH_LDAP_UID_FIELD = {{ .Values.ldap.searchAttribute | squote }}
AUTH_LDAP_BIND_USER = {{ .Values.ldap.binddn | squote }}
[..]
carrodher commented 5 days ago

Thank you for bringing this issue to our attention. We appreciate your involvement! If you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.