You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Andrey Klochkov (Jira)" <ji...@apache.org> on 2019/12/20 21:04:00 UTC

[jira] [Commented] (AIRFLOW-5069) `airflow initdb` crashes when owner is set to None

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

Andrey Klochkov commented on AIRFLOW-5069:
------------------------------------------

The other problem with this defect is that new dags won't appear in the webserver UI just because scheduler fails to do Dag.sync_to_db for such dags. We spent quite a bit of time trying to figure out why dags can be executed with backfill and are present in the list_dags output but webserver would never ever show them in the list. Turns out this is the same defect that's causing that. That's happening with dags that have "owner" set to None.

> `airflow initdb` crashes when owner is set to None
> --------------------------------------------------
>
>                 Key: AIRFLOW-5069
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5069
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: cli, database
>    Affects Versions: 1.10.3
>            Reporter: Arsen Arutyunyan
>            Priority: Minor
>
> `airflow initdb` crashes when there is a dag in dag folder that has owner set to None. It crashes with the following error:
> {code:java}
> Traceback (most recent call last):
> File "/usr/local/bin/airflow", line 32, in <module>
> args.func(args)
> File "/usr/local/lib/python3.6/site-packages/airflow/bin/cli.py", line 1096, in initdb
> db.initdb(settings.RBAC)
> File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 317, in initdb
> dag.sync_to_db()
> File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 73, in wrapper
> return func(*args, **kwargs)
> File "/usr/local/lib/python3.6/site-packages/airflow/models/__init__.py", line 4105, in sync_to_db
> owner = self.owner
> File "/usr/local/lib/python3.6/site-packages/airflow/models/__init__.py", line 3381, in owner
> return ", ".join(list(set([t.owner for t in self.tasks])))
> TypeError: sequence item 0: expected str instance, NoneType found{code}
>  
> This command which sole role is to initialize metadata database lies on the critical path of any Airflow deployment. Having bad dag in dag folder should not lead to the failure of this command.



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