Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Airflow can not enter the /admin page after initdb

Tags:

python

airflow

I wanted to clear all example dags, so that I ran the command airflow initdb. However, I was not able to enter the admin page after that, as there was something wrong:

  File "/data/software/miniconda3/lib/python3.7/site-packages/flask_admin/menu.py", line 126, in is_accessible
    return self._view.is_accessible()
  File "/data/software/miniconda3/lib/python3.7/site-packages/airflow/www/utils.py", line 93, in is_accessible
    (not current_user.is_anonymous and current_user.is_superuser())
  File "/data/software/miniconda3/lib/python3.7/site-packages/airflow/contrib/auth/backends/password_auth.py", line 114, in is_superuser
    return hasattr(self, 'user') and self.user.is_superuser()
AttributeError: 'NoneType' object has no attribute 'is_superuser'

I tried to create the same superuser as before, but it still got the same error.

Is there any idea how to fix it? Thanks in advance.

like image 433
DennisLi Avatar asked Sep 13 '19 01:09

DennisLi


People also ask

How do I add authentication to airflow?

Setting up Google AuthenticationSelect 'Credentials' from the left hand nav. Click 'Create credentials' and choose 'OAuth client ID' Choose 'Web application' Fill in the required information (the 'Authorized redirect URIs' must be fully qualified e.g. http://airflow.example.com/oauth2callback)

What is the default username and password for airflow?

default credentials -- user: admin - password: admin. How to create airflow users?


1 Answers

I solved it by cleaning the cookie and password stored in the browser and refresh the admin login page again. It would be showing the login form as normal.

I don't know if this is counted as a bug.

like image 66
DennisLi Avatar answered Sep 28 '22 11:09

DennisLi