Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Unable to view or browse dags in web UI after migrated airflow 1.9.0 to 1.10.10 #8752

Closed
mmuru opened this issue May 7, 2020 · 11 comments
Labels
kind:bug This is a clearly a bug

Comments

@mmuru
Copy link

mmuru commented May 7, 2020

Apache Airflow version: airflow 1.10.10

Environment:

  • OS (e.g. from /etc/os-release): Mac

What happened:
Ooops! throws exception File "/Users/muru/opensrc/py36/airflow_110/venv368/lib/python3.6/site-packages/airflow/www/templates/airflow/dags.html", line 84, in block "body" <a href="{{ url_for('airflow.'+ dag.get_default_view(), dag_id=dag.dag_id) }}" title="{{ dag.description[0:80] + '...' if dag.description|length > 80 else dag.description }}"> TypeError: object of type 'NoneType' has no len()

What you expected to happen:
Should able to load page without errors or exceptions.

The description column in dag table can be null. But in the dags.html, should check dag.decription is not null before perform length filter.

How to reproduce it:
migrate airflow 1.9.0 to 1.10.10
Perform airflow upgradedb
start airflow webserver
launch and open http://localhost:8080/

Anything else we need to know:
Line 84 in airflow/www/templates/airflow/dags.html file, replace the condition
if dag.description|length > 80 change to if dag.description and dag.description|length > 80

As a workaround, perform the following db update and open http://localhost:8080/
update dag set description=' ' where description is null;

@mmuru mmuru added the kind:bug This is a clearly a bug label May 7, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented May 7, 2020

Thanks for opening your first issue here! Be sure to follow the issue template!

@mik-laj
Copy link
Member

mik-laj commented May 7, 2020

Here is related PR: https://github.com/apache/airflow/pull/7593/files
@zhongjiajie Can you look at it?

@zhongjiajie
Copy link
Member

Thanks @mik-laj to notice that, but is odd that #7593 not release in 1.10.10, and the reporter solution is also my PR's solution. And @kaxil milestone PR in 1.10.11, I think it will be fix after 1.10.11 release, cc: @mmuru

@zhongjiajie
Copy link
Member

BTW, I will check which PR cause this error

@zhongjiajie
Copy link
Member

@mmuru I find out the original pr is #7457, and I think it should not cause error because dag.description default value is ''(empty string),

description='', # type: str

unless you define description=None in DAG files. if so maybe you should just remove the description define.

And, BTW, we have #7593 to fix that will release in 1.10.11, will use description=None as default value, and fix your situation

@zhongjiajie
Copy link
Member

Please mention me if you have further problem, I am sick recently and only check github twice a day, sorry about that.

@mmuru
Copy link
Author

mmuru commented May 7, 2020

@zhongjiajie: I reviewed PR #7457, It checks only dag.description length limit but dag.description can be null. In my case, as I mentioned the 1.9.0 dags didn't have description. The description column was introduced in 1.10 and the default is null. I reviewed PR #7593 and it will fix this issue.

@kaxil
Copy link
Member

kaxil commented May 7, 2020

Yes that PR will be cherry-picked in 1.10.11 and should fix the issue.

@zhongjiajie
Copy link
Member

@mmuru In this case I prefer to close this issue, would reopen it if you still have further information.

@shawnngtq
Copy link

I face the same issue. Commenting here for record

@kaxil
Copy link
Member

kaxil commented Jun 5, 2020

Cherry-picked to v1-10-test: d0de41c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

5 participants