Replies: 2 comments 7 replies
-
I believe your command should sanitize and remove the extra characters. It could be things were working fine accidentally - because SQLAlchemy would remove trailing whitespace, but it should not be there in the first place. Make sure your _CMD removes the trailing whiltespace simply. |
Beta Was this translation helpful? Give feedback.
-
Hi, I believe I'm facing a similar issue in airflow 2.9.3 . The command I run correctly returns a connection string without a trailing newline, but when putting this command in In my installation, I tried editing the airflow/airflow/configuration.py Line 120 in c6eb262 return output.rstrip() and this resolves my issue. @potiuk @Taragolis is it worth further discussion to submit this as a PR? I'd be concerned about introducing a new unexpected behavior here, and I'm not sure what else this might break/change, or how to dig and test further. Would appreciate any guidance here, and happy to try to contribute where I can!
|
Beta Was this translation helpful? Give feedback.
-
Hi Team, Currently we are using the airflow 2.2.5 and deployed in EKS cluster. RDS credentials are stored at aws secrets-manager, So we are using the AIRFLOW__DATABASE__SQL_ALCHEMY_CONN_CMD to construct the sql connection URI, in airflow 2.2.5 it is working as expected, but in airflow 2.4.3 adding one extra line at the end of connection URL for example is given below.
in airflow 2.2.5
"postgresql://username:[email protected]:5432/airflow"
in airflow 2.4.3
"postgresql://username:[email protected]:5432/airflow "
When I further debug and came to know that, the below line of code(click here) appending one extra line in airflow 2.2.5 and 2.4.3
SQL_ALCHEMY_CONN = conf.get('database', 'SQL_ALCHEMY_CONN')
but below line of code(click here) is behaving differently in airflow 2.2.5 and 2.4.5, in airflow 2.2.5 it is removing the extra line from the connection url and 2.4.3 it is not
engine = create_engine(SQL_ALCHEMY_CONN, connect_args=connect_args, **engine_args)
So if install SQLAlchemy==1.4.15 in airflow 2.4.3 it will work fine, if we install SQLAlchemy<1.4.15 then we are getting this issue.
By default airflow 2.4.3 install SQLAlchemy==1.4.27 because of that we are getting this issue.
Please do needful help and let me if you need any further information on it.
Beta Was this translation helpful? Give feedback.
All reactions