giantZorg opened a new issue, #36207:
URL: https://github.com/apache/airflow/issues/36207

   ### Apache Airflow version
   
   2.7.3
   
   ### What happened
   
   Upon setting the environment variable 
AIRFLOW__DATABASE__SQL_ALCHEMY_CONNECT_ARGS to pass arguments as described in 
https://airflow.apache.org/docs/apache-airflow/stable/howto/set-up-database.html#setting-up-a-postgresql-database,
 the following error occurs:
   
   `  
   File "/home/airflow/.local/bin/airflow", line 5, in <module>
       from airflow.__main__ import main
     File 
"/home/airflow/.local/lib/python3.10/site-packages/airflow/__init__.py", line 
68, in <module>
       settings.initialize()
     File 
"/home/airflow/.local/lib/python3.10/site-packages/airflow/settings.py", line 
546, in initialize
       configure_orm()
     File 
"/home/airflow/.local/lib/python3.10/site-packages/airflow/settings.py", line 
238, in configure_orm
       connect_args = conf.getimport("database", "sql_alchemy_connect_args")
     File 
"/home/airflow/.local/lib/python3.10/site-packages/airflow/configuration.py", 
line 1199, in getimport
       raise AirflowConfigException(
   airflow.exceptions.AirflowConfigException: The object could not be loaded. 
Please check "sql_alchemy_connect_args" key in "database" section. Current 
value: "{"timeout": 120}".
   `
   
   I tracked the issue to the following code snippet:
   
   
https://github.com/apache/airflow/blob/8fbacb8a5fb4168a335ad080a6b806fee3d85737/airflow/settings.py#L237C1-L243C1
   
   After changing line 238 to 
   
   `        connect_args = conf.getjson("database", "sql_alchemy_connect_args")`
   
   the error was resolved. It also seems reasonable, as these arguments should 
not import modules but parameters to be passed on in line 242. 
   
   If this is indeed a bug, I'm happy to create a pull request. I checked the 
current development version, the code is still the same as in version 2.7.3 
that I use.
   
   ### What you think should happen instead
   
   The connection arguments should be parsed correctly, the DB connection 
should be created.
   
   ### How to reproduce
   
   Set the environment variable to {"timeout": 30} as described in 
https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#sql-alchemy-connect-args
   
   ### Operating System
   
   Debian GNU/Linux 11 (bullseye)
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-amazon==8.10.0
   apache-airflow-providers-celery==3.4.1
   apache-airflow-providers-cncf-kubernetes==7.8.0
   apache-airflow-providers-common-sql==1.8.0
   apache-airflow-providers-daskexecutor==1.1.0
   apache-airflow-providers-docker==3.8.0
   apache-airflow-providers-elasticsearch==5.1.0
   apache-airflow-providers-ftp==3.6.0
   apache-airflow-providers-google==10.11.0
   apache-airflow-providers-grpc==3.3.0
   apache-airflow-providers-hashicorp==3.5.0
   apache-airflow-providers-http==4.6.0
   apache-airflow-providers-imap==3.4.0
   apache-airflow-providers-microsoft-azure==8.1.0
   apache-airflow-providers-mysql==5.4.0
   apache-airflow-providers-odbc==4.1.0
   apache-airflow-providers-openlineage==1.2.0
   apache-airflow-providers-postgres==5.7.1
   apache-airflow-providers-redis==3.4.0
   apache-airflow-providers-sendgrid==3.3.0
   apache-airflow-providers-sftp==4.7.0
   apache-airflow-providers-slack==8.3.0
   apache-airflow-providers-snowflake==5.1.0
   apache-airflow-providers-sqlite==3.5.0
   apache-airflow-providers-ssh==3.8.1
   
   ### Deployment
   
   Other 3rd-party Helm chart
   
   ### Deployment details
   
   Airflow Helm Chart (User Community) 
https://github.com/airflow-helm/charts/tree/main/charts/airflow using the 
Airflow image 
https://hub.docker.com/layers/apache/airflow/2.7.3-python3.10/images/sha256-af4c1ab9472d754a8247e9a44d922db67422584e4a88b5339012fe145171572a?context=explore
    
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to