kajen3 opened a new issue #15798:
URL: https://github.com/apache/airflow/issues/15798


   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the 
following questions.
   Don't worry if they're not all applicable; just try to include what you can 
:-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   <!--
   
   IMPORTANT!!!
   
   PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
   NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!
   
   PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!
   
   Please complete the next sections or the issue will be closed.
   These questions are the first thing we need to know to understand the 
context.
   
   -->
   
   **Apache Airflow version**: 2.0.1 and 2.0.2
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl 
version`): 
   
   **Environment**: local
   
   - **Cloud provider or hardware configuration**: 
   - **OS** (e.g. from /etc/os-release): MacOS 11.3.1
   - **Kernel** (e.g. `uname -a`): 
   - **Install tools**: 
https://airflow.apache.org/docs/apache-airflow/stable/start/local.html inside a 
new conda env with python 3.7
   - **Others**:
   
   **What happened**:
   When running the example_python_operator the `PythonVirtualenvOperator` 
fails because it couldn't find a `virtualenv` file or directory.
   
   **What you expected to happen**:
   That the example would succeed.
   
   <!-- What do you think went wrong? -->
   
   **How to reproduce it**:
   <!---
   
   As minimally and precisely as possible. Keep in mind we do not have access 
to your cluster or dags.
   
   If you are using kubernetes, please attempt to recreate the issue using 
minikube or kind.
   
   ## Install minikube/kind
   
   - Minikube https://minikube.sigs.k8s.io/docs/start/
   - Kind https://kind.sigs.k8s.io/docs/user/quick-start/
   
   If this is a UI bug, please provide a screenshot of the bug or a link to a 
youtube video of the bug in action
   
   You can include images using the .md style of
   ![alt text](http://url/to/img.png)
   
   To record a screencast, mac users can use QuickTime and then create an 
unlisted youtube video with the resulting .mov file.
   
   --->
   Run the example_python_operator dag.
   
   **Anything else we need to know**:
   
   <!--
   
   How often does this problem occur? Once? Every time etc?
   
   Any relevant logs to include? Put them here in side a detail tag:
   <details><summary>x.log</summary> lots of stuff </details>
   
   -->
   
   ```
   ***Reading local file: 
/Users/[USERNAME]/airflow/logs/example_python_operator/virtualenv_python/2021-05-12T12:58:31.030337+00:00/1.log
   [2021-05-12 14:58:34,236] {taskinstance.py:877} INFO - Dependencies all met 
for <TaskInstance: example_python_operator.virtualenv_python 
2021-05-12T12:58:31.030337+00:00 [queued]>
   [2021-05-12 14:58:34,242] {taskinstance.py:877} INFO - Dependencies all met 
for <TaskInstance: example_python_operator.virtualenv_python 
2021-05-12T12:58:31.030337+00:00 [queued]>
   [2021-05-12 14:58:34,242] {taskinstance.py:1068} INFO - 
   [2021-05-12 14:58:34,242] {taskinstance.py:1069} INFO - Starting attempt 1 
of 1
   [2021-05-12 14:58:34,242] {taskinstance.py:1070} INFO - 
   [2021-05-12 14:58:34,251] {taskinstance.py:1089} INFO - Executing 
<Task(PythonVirtualenvOperator): virtualenv_python> on 
2021-05-12T12:58:31.030337+00:00
   [2021-05-12 14:58:34,253] {standard_task_runner.py:52} INFO - Started 
process 21525 to run task
   [2021-05-12 14:58:34,259] {standard_task_runner.py:76} INFO - Running: 
['airflow', 'tasks', 'run', 'example_python_operator', 'virtualenv_python', 
'2021-05-12T12:58:31.030337+00:00', '--job-id', '10', '--pool', 'default_pool', 
'--raw', '--subdir', 
'/usr/local/Caskroom/miniconda/base/envs/airflow-demo/lib/python3.7/site-packages/airflow/example_dags/example_python_operator.py',
 '--cfg-path', '/var/folders/24/749gpxs95rgdkck0hympsrtw0000gq/T/tmpq87t01wq', 
'--error-file', '/var/folders/24/749gpxs95rgdkck0hympsrtw0000gq/T/tmp7qdftbgp']
   [2021-05-12 14:58:34,261] {standard_task_runner.py:77} INFO - Job 10: 
Subtask virtualenv_python
   [2021-05-12 14:58:34,291] {logging_mixin.py:104} INFO - Running 
<TaskInstance: example_python_operator.virtualenv_python 
2021-05-12T12:58:31.030337+00:00 [running]> on host 1.0.0.127.in-addr.arpa
   [2021-05-12 14:58:34,310] {taskinstance.py:1283} INFO - Exporting the 
following env vars:
   AIRFLOW_CTX_DAG_OWNER=airflow
   AIRFLOW_CTX_DAG_ID=example_python_operator
   AIRFLOW_CTX_TASK_ID=virtualenv_python
   AIRFLOW_CTX_EXECUTION_DATE=2021-05-12T12:58:31.030337+00:00
   AIRFLOW_CTX_DAG_RUN_ID=manual__2021-05-12T12:58:31.030337+00:00
   [2021-05-12 14:58:34,311] {process_utils.py:135} INFO - Executing cmd: 
virtualenv /var/folders/24/749gpxs95rgdkck0hympsrtw0000gq/T/venvffi0x_sl
   [2021-05-12 14:58:34,315] {taskinstance.py:1482} ERROR - Task failed with 
exception
   Traceback (most recent call last):
     File 
"/usr/local/Caskroom/miniconda/base/envs/airflow-demo/lib/python3.7/site-packages/airflow/models/taskinstance.py",
 line 1138, in _run_raw_task
       self._prepare_and_execute_task_with_callbacks(context, task)
     File 
"/usr/local/Caskroom/miniconda/base/envs/airflow-demo/lib/python3.7/site-packages/airflow/models/taskinstance.py",
 line 1311, in _prepare_and_execute_task_with_callbacks
       result = self._execute_task(context, task_copy)
     File 
"/usr/local/Caskroom/miniconda/base/envs/airflow-demo/lib/python3.7/site-packages/airflow/models/taskinstance.py",
 line 1341, in _execute_task
       result = task_copy.execute(context=context)
     File 
"/usr/local/Caskroom/miniconda/base/envs/airflow-demo/lib/python3.7/site-packages/airflow/operators/python.py",
 line 493, in execute
       super().execute(context=serializable_context)
     File 
"/usr/local/Caskroom/miniconda/base/envs/airflow-demo/lib/python3.7/site-packages/airflow/operators/python.py",
 line 117, in execute
       return_value = self.execute_callable()
     File 
"/usr/local/Caskroom/miniconda/base/envs/airflow-demo/lib/python3.7/site-packages/airflow/operators/python.py",
 line 509, in execute_callable
       requirements=self.requirements,
     File 
"/usr/local/Caskroom/miniconda/base/envs/airflow-demo/lib/python3.7/site-packages/airflow/utils/python_virtualenv.py",
 line 64, in prepare_virtualenv
       execute_in_subprocess(virtualenv_cmd)
     File 
"/usr/local/Caskroom/miniconda/base/envs/airflow-demo/lib/python3.7/site-packages/airflow/utils/process_utils.py",
 line 136, in execute_in_subprocess
       proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, 
stderr=subprocess.STDOUT, bufsize=0, close_fds=True)
     File 
"/usr/local/Caskroom/miniconda/base/envs/airflow-demo/lib/python3.7/subprocess.py",
 line 800, in __init__
       restore_signals, start_new_session)
     File 
"/usr/local/Caskroom/miniconda/base/envs/airflow-demo/lib/python3.7/subprocess.py",
 line 1551, in _execute_child
       raise child_exception_type(errno_num, err_msg, err_filename)
   FileNotFoundError: [Errno 2] No such file or directory: 'virtualenv': 
'virtualenv'
   [2021-05-12 14:58:34,319] {taskinstance.py:1532} INFO - Marking task as 
FAILED. dag_id=example_python_operator, task_id=virtualenv_python, 
execution_date=20210512T125831, start_date=20210512T125834, 
end_date=20210512T125834
   [2021-05-12 14:58:34,358] {local_task_job.py:146} INFO - Task exited with 
return code 1
   ```
   


-- 
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.

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


Reply via email to