UnightSun opened a new issue #17804:
URL: https://github.com/apache/airflow/issues/17804


   <!--
   Welcome to Apache Airflow!
   
   Please complete the next sections or the issue will be closed.
   -->
   
   **Apache Airflow version**: 2.1.2
   
   <!-- AIRFLOW VERSION IS MANDATORY -->
   
   **OS**: CentOS Linux release 8.2.2004 (Core)
   
   <!-- MANDATORY! You can get it via `cat /etc/oss-release` for example -->
   
   **Apache Airflow Provider versions**: 
   apache-airflow-providers-celery==2.0.0
   apache-airflow-providers-ftp==2.0.0
   apache-airflow-providers-http==2.0.0
   apache-airflow-providers-imap==2.0.0
   apache-airflow-providers-mysql==2.1.0
   apache-airflow-providers-redis==2.0.0
   apache-airflow-providers-sftp==2.1.0
   apache-airflow-providers-sqlite==2.0.0
   apache-airflow-providers-ssh==2.1.0
   
   <!-- You can use `pip freeze | grep apache-airflow-providers` (you can leave 
only relevant ones)-->
   
   **Deployment**: Virtualenv  3.7.5
   
   <!-- e.g. Virtualenv / VM / Docker-compose / K8S / Helm Chart / Managed 
Airflow Service -->
   
   <!-- Please include your deployment tools and versions: docker-compose, k8s, 
helm, etc -->
   
   **What happened**:
   Got error when I try to start a webserver:
   ```bash
   $ $VENV_PATH/bin/airflow webserver
   ...
   =================================================================
   Traceback (most recent call last):
     File "/VENV_PATH/bin/airflow", line 8, in <module>
       sys.exit(main())
     File "/VENV_PATH/lib/python3.7/site-packages/airflow/__main__.py", line 
40, in main
       args.func(args)
     File "/VENV_PATH/lib/python3.7/site-packages/airflow/cli/cli_parser.py", 
line 48, in command
       return func(*args, **kwargs)
     File "/VENV_PATH/lib/python3.7/site-packages/airflow/utils/cli.py", line 
91, in wrapper
       return f(*args, **kwargs)
     File 
"/VENV_PATH/lib/python3.7/site-packages/airflow/cli/commands/webserver_command.py",
 line 483, in webserver
       with subprocess.Popen(run_args, close_fds=True) as gunicorn_master_proc:
     File "/home/user/.pyenv/versions/3.7.5/lib/python3.7/subprocess.py", line 
800, in __init__
       restore_signals, start_new_session)
     File "/home/user/.pyenv/versions/3.7.5/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: 'gunicorn': 
'gunicorn'
   [user@xxxxx xxxxxxxxxx]$ /VENV_PATH/bin/python
   Python 3.7.5 (default, Aug 20 2021, 17:16:24)
   ```
   
   <!-- Please include exact error messages if you can -->
   
   **What you expected to happen**:
   Airflow start webserver success
   
   <!-- What do you think went wrong? -->
   
   **How to reproduce it**:
   assume we already have `AIRFLOW_HOME`
   1. create a venv: `virtualenv xxx`
   2. `xxx/bin/pip install apache-airflow`
   3. `xxx/bin/airflow webserver`
   
   <!--
   As minimally and precisely as possible. Keep in mind we do not have access 
to your cluster or dags.
   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/screen-casts etc. by drag-dropping the image here.
   -->
   
   **Anything else we need to know**:
   `cli/commands/webserver_command.py:394` use `gunicorn` as subprocess 
command, assume it's in PATH.
   `airflow webserver` runs well after `export PATH=$PATH:$VENV_PATH/bin`.
   
   <!--
   How often does this problem occur? Once? Every time etc?
   Any relevant logs to include? Put them here inside fenced
   ``` ``` blocks or inside a foldable details tag if it's long:
   <details><summary>x.log</summary> lots of stuff </details>
   -->
   
   **Are you willing to submit a PR?**
   I'm not good at python so maybe it's not a good idea for me to submit a PR.
   
   <!---
   This is absolutely not required, but we are happy to guide you in 
contribution process
   especially if you already have a good understanding of how to implement the 
fix.
   Airflow is a community-managed project and we love to bring new contributors 
in.
   Find us in #airflow-how-to-pr on Slack!
    -->
   


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