GitHub user Neon-Face added a comment to the discussion: [Bug]
`standard.operators.python` fails the task randomly
> It seems like the bug is from `airflow.providers.standard.operators.python`,
> it possibly triggers server error and change the task state.
>
> ```
> 2025-08-07 18:06:42 [warning ] Server error
> [airflow.sdk.api.client] detail={'detail': {'reason': 'not_found', 'message':
> "V
> ariable with key 'PythonVirtualenvOperator.cache_key' not found"}}
>
> 2025-08-07 18:06:42 [error ] Variable not found
> [airflow.sdk.api.client] detail={'detail': {'reason': 'not_found', 'message':
> "V
> ariable with key 'PythonVirtualenvOperator.cache_key' not found"}}
> key=PythonVirtualenvOperator.cache_key status_code=404
> ```
>
> It is located in
> `.venv/lib/python3.9/site-packages/airflow/providers/standard/operators/python.py`:
> `"cache_key": str(Variable.get("PythonVirtualenvOperator.cache_key", "")),`
>
> Also in
> `.venv/lib/python3.9/site-packages/airflow/providers/standard/operators/python.py`
> , Variable is imported in an old way: `from airflow.models.variable import
> Variable` instead of `from airflow.sdk import Variable`.
>
> Can anyone help me confirm that such issue does exist? Thanksss!
I think this is another issue now.... not only `@task.virtualenv` will fail
randomly, `@task` as well....
GitHub link:
https://github.com/apache/airflow/discussions/54534#discussioncomment-14113654
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]