Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration from 2.021.12b to latest fails due to django migrations error #5201

Open
ayyyee opened this issue Oct 26, 2024 · 0 comments
Open

Comments

@ayyyee
Copy link

ayyyee commented Oct 26, 2024

Description

Django migrations fail after migrating from 2.021.12b with kobo-docker to latest (2.024.33).

Steps to Reproduce

Not exactly sure how you'd reproduce this other than upgrading from 2.021.12b to latest.
Went through database update steps as outlined in upgrade guide for projects before November 2022. Updated postgres to 14-3.2 and mongo to 5.0; when starting the containers encountered an error from django.

Expected behavior

Expected django migrations to go through and kpi container to successfully start up

Actual behavior

Django migrations failed:

You are now connected to database "kobocat" as user "kobo".
CREATE EXTENSION
CREATE EXTENSION
NOTICE:  extension "postgis" already exists, skipping
CREATE EXTENSION
NOTICE:  extension "postgis_topology" already exists, skipping
CREATE EXTENSION
NOTICE:  extension "fuzzystrmatch" already exists, skipping
NOTICE:  extension "postgis_tiger_geocoder" already exists, skipping
Postgres database kobocat ready for use!
Running migrations…
Exception while running run() in 'scripts.fix_migrations_for_kobocat_django_app'
Traceback (most recent call last):
  File "/srv/src/kpi/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/venv/lib/python3.10/site-packages/django_extensions/management/email_notifications.py", line 65, in run_from_argv
    super().run_from_argv(argv)
  File "/opt/venv/lib/python3.10/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/venv/lib/python3.10/site-packages/django_extensions/management/email_notifications.py", line 77, in execute
    super().execute(*args, **options)
  File "/opt/venv/lib/python3.10/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/opt/venv/lib/python3.10/site-packages/django_extensions/management/utils.py", line 62, in inner
    ret = func(self, *args, **kwargs)
  File "/opt/venv/lib/python3.10/site-packages/django_extensions/management/commands/runscript.py", line 281, in handle
    run_script(script_mod, *script_args)
  File "/opt/venv/lib/python3.10/site-packages/django_extensions/management/commands/runscript.py", line 159, in run_script
    exit_code = mod.run(*script_args)
  File "/srv/src/kpi/scripts/fix_migrations_for_kobocat_django_app.py", line 9, in run
    if migrate_custom_user_model():
  File "/srv/src/kpi/scripts/fix_migrations_for_kobocat_django_app.py", line 80, in migrate_custom_user_model
    raise Exception('Run `./manage.py migrate auth` first')
Exception: Run `./manage.py migrate auth` first

Additional details

Added a call to manage.py migrate auth as suggested in the exception which didn't help either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant