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 2021/04/14 09:54:18 UTC

[GitHub] [airflow] nvnvashisth opened a new issue #15368: Airflow 2.0 crashed due airflow db reset command

nvnvashisth opened a new issue #15368:
URL: https://github.com/apache/airflow/issues/15368


   Hello Team,
   
   Currently I was trying to disable my example dag and because of which tutorial says, I have to disable them from airflow.cfg and perform airflow db reset.
   
   After performing that, my entire airflow has been crashed and it throw below error.
   
   > INFO  [alembic.runtime.migration] Running upgrade 08364691d074 -> fe461863935f, increase_length_for_connection_password
   > INFO  [alembic.runtime.migration] Running upgrade fe461863935f -> 7939bcff74ba, Add DagTags table
   > INFO  [alembic.runtime.migration] Running upgrade 7939bcff74ba -> a4c2fd67d16b, add pool_slots field to task_instance
   > INFO  [alembic.runtime.migration] Running upgrade a4c2fd67d16b -> 852ae6c715af, Add RenderedTaskInstanceFields table
   > INFO  [alembic.runtime.migration] Running upgrade 852ae6c715af -> 952da73b5eff, add dag_code table
   > INFO  [alembic.runtime.migration] Running upgrade 952da73b5eff -> a66efa278eea, Add Precision to execution_date in RenderedTaskInstanceFields table
   > INFO  [alembic.runtime.migration] Running upgrade a66efa278eea -> da3f683c3a5a, Add dag_hash Column to serialized_dag table
   > INFO  [alembic.runtime.migration] Running upgrade da3f683c3a5a -> 92c57b58940d, Create FAB Tables
   > INFO  [alembic.runtime.migration] Running upgrade 92c57b58940d -> 03afc6b6f902, Increase length of FAB ab_view_menu.name column
   > INFO  [alembic.runtime.migration] Running upgrade 03afc6b6f902 -> cf5dc11e79ad, drop_user_and_chart
   > Traceback (most recent call last):
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
   >     self.dialect.do_execute(
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
   >     cursor.execute(statement, parameters)
   > psycopg2.errors.UndefinedObject: constraint "known_event_user_id_fkey" of relation "known_event" does not exist
   > 
   > 
   > The above exception was the direct cause of the following exception:
   > 
   > Traceback (most recent call last):
   >   File "/home/airflow/airflow/airflow_2/bin/airflow", line 8, in <module>
   >     sys.exit(main())
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/airflow/__main__.py", line 40, in main
   >     args.func(args)
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/airflow/cli/cli_parser.py", line 48, in command
   >     return func(*args, **kwargs)
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/airflow/cli/commands/db_command.py", line 39, in resetdb
   >     db.resetdb()
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/airflow/utils/db.py", line 701, in resetdb
   >     initdb()
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/airflow/utils/db.py", line 549, in initdb
   >     upgradedb()
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/airflow/utils/db.py", line 688, in upgradedb
   >     command.upgrade(config, 'heads')
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/alembic/command.py", line 298, in upgrade
   >     script.run_env()
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/alembic/script/base.py", line 489, in run_env
   >     util.load_python_file(self.dir, "env.py")
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
   >     module = load_module_py(module_id, path)
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/alembic/util/compat.py", line 184, in load_module_py
   >     spec.loader.exec_module(module)
   >   File "<frozen importlib._bootstrap_external>", line 783, in exec_module
   >   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/airflow/migrations/env.py", line 108, in <module>
   >     run_migrations_online()
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/airflow/migrations/env.py", line 102, in run_migrations_online
   >     context.run_migrations()
   >   File "<string>", line 8, in run_migrations
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/alembic/runtime/environment.py", line 846, in run_migrations
   >     self.get_context().run_migrations(**kw)
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/alembic/runtime/migration.py", line 522, in run_migrations
   >     step.migration_fn(**kw)
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/airflow/migrations/versions/cf5dc11e79ad_drop_user_and_chart.py", line 49, in upgrade
   >     op.drop_constraint('known_event_user_id_fkey', 'known_event')
   >   File "<string>", line 8, in drop_constraint
   >   File "<string>", line 3, in drop_constraint
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/alembic/operations/ops.py", line 159, in drop_constraint
   >     return operations.invoke(op)
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/alembic/operations/base.py", line 373, in invoke
   >     return fn(self, operation)
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/alembic/operations/toimpl.py", line 158, in drop_constraint
   >     operations.impl.drop_constraint(
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/alembic/ddl/impl.py", line 248, in drop_constraint
   >     self._exec(schema.DropConstraint(const))
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/alembic/ddl/impl.py", line 141, in _exec
   >     return conn.execute(construct, *multiparams, **params)
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
   >     return meth(self, multiparams, params)
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection
   >     return connection._execute_ddl(self, multiparams, params)
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1068, in _execute_ddl
   >     ret = self._execute_context(
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
   >     self._handle_dbapi_exception(
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
   >     util.raise_(
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
   >     raise exception
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
   >     self.dialect.do_execute(
   >   File "/home/airflow/airflow/airflow_2/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
   >     cursor.execute(statement, parameters)
   > sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) constraint "known_event_user_id_fkey" of relation "known_event" does not exist
   > 
   > [SQL: ALTER TABLE known_event DROP CONSTRAINT known_event_user_id_fkey]
   > (Background on this error at: http://sqlalche.me/e/13/f405)
   
   Looking forward to have support.


-- 
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] jaimegm edited a comment on issue #15368: Airflow 2.0 crashed due airflow db reset command

Posted by GitBox <gi...@apache.org>.
jaimegm edited a comment on issue #15368:
URL: https://github.com/apache/airflow/issues/15368#issuecomment-820211702


   It's not required to reset your db to stop the Web UI from loading the examples. Resetting your db will erase all of your credentials Usually adjusting the airflow.cfg, reinstall and restart will remove the example dags. It looks a issue related to your upgrade. Its recommended upgrading to  1.10.15 before upgrading to 2.0 and running checks. 
   
    [Upgrading to 2.0](https://airflow.apache.org/docs/apache-airflow/stable/upgrading-to-2.html#step-7-upgrade-to-airflow-2-0)
   
   I attempted to upgrade without using the bridge release and received an error similar to what you are seeing


-- 
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] jaimegm commented on issue #15368: Airflow 2.0 crashed due airflow db reset command

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


   It's not required to reset your db to stop the Web UI from loading the examples. Resetting your db will erase all of your credentials. It looks a issue related to your upgrade. Its recommended upgrading to  1.10.15 before upgrading to 2.0 and running checks. 
   
    [Upgrading to 2.0](https://airflow.apache.org/docs/apache-airflow/stable/upgrading-to-2.html#step-7-upgrade-to-airflow-2-0)
   
   I attempted to upgrade without using the bridge release and received an error similar to what you are seeing


-- 
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] github-actions[bot] closed issue #15368: Airflow 2.0 crashed due airflow db reset command

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #15368:
URL: https://github.com/apache/airflow/issues/15368


   


-- 
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] boring-cyborg[bot] commented on issue #15368: Airflow 2.0 crashed due airflow db reset command

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #15368:
URL: https://github.com/apache/airflow/issues/15368#issuecomment-819392372


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


-- 
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] github-actions[bot] commented on issue #15368: Airflow 2.0 crashed due airflow db reset command

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #15368:
URL: https://github.com/apache/airflow/issues/15368#issuecomment-868084940


   This issue has been closed because it has not received response from the issue author.


-- 
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