Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-5069

`airflow initdb` crashes when owner is set to None

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.10.3
    • Fix Version/s: None
    • Component/s: cli, database
    • Labels:
      None

      Description

      `airflow initdb` crashes when there is a dag in dag folder that has owner set to None. It crashes with the following error:

      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

       

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              aarutyunyan Arsen Arutyunyan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: