You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/06/15 13:03:00 UTC

[jira] [Commented] (AIRFLOW-4347) airflow webserver can not load webserver_config.py

    [ https://issues.apache.org/jira/browse/AIRFLOW-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17135834#comment-17135834 ] 

ASF GitHub Bot commented on AIRFLOW-4347:
-----------------------------------------

WesleyBatista commented on pull request #5129:
URL: https://github.com/apache/airflow/pull/5129#issuecomment-644120848


   I also experienced this problem.
   
   The airflow installation was working fine until I started enabling RBAC.
   
   It is quite annoying to realize that this happens due to `AIRFLOW_HOME` being set as:
   
   ```
   export AIRFLOW_HOME=./airflow-home
   ```
   
   **RBAC** **UI** currently requires **`AIRFLOW_HOME`** to be an absolute path, otherwise it fails silently with `FileNotFoundError`:
   
   ```
   $ airflow webserver
   jjdksjds
   jjdksjds
     ____________       _____________
    ____    |__( )_________  __/__  /________      __
   ____  /| |_  /__  ___/_  /_ __  /_  __ \_ | /| / /
   ___  ___ |  / _  /   _  __/ _  / / /_/ /_ |/ |/ /
    _/_/  |_/_/  /_/    /_/    /_/  \____/____/|__/
   dlkshdlkjshldkjshlkajhdlkjsahlkjd
   ./airflow-home/webserver_config.py
   Traceback (most recent call last):
     File "/home/wesley/devel/airflow-rbac/venv/bin/airflow", line 37, in <module>
       args.func(args)
     File "/home/wesley/devel/airflow-rbac/venv/lib/python3.7/site-packages/airflow/utils/cli.py", line 75, in wrapper
       return f(*args, **kwargs)
     File "/home/wesley/devel/airflow-rbac/venv/lib/python3.7/site-packages/airflow/bin/cli.py", line 900, in webserver
       app = cached_app_rbac(None) if settings.RBAC else cached_app(None)
     File "/home/wesley/devel/airflow-rbac/venv/lib/python3.7/site-packages/airflow/www_rbac/app.py", line 298, in cached_app
       app, _ = create_app(config, session, testing)
     File "/home/wesley/devel/airflow-rbac/venv/lib/python3.7/site-packages/airflow/www_rbac/app.py", line 66, in create_app
       app.config.from_pyfile(settings.WEBSERVER_CONFIG)
     File "/home/wesley/devel/airflow-rbac/venv/lib/python3.7/site-packages/flask/config.py", line 131, in from_pyfile
       with open(filename, mode="rb") as config_file:
   FileNotFoundError: [Errno 2] Unable to load configuration file (No such file or directory): '/home/wesley/devel/airflow-rbac/venv/lib/python3.7/site-packages/airflow/www_rbac/./airflow-home/webserver_config.py'
   (venv) 
   ```
   
   The traceback is shown because I removed the `silent=True` from the following line:
   
   https://github.com/apache/airflow/blob/8b0528993686564e99ce06f4e634dae1e0d25698/airflow/www_rbac/app.py#L64
   
   I could proceed by setting **`AIRFLOW_HOME`** as:
   
   ```
   export AIRFLOW_HOME=$(pwd)/airflow-home
   ```
   
   I don't find any mention in the docs that `AIRFLOW_HOME` needs to be an absolute path.
   
   Since RBAC UI is going to be the default in the next major release ([blog post mentioning that](https://airflow.apache.org/blog/airflow-1.10.10/#use-airflow-rbac-ui)) I think we could improve something here in order to make the migration smoother.


----------------------------------------------------------------
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:
users@infra.apache.org


> airflow webserver can not load webserver_config.py
> --------------------------------------------------
>
>                 Key: AIRFLOW-4347
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4347
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: webserver
>    Affects Versions: 1.10.3
>            Reporter: sumous
>            Assignee: sumous
>            Priority: Minor
>
> I set AIRFLOW_HOME=./ 
> command *airflow initdb* is ok.
> And command *airflow webserver* got this:
> {code:shell}
> /Users/guoguo/Downloads/env_tmp/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py:774: UserWarning: Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. Defaulting SQLALCHEMY_DATABASE_URI to "sqlite:///:memory:".
>   'Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. '
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)