You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "martvaha (via GitHub)" <gi...@apache.org> on 2025/07/05 20:58:27 UTC
[I] Connection not available in virtualenv [airflow]
martvaha opened a new issue, #52923:
URL: https://github.com/apache/airflow/issues/52923
### Apache Airflow version
3.0.2
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
Using BaseHook.get_connection to obtain a Connection does not work in a virtualenv task.
<img width="1594" height="218" alt="Image" src="https://github.com/user-attachments/assets/de279909-6ff5-4083-a578-19cf8ae9b7d0" />
The same approach works fine when running outside of a virtual environment, and it's also working inside virtualenv with Airflow v2 (for example, version 2.9.2).
### What you think should happen instead?
Connections should be available inside virtualenv as well. The AIRFLOW_CONN_TEST is accessible with os.environ but for some reason the Connection is not found.
### How to reproduce
Reproduction: https://github.com/martvaha/airflow-virtualenv-connection
Steps:
1. Start with `docker compose up`.
2. `docker-compose.yml` defines `AIRFLOW_CONN_TEST`.
3. Run DAG `example_virtualenv`.
4. The task that is not inside the virtual environment finishes without issues.
5. The equivalent task inside the virtual environment returns the exception "The conn_id `test` isn't defined."
### Operating System
macos
### Versions of Apache Airflow Providers
_No response_
### Deployment
Docker-Compose
### Deployment details
Testing with official 'https://airflow.apache.org/docs/apache-airflow/3.0.2/docker-compose.yaml', only AIRFLOW_CONN_TEST added.
### Anything else?
_No response_
### Are you willing to submit PR?
- [ ] 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-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Connection not available in virtualenv [airflow]
Posted by "jnavarro86 (via GitHub)" <gi...@apache.org>.
jnavarro86 commented on issue #52923:
URL: https://github.com/apache/airflow/issues/52923#issuecomment-3139200912
I can confirm the same issue when using PythonVirtualenvOperator.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Connection not available in virtualenv [airflow]
Posted by "ashb (via GitHub)" <gi...@apache.org>.
ashb closed issue #52923: Connection not available in virtualenv
URL: https://github.com/apache/airflow/issues/52923
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Connection not available in virtualenv [airflow]
Posted by "ashb (via GitHub)" <gi...@apache.org>.
ashb commented on issue #52923:
URL: https://github.com/apache/airflow/issues/52923#issuecomment-3144450956
Dupe, but feel free to submit a PR to fix this if you think you know how @kgw7401 -- no need to be assigned it, you can just create a PR
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Connection not available in virtualenv [airflow]
Posted by "kgw7401 (via GitHub)" <gi...@apache.org>.
kgw7401 commented on issue #52923:
URL: https://github.com/apache/airflow/issues/52923#issuecomment-3094559572
When i test this, I get the same error i'd like to be assigned to this issue!
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Connection not available in virtualenv [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #52923:
URL: https://github.com/apache/airflow/issues/52923#issuecomment-3040150695
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org