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

Example causes migration scripts to show errors

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.10.9
    • Fix Version/s: None
    • Component/s: database
    • Labels:
      None

      Description

      When trying to install  fresh db you get this (harmless) error by default (with load_defaults=True).

       

      This should be fixed as it is misleading for the users.

       

      INFO [alembic.runtime.migration] Running upgrade 127d2bf2dfa7 -> cc1e65623dc7, add max tries column to task instance
      ERROR [airflow.models.dagbag.DagBag] Failed to import: /usr/local/lib/python3.6/site-packages/airflow/example_dags/example_subdag_operator.py
      Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1246, in _execute_context
      cursor, statement, parameters, context
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 588, in do_execute
      cursor.execute(statement, parameters)
      psycopg2.errors.UndefinedTable: relation "slot_pool" does not exist
      LINE 2: FROM slot_pool
      ^

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/airflow/models/dagbag.py", line 204, in process_file
      m = imp.load_source(mod_name, filepath)
      File "/usr/local/lib/python3.6/imp.py", line 172, in load_source
      module = _load(spec)
      File "<frozen importlib._bootstrap>", line 684, in _load
      File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 678, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/usr/local/lib/python3.6/site-packages/airflow/example_dags/example_subdag_operator.py", line 47, in <module>
      dag=dag,
      File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 74, in wrapper
      return func(*args, **kwargs)
      File "/usr/local/lib/python3.6/site-packages/airflow/utils/decorators.py", line 98, in wrapper
      result = func(*args, **kwargs)
      File "/usr/local/lib/python3.6/site-packages/airflow/operators/subdag_operator.py", line 77, in _init_
      .filter(Pool.pool == self.pool)
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3287, in first
      ret = list(self[0:1])
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3065, in _getitem_
      return list(res)
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3389, in _iter_
      return self._execute_and_instances(context)
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3414, in _execute_and_instances
      result = conn.execute(querycontext.statement, self._params)
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 982, in execute
      return meth(self, multiparams, params)
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 293, in _execute_on_connection
      return connection._execute_clauseelement(self, multiparams, params)
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1101, in _execute_clauseelement
      distilled_params,
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1250, in _execute_context
      e, statement, parameters, cursor, context
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1476, in _handle_dbapi_exception
      util.raise_from_cause(sqlalchemy_exception, exc_info)
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
      reraise(type(exception), exception, tb=exc_tb, cause=cause)
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
      raise value.with_traceback(tb)
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1246, in _execute_context
      cursor, statement, parameters, context
      File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 588, in do_execute
      cursor.execute(statement, parameters)
      sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "slot_pool" does not exist
      LINE 2: FROM slot_pool
      ^

      [SQL: SELECT slot_pool.id AS slot_pool_id, slot_pool.pool AS slot_pool_pool, slot_pool.slots AS slot_pool_slots, slot_pool.description AS slot_pool_description
      FROM slot_pool
      WHERE slot_pool.slots = %(slots_1)s AND slot_pool.pool = %(pool_1)s
      LIMIT %(param_1)s]
      [parameters: \{'slots_1': 1, 'pool_1': 'default_pool', 'param_1': 1}]
      (Background on this error at: http://sqlalche.me/e/f405)
      INFO [alembic.runtime.migration] Running upgrade cc1e65623dc7 -> bdaa763e6c56, Make xcom value column a large binary

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                potiuk Jarek Potiuk
                Reporter:
                potiuk Jarek Potiuk
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: