Bowrna opened a new issue #19104:
URL: https://github.com/apache/airflow/issues/19104


   ### Apache Airflow version
   
   main (development)
   
   ### Operating System
   
   macOS
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### Deployment details
   
   https://github.com/apache/airflow/blob/main/CONTRIBUTORS_QUICK_START.rst#id1
   Following the instructions on the above page to set up the development 
environment for Apache Airflow. Breeze environment is initialized and I am 
inside the docker container. On running `airflow db reset`, to create 
db/tables, i get error.
   
   
   ### What happened
   
   Got the below logs when running `airflow db reset`:
   
   ```INFO  [alembic.runtime.migration] Running upgrade d2ae31099d61 -> 
0e2a74e0fc9f, Add time zone awareness
   Traceback (most recent call last):
     File "/usr/local/bin/airflow", line 33, in <module>
       sys.exit(load_entry_point('apache-airflow', 'console_scripts', 
'airflow')())
     File "/opt/airflow/airflow/__main__.py", line 40, in main
       args.func(args)
     File "/opt/airflow/airflow/cli/cli_parser.py", line 48, in command
       return func(*args, **kwargs)
     File "/opt/airflow/airflow/cli/commands/db_command.py", line 39, in resetdb
       db.resetdb()
     File "/opt/airflow/airflow/utils/session.py", line 70, in wrapper
       return func(*args, session=session, **kwargs)
     File "/opt/airflow/airflow/utils/db.py", line 883, in resetdb
       initdb(session=session)
     File "/opt/airflow/airflow/utils/session.py", line 67, in wrapper
       return func(*args, **kwargs)
     File "/opt/airflow/airflow/utils/db.py", line 591, in initdb
       upgradedb(session=session)
     File "/opt/airflow/airflow/utils/session.py", line 67, in wrapper
       return func(*args, **kwargs)
     File "/opt/airflow/airflow/utils/db.py", line 868, in upgradedb
       command.upgrade(config, 'heads')
     File "/usr/local/lib/python3.8/site-packages/alembic/command.py", line 
320, in upgrade
       script.run_env()
     File "/usr/local/lib/python3.8/site-packages/alembic/script/base.py", line 
563, in run_env
       util.load_python_file(self.dir, "env.py")
     File "/usr/local/lib/python3.8/site-packages/alembic/util/pyfiles.py", 
line 92, in load_python_file
       module = load_module_py(module_id, path)
     File "/usr/local/lib/python3.8/site-packages/alembic/util/pyfiles.py", 
line 108, in load_module_py
       spec.loader.exec_module(module)  # type: ignore
     File "<frozen importlib._bootstrap_external>", line 843, in exec_module
     File "<frozen importlib._bootstrap>", line 219, in 
_call_with_frames_removed
     File "/opt/airflow/airflow/migrations/env.py", line 107, in <module>
       run_migrations_online()
     File "/opt/airflow/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.8/site-packages/alembic/runtime/environment.py", line 
851, in run_migrations
       self.get_context().run_migrations(**kw)
     File 
"/usr/local/lib/python3.8/site-packages/alembic/runtime/migration.py", line 
620, in run_migrations
       step.migration_fn(**kw)
     File 
"/opt/airflow/airflow/migrations/versions/0e2a74e0fc9f_add_time_zone_awareness.py",
 line 44, in upgrade
       raise Exception("Global variable explicit_defaults_for_timestamp needs 
to be on (1) for mysql")
   Exception: Global variable explicit_defaults_for_timestamp needs to be on 
(1) for mysql
   ```
   
   ### What you expected to happen
   
   Expected behaviour to run db reset without error and create db/ table 
required to start airflow in development mode. i have rebased the code recently 
with apache/airflow and running the code in `main` branch
   
   ### How to reproduce
   
   https://github.com/apache/airflow/blob/main/CONTRIBUTORS_QUICK_START.rst#id1
   
   Following the instructions in above docs, python version 3.8 and backend as 
mysql. on trying the steps mentioned in docs, i get the issues
   
   ### 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