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

Upgrade Wagtail to latest LTS version 2.11 #4384

Closed
1 task
Tracked by #137
patphongs opened this issue Feb 11, 2021 · 3 comments · Fixed by #4518
Closed
1 task
Tracked by #137

Upgrade Wagtail to latest LTS version 2.11 #4384

patphongs opened this issue Feb 11, 2021 · 3 comments · Fixed by #4518
Assignees
Milestone

Comments

@patphongs
Copy link
Member

Summary

What we're after:
To stay up to date with the Wagtail version releases, we should try and upgrade to the latest LTS version of Wagtail, version 2.11.

Completion criteria

  • Wagtail is upgraded to version 2.11

Tech steps or considerations

When attempting to upgrade, you will see many additional migrations and app start up errors. We should trouble shoot this during the upgrade to see how we can make the upgrade feasible.

Migrations needed during upgrade:

  Applying wagtailcore.0042_index_on_pagerevision_approved_go_live_at... OK
  Applying wagtailcore.0043_lock_fields... OK
  Applying wagtailcore.0044_add_unlock_grouppagepermission... OK
  Applying wagtailcore.0045_assign_unlock_grouppagepermission... OK
  Applying wagtailcore.0046_site_name_remove_null... OK
  Applying wagtailcore.0047_add_workflow_models... OK
  Applying wagtailcore.0048_add_default_workflows... OK
  Applying wagtailcore.0049_taskstate_finished_by... OK
  Applying wagtailcore.0050_workflow_rejected_to_needs_changes... OK
  Applying wagtailcore.0051_taskstate_comment... OK
  Applying wagtailcore.0052_pagelogentry... OK
  Applying wagtailcore.0053_locale_model... OK
  Applying wagtailcore.0054_initial_locale... OK
  Applying wagtailcore.0055_page_locale_fields... OK
  Applying wagtailcore.0056_page_locale_fields_populate... OK
  Applying wagtailcore.0057_page_locale_fields_notnull... OK
  Applying wagtailcore.0058_page_alias_of... OK
  Applying wagtailcore.0059_apply_collection_ordering... OK
  Applying wagtailforms.0004_add_verbose_name_plural... OK
  Applying wagtailimages.0022_uploadedimage... OK

Application start up errors:

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/.pyenv/versions/lib/python3.7/site-packages/django/core/servers/basehttp.py", line 45, in get_internal_wsgi_application
    return import_string(app_path)
  File "/.pyenv/versions/lib/python3.7/site-packages/django/utils/module_loading.py", line 17, in import_string
    module = import_module(module_path)
  File "/.pyenv/versions/3.7.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/dev/fec-cms/fec/fec/wsgi.py", line 18, in <module>
    application = get_wsgi_application()
  File "/.pyenv/versions/lib/python3.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
    return WSGIHandler()
  File "/.pyenv/versions/lib/python3.7/site-packages/django/core/handlers/wsgi.py", line 135, in __init__
    self.load_middleware()
  File "/.pyenv/versions/lib/python3.7/site-packages/django/core/handlers/base.py", line 35, in load_middleware
    middleware = import_string(middleware_path)
  File "/.pyenv/versions/lib/python3.7/site-packages/django/utils/module_loading.py", line 17, in import_string
    module = import_module(module_path)
  File "/.pyenv/versions/3.7.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'wagtail.core.middleware'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/.pyenv/versions/3.7.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/.pyenv/versions/3.7.7/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/.pyenv/versions/lib/python3.7/site-packages/django/utils/autoreload.py", line 54, in wrapper
    fn(*args, **kwargs)
  File "/.pyenv/versions/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 137, in inner_run
    handler = self.get_handler(*args, **options)
  File "/.pyenv/versions/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 27, in get_handler
    handler = super().get_handler(*args, **options)
  File "/.pyenv/versions/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 64, in get_handler
    return get_internal_wsgi_application()
  File "/.pyenv/versions/lib/python3.7/site-packages/django/core/servers/basehttp.py", line 50, in get_internal_wsgi_application
    ) from err
django.core.exceptions.ImproperlyConfigured: WSGI application 'fec.wsgi.application' could not be loaded; Error importing module.
@rfultz
Copy link
Contributor

rfultz commented Mar 3, 2021

Some Wagtail / Django research:

We’re currently using Wagtail 2.7.4
‘Stable’ is 2.12
Most recent is 2.12.2

Of potential concern for editors:

I imagine this means only while logged in to Wagtail, right? Would be weird for Wagtail to show warnings to site visitors, too…

Wagtail 2.10

  • started supporting Django 3.1
  • no longer supports Python 3.5 (we’re using 3.7.9?)

Wagtail 2.9

  • stopped supporting Django 2.1 (we’re using Django 2.2.16)

Django 3.0

  • supports Python 3.6 to 3.9
  • no longer supports Postgres 9.4

Django 3.1 didn’t change Python or Postgres support from Django 3.0

@rfultz
Copy link
Contributor

rfultz commented Mar 17, 2021

Created a branch (feature/4384-wagtail-to-2.11) yesterday while working on #3804 but ran into issues during pytest with psycopg2:
psycopg2.errors.UndefinedColumn: column wagtailcore_page.locked_at does not exist so may spend another couple minutes investigating but will likely pin this until next sprint+

@rfultz
Copy link
Contributor

rfultz commented Mar 23, 2021

Adding a point because of the database/migrations/psycopg2 complications

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

Successfully merging a pull request may close this issue.

2 participants