You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/05/22 10:21:02 UTC

[GitHub] [airflow] dimitrijepetrovic opened a new issue #8967: 2.0.0 - db upgrade fails on missing dag_stats

dimitrijepetrovic opened a new issue #8967:
URL: https://github.com/apache/airflow/issues/8967


   the error happens because of "drop table <table", rather than "drop table if exists <table>" like in all other places
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on issue #8967: 2.0.0 - db upgrade fails on missing dag_stats

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #8967:
URL: https://github.com/apache/airflow/issues/8967#issuecomment-632642806


   migrations are recorded when they are performed, and are only run once.
   
   It should be impossible for the table to be dropped without also recording that the migration was deleted.
   
   Further: 2.0 isn't a release yet, so if you are targeting master branch you might get breakages like this.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb closed issue #8967: 2.0.0 - db upgrade fails on missing dag_stats

Posted by GitBox <gi...@apache.org>.
ashb closed issue #8967:
URL: https://github.com/apache/airflow/issues/8967


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ngreen-ny commented on issue #8967: 2.0.0 - db upgrade fails on missing dag_stats

Posted by GitBox <gi...@apache.org>.
ngreen-ny commented on issue #8967:
URL: https://github.com/apache/airflow/issues/8967#issuecomment-778186953


   Still seeing this issue come up:
   
   + airflow db init
   /usr/local/lib/python3.6/site-packages/airflow/configuration.py:336 DeprecationWarning: The logging_level option in [core] has been moved to the logging_level option in [logging] - the old setting has been used, but please update your config.
   /usr/local/lib/python3.6/site-packages/airflow/configuration.py:336 DeprecationWarning: The base_log_folder option in [core] has been moved to the base_log_folder option in [logging] - the old setting has been used, but please update your config.
   /usr/local/lib/python3.6/site-packages/airflow/configuration.py:336 DeprecationWarning: The statsd_on option in [scheduler] has been moved to the statsd_on option in [metrics] - the old setting has been used, but please update your config.
   /usr/local/lib/python3.6/site-packages/airflow/configuration.py:336 DeprecationWarning: The statsd_host option in [scheduler] has been moved to the statsd_host option in [metrics] - the old setting has been used, but please update your config.
   /usr/local/lib/python3.6/site-packages/airflow/configuration.py:336 DeprecationWarning: The statsd_port option in [scheduler] has been moved to the statsd_port option in [metrics] - the old setting has been used, but please update your config.
   /usr/local/lib/python3.6/site-packages/airflow/configuration.py:336 DeprecationWarning: The statsd_prefix option in [scheduler] has been moved to the statsd_prefix option in [metrics] - the old setting has been used, but please update your config.
   DB: postgresql+psycopg2://username:***@postgres-airflow-test5432/airflow
   [2021-02-12 12:30:39,941] {db.py:674} INFO - Creating tables
   INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
   INFO  [alembic.runtime.migration] Will assume transactional DDL.
   INFO  [alembic.runtime.migration] Running upgrade c8ffec048a3b -> a56c9515abdc, Remove dag_stat table
   Traceback (most recent call last):
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
       cursor, statement, parameters, context
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
       cursor.execute(statement, parameters)
   psycopg2.ProgrammingError: table "dag_stats" does not exist
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File "/usr/local/bin/airflow", line 8, in <module>
       sys.exit(main())
     File "/usr/local/lib/python3.6/site-packages/airflow/__main__.py", line 40, in main
       args.func(args)
     File "/usr/local/lib/python3.6/site-packages/airflow/cli/cli_parser.py", line 48, in command
       return func(*args, **kwargs)
     File "/usr/local/lib/python3.6/site-packages/airflow/cli/commands/db_command.py", line 31, in initdb
       db.initdb()
     File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 549, in initdb
       upgradedb()
     File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 684, in upgradedb
       command.upgrade(config, 'heads')
     File "/usr/local/lib/python3.6/site-packages/alembic/command.py", line 294, in upgrade
       script.run_env()
     File "/usr/local/lib/python3.6/site-packages/alembic/script/base.py", line 481, in run_env
       util.load_python_file(self.dir, "env.py")
     File "/usr/local/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 97, in load_python_file
       module = load_module_py(module_id, path)
     File "/usr/local/lib/python3.6/site-packages/alembic/util/compat.py", line 182, in load_module_py
       spec.loader.exec_module(module)
     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/migrations/env.py", line 108, in <module>
       run_migrations_online()
     File "/usr/local/lib/python3.6/site-packages/airflow/migrations/env.py", line 102, in run_migrations_online
       context.run_migrations()
     File "<string>", line 8, in run_migrations
     File "/usr/local/lib/python3.6/site-packages/alembic/runtime/environment.py", line 813, in run_migrations
       self.get_context().run_migrations(**kw)
     File "/usr/local/lib/python3.6/site-packages/alembic/runtime/migration.py", line 560, in run_migrations
       step.migration_fn(**kw)
     File "/usr/local/lib/python3.6/site-packages/airflow/migrations/versions/a56c9515abdc_remove_dag_stat_table.py", line 39, in upgrade
       op.drop_table("dag_stats")
     File "<string>", line 8, in drop_table
     File "<string>", line 3, in drop_table
     File "/usr/local/lib/python3.6/site-packages/alembic/operations/ops.py", line 1166, in drop_table
       operations.invoke(op)
     File "/usr/local/lib/python3.6/site-packages/alembic/operations/base.py", line 354, in invoke
       return fn(self, operation)
     File "/usr/local/lib/python3.6/site-packages/alembic/operations/toimpl.py", line 72, in drop_table
       operation.to_table(operations.migration_context)
     File "/usr/local/lib/python3.6/site-packages/alembic/ddl/impl.py", line 297, in drop_table
       self._exec(schema.DropTable(table))
     File "/usr/local/lib/python3.6/site-packages/alembic/ddl/impl.py", line 146, in _exec
       return conn.execute(construct, multiparams)
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
       return meth(self, multiparams, params)
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection
       return connection._execute_ddl(self, multiparams, params)
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1073, in _execute_ddl
       compiled,
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
       e, statement, parameters, cursor, context
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
       sqlalchemy_exception, with_traceback=exc_info[2], from_=e
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
       raise exception
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
       cursor, statement, parameters, context
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
       cursor.execute(statement, parameters)
   sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) table "dag_stats" does not exist
   
   [SQL:
   DROP TABLE dag_stats]
   (Background on this error at: http://sqlalche.me/e/13/f405)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org