You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/02/19 20:20:15 UTC

[GitHub] [airflow] stbones opened a new issue #14322: Airflow Login Failed After Creating User

stbones opened a new issue #14322:
URL: https://github.com/apache/airflow/issues/14322


   <!--
   
   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**:
   1.10.14
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`):
   No Kubernetes 
   **Environment**:
   
   - **Cloud provider or hardware configuration**:
   - **OS** (e.g. from /etc/os-release):
   Linux 
   - **Kernel** (e.g. `uname -a`):
   - **Install tools**:
   - **Others**:
   
   **What happened**:
   I have created an admin user using below command for first time, and it was successfully created as I have received a message saying - Admin user test_admin created. I can also see a record in ab_user table (postgreSQL). However, when I try to log in with the credential (I ensured I did not type wrong credential) on Airflow WebUI, I get ERROR Invalid Login.
   <!-- (please include exact error messages if you can) -->
   
   **What you expected to happen**:
   I should be able to log in with the credential I have created. 
   <!-- What do you think went wrong? -->
   I am not sure, what went wrong. And, this my first time setting up authentication. 
   I have set rbac = true in airflow.cfg file.
   
   **How to reproduce it**:
   <!---
   Try to log in with the credential 
   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.
   
   --->
   
   
   **Anything else we need to know**:
   I have recently changed the backend db to PostgreSQL. 
   I have followed below steps
   
   Updated airflow.cfg file with 
   ```
   [webserver]
   authenticate = True
   auth_backend = airflow.contrib.auth.backends.password_auth
   ```
   
   Activate virtual env.
   `source airflow_env/bin/activate`
   
   Set Airflow Home
   `export AIRFLOW_HOME=/tools/airflow_lib`
   
   Install postgreSQL
   `sudo apt-get install postgresql postgresql-contrib`
   
   Create user and database
   
   ` sudo -u postgres psql`
    `CREATE USER **** PASSWORD '****';`
   ` CREATE DATABASE airflow_db;`
    `GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO user;`
   
   Update postgresql.conf with:
   `listen_addresses= 'localhost'`
   
   Update/add pg_hba.conf with
   Update
   `#host all all 127.0.0.1/32 md`
   `host all all 0.0.0.0/0 reject`
   Add below IP address 
   `host airflow_db user ***.***.***.**/32 md5`
   
   Update airflow.cfg file with
   `sql_alchemy_conn = postgresql+psycopg2://user-name:password@localhost:5432/db-name`
   
   Restart PostgreSQL database.
   `sudo service postgresql restart`
   
   Restart airflow database
   `airflow resetdb`
   <!--
   
   How often does this problem occur? Once? Every time etc?
   Everytime. 
   Any relevant logs to include? Put them here in side a detail tag:
   <details><summary>x.log</summary> lots of stuff </details>
   
   -->
   


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



[GitHub] [airflow] potiuk closed issue #14322: Airflow Login Failed After Creating User

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #14322:
URL: https://github.com/apache/airflow/issues/14322


   


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



[GitHub] [airflow] alonrolnik removed a comment on issue #14322: Airflow Login Failed After Creating User

Posted by GitBox <gi...@apache.org>.
alonrolnik removed a comment on issue #14322:
URL: https://github.com/apache/airflow/issues/14322#issuecomment-982441020


   > @VBhojawala Thank you it worked out..
   > 
   > I noticed another issue, password does not take few special characters like $, &, etc. Example I had password TestAirflow123&, I could not log in with it, but when I change it to TestAirflow123, it worked out. Are there any special rules for setting up password?
   
   This `$` save our prod deployment now :)


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] stbones commented on issue #14322: Airflow Login Failed After Creating User

Posted by GitBox <gi...@apache.org>.
stbones commented on issue #14322:
URL: https://github.com/apache/airflow/issues/14322#issuecomment-782749823


   @VBhojawala  Thank you it worked out.. 
   
   I noticed another issue, password does not take few special characters like $, &, etc. Example I had password TestAirflow123&, I could not log in with it, but when I change it to TestAirflow123, it worked out. Are there any special rules for setting up password?  


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



[GitHub] [airflow] alonrolnik commented on issue #14322: Airflow Login Failed After Creating User

Posted by GitBox <gi...@apache.org>.
alonrolnik commented on issue #14322:
URL: https://github.com/apache/airflow/issues/14322#issuecomment-982441020


   > @VBhojawala Thank you it worked out..
   > 
   > I noticed another issue, password does not take few special characters like $, &, etc. Example I had password TestAirflow123&, I could not log in with it, but when I change it to TestAirflow123, it worked out. Are there any special rules for setting up password?
   
   This `$` save our prod deployment now :)


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] VBhojawala commented on issue #14322: Airflow Login Failed After Creating User

Posted by GitBox <gi...@apache.org>.
VBhojawala commented on issue #14322:
URL: https://github.com/apache/airflow/issues/14322#issuecomment-782558232


   In my humble opinion 
   
   airflow resetdb : removes all entries (Records) from  database.
   
   airflow init : initalize the database. 
   https://airflow.apache.org/docs/apache-airflow/1.10.8/howto/initialize-database.html
   
   After initializing database you can create new user using 
   
   "airflow users create --role Admin --username admin --password admin --email admin@example.com --firstname foo --lastname bar"
   
   
   


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



[GitHub] [airflow] potiuk commented on issue #14322: Airflow Login Failed After Creating User

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #14322:
URL: https://github.com/apache/airflow/issues/14322#issuecomment-782766385


   You need to quote parameters in bash when you have special characters. In Bash/Zsh when you put & without quote it is "go to background" indicator. This is probably the problem you had.
   
   I am closing the issue for now unless there are other findings.


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