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

   ### Under which category would you file this issue?
   
   Airflow Core
   
   ### Apache Airflow version
   
   3.0.6
   
   ### What happened and how to reproduce it?
   
   When using the @task.virtualenv tag, we get an expected error failing to 
fetch pip, due to company firewall rules:
   ```
   [2026-04-13, 11:46:55] INFO - Executing cmd: uv venv --allow-existing --seed 
--python python --system-site-packages /tmp/venvvb7fapaz: 
source="airflow.utils.process_utils"
   [2026-04-13, 11:46:55] INFO - Output:: source="airflow.utils.process_utils"
   [2026-04-13, 11:46:55] INFO - Using CPython 3.12.11 interpreter at: 
/usr/local/bin/python: source="airflow.utils.process_utils"
   [2026-04-13, 11:46:55] INFO - Creating virtual environment with seed 
packages at: /tmp/venvvb7fapaz: source="airflow.utils.process_utils"
   [2026-04-13, 11:48:59] INFO - error: Failed to install seed packages into 
virtual environment: source="airflow.utils.process_utils"
   [2026-04-13, 11:48:59] INFO -   Caused by: No solution found when resolving: 
`pip`: source="airflow.utils.process_utils"
   [2026-04-13, 11:48:59] INFO -   Caused by: Failed to fetch: 
`https://pypi.org/simple/pip/`: source="airflow.utils.process_utils"
   [2026-04-13, 11:48:59] INFO -   Caused by: Request failed after 3 retries: 
source="airflow.utils.process_utils"
   [2026-04-13, 11:48:59] INFO -   Caused by: error sending request for url 
(https://pypi.org/simple/pip/): source="airflow.utils.process_utils"
   [2026-04-13, 11:48:59] INFO -   Caused by: operation timed out: 
source="airflow.utils.process_utils"
   ```
   
   I've tried numerous ways to mitigate this, including:
   
   **Setting index_url in the tag**
   `@task.virtualenv(task_id="test1", system_site_packages=True, 
index_urls=["company_pip_url"])`
   
   **Setting $UV_INDEX_URL env var**
   Setting $UV_INDEX_URL on the server where uv is run from, to our pip uri
   
   None of those work.
   
   The underlying command is `uv venv --allow-existing --seed --python python 
--system-site-packages /tmp/venvvb7fapaz` which doesn't work (also when I run 
it manually)
   
   But if I manually run the following then it works:
   `uv venv --allow-existing --seed --python python --system-site-packages 
/tmp/venv_12345 --index-url https://pip_url`
   
   It also works if I manually set $UV_INDEX_URL and run the already-standard 
command:
   `uv venv --allow-existing --seed --python python --system-site-packages 
/tmp/venv_12345`
   
   ---
   
   I would be happy to create a fix of sorts by setting `--index-url` when the 
uv command is generated ( 
https://github.com/apache/airflow/blob/e25114571ec9db0d2eeb33c15986bfeb49108bb8/providers/standard/src/airflow/providers/standard/utils/python_virtualenv.py#L70
 ), but I'm assuming there is already a way to make this work?
   
   ### What you think should happen instead?
   
   I would expect the initial uv command to use the index-url stored in either 
an environment variable, or set via index_urls.
   
   ### Operating System
   
   Debian GNU/Linux 12 (bookworm)
   
   ### Deployment
   
   None
   
   ### Apache Airflow Provider(s)
   
   _No response_
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Official Helm Chart version
   
   Not Applicable
   
   ### Kubernetes Version
   
   _No response_
   
   ### Helm Chart configuration
   
   _No response_
   
   ### Docker Image customizations
   
   _No response_
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to