ltyzzzxxx opened a new issue, #31404:
URL: https://github.com/apache/airflow/issues/31404

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### What happened
   
   The airflow version is 2.2.2.
   
   I ran `airflow db init`, then the error occured. 
   
   However, the most strangest thing is that I ran the same command on the 
other cluster with the same version but it could run normally.
   
   The following is the specific error message:
   Running upgrade 142555e44c17 -> 7b2661a43ba3, TaskInstance keyed to DagRun
   Traceback (most recent call last):
     File "/usr/local/bin/airflow", line 8, in <module>
       sys.exit(main())
     File "/usr/local/lib/python3.7/site-packages/airflow/__main__.py", line 
48, in main
       args.func(args)
     File "/usr/local/lib/python3.7/site-packages/airflow/cli/cli_parser.py", 
line 48, in command
       return func(*args, **kwargs)
     File 
"/usr/local/lib/python3.7/site-packages/airflow/cli/commands/db_command.py", 
line 31, in initdb
       db.initdb()
     File "/usr/local/lib/python3.7/site-packages/airflow/utils/session.py", 
line 70, in wrapper
       return func(*args, session=session, **kwargs)
     File "/usr/local/lib/python3.7/site-packages/airflow/utils/db.py", line 
592, in initdb
       upgradedb(session=session)
     File "/usr/local/lib/python3.7/site-packages/airflow/utils/session.py", 
line 67, in wrapper
       return func(*args, **kwargs)
     File "/usr/local/lib/python3.7/site-packages/airflow/utils/db.py", line 
911, in upgradedb
       command.upgrade(config, 'heads')
     File "/usr/local/lib/python3.7/site-packages/alembic/command.py", line 
385, in upgrade
       script.run_env()
     File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 
582, in run_env
       util.load_python_file(self.dir, "env.py")
     File "/usr/local/lib/python3.7/site-packages/alembic/util/pyfiles.py", 
line 94, in load_python_file
       module = load_module_py(module_id, path)
     File "/usr/local/lib/python3.7/site-packages/alembic/util/pyfiles.py", 
line 110, in load_module_py
       spec.loader.exec_module(module)  # type: ignore
     File "<frozen importlib._bootstrap_external>", line 728, in exec_module
     File "<frozen importlib._bootstrap>", line 219, in 
_call_with_frames_removed
     File "/usr/local/lib/python3.7/site-packages/airflow/migrations/env.py", 
line 107, in <module>
       run_migrations_online()
     File "/usr/local/lib/python3.7/site-packages/airflow/migrations/env.py", 
line 101, in run_migrations_online
       context.run_migrations()
     File "<string>", line 8, in run_migrations
     File 
"/usr/local/lib/python3.7/site-packages/alembic/runtime/environment.py", line 
928, in run_migrations
       self.get_context().run_migrations(**kw)
     File 
"/usr/local/lib/python3.7/site-packages/alembic/runtime/migration.py", line 
628, in run_migrations
       step.migration_fn(**kw)
     File 
"/usr/local/lib/python3.7/site-packages/airflow/migrations/versions/7b2661a43ba3_taskinstance_keyed_to_dagrun.py",
 line 197, in upgrade
       batch_op.drop_constraint('task_reschedule_dag_task_date_fkey', 
'foreignkey')
   TypeError: drop_constraint() takes 2 positional arguments but 3 were given
   
   ### What you think should happen instead
   
   _No response_
   
   ### How to reproduce
   
   Ran `airflow db init`
   
   ### Operating System
   
   Debian 9
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to