mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-25 17:06:01 +03:00
[GH-ISSUE #2553] Migrate from 1.17 to 2.01 error #1632
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#1632
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @studioluminous on GitHub (Jun 28, 2022).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/2553
Impacted versions
Current behavior
I just tried upgrading modoboa to 2.0.1 from 1.17. I was able to succesfully upgrade the modules via cli, did the migrate/static/deploy. I did have to reinstall all the modules after updating python from 3.6 to 3.9 but after doing that I was able to migrate and deploy.
I'm getting the warning as follows from all the modoboa related users cron.
/srv/modoboa/env/lib/python3.9/site-packages/requests/init.py:109: RequestsDependencyWarning: urllib3 (1.21.1) or chardet (5.0.0)/charset_normalizer (2.0.12) doesn't match a supported version!
warnings.warn(
I've tried changing versions of urllib3 to no avail. All come back with the same error.
Here's the debug:
Environment:
Request Method: GET
Request URL: https://my.server.com
Django Version: 2.2.12
Python Version: 3.6.9
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.sites',
'django.contrib.staticfiles',
'reversion',
'ckeditor',
'ckeditor_uploader',
'rest_framework',
'rest_framework.authtoken',
'django_otp',
'django_otp.plugins.otp_totp',
'django_otp.plugins.otp_static',
'modoboa',
'modoboa.core',
'modoboa.lib',
'modoboa.admin',
'modoboa.transport',
'modoboa.relaydomains',
'modoboa.limits',
'modoboa.parameters',
'modoboa.dnstools',
'modoboa.maillog',
'modoboa_amavis',
'modoboa_pdfcredentials',
'modoboa_postfix_autoreply',
'modoboa_sievefilters',
'modoboa_webmail',
'modoboa_contacts',
'modoboa_radicale',
'webpack_loader')
Installed Middleware:
('x_forwarded_for.middleware.XForwardedForMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django_otp.middleware.OTPMiddleware',
'modoboa.core.middleware.TwoFAMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'modoboa.core.middleware.LocalConfigMiddleware',
'modoboa.lib.middleware.AjaxLoginRedirect',
'modoboa.lib.middleware.CommonExceptionCatcher',
'modoboa.lib.middleware.RequestCatcherMiddleware')
Traceback:
File "/srv/modoboa/env/lib/python3.6/site-packages/rest_framework/settings.py" in import_from_string
177. return import_string(val)
File "/srv/modoboa/env/lib/python3.6/site-packages/django/utils/module_loading.py" in import_string
17. module = import_module(module_path)
File "/usr/lib/python3.6/importlib/init.py" in import_module
126. return _bootstrap._gcd_import(name[level:], package, level)
File "" in _gcd_import
994.
File "" in _find_and_load
971.
File "" in _find_and_load_unlocked
953.
During handling of the above exception (No module named 'modoboa.core.drf_authentication'), another exception occurred:
File "/srv/modoboa/env/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)
File "/srv/modoboa/env/lib/python3.6/site-packages/modoboa/core/middleware.py" in call
26. redirect_url = reverse("core:2fa_verify")
File "/srv/modoboa/env/lib/python3.6/site-packages/django/urls/base.py" in reverse
58. app_list = resolver.app_dict[ns]
File "/srv/modoboa/env/lib/python3.6/site-packages/django/urls/resolvers.py" in app_dict
513. self._populate()
File "/srv/modoboa/env/lib/python3.6/site-packages/django/urls/resolvers.py" in _populate
447. for url_pattern in reversed(self.url_patterns):
File "/srv/modoboa/env/lib/python3.6/site-packages/django/utils/functional.py" in get
80. res = instance.dict[self.name] = self.func(instance)
File "/srv/modoboa/env/lib/python3.6/site-packages/django/urls/resolvers.py" in url_patterns
584. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/srv/modoboa/env/lib/python3.6/site-packages/django/utils/functional.py" in get
80. res = instance.dict[self.name] = self.func(instance)
File "/srv/modoboa/env/lib/python3.6/site-packages/django/urls/resolvers.py" in urlconf_module
577. return import_module(self.urlconf_name)
File "/usr/lib/python3.6/importlib/init.py" in import_module
126. return _bootstrap._gcd_import(name[level:], package, level)
File "" in _gcd_import
994.
File "" in _find_and_load
971.
File "" in _find_and_load_unlocked
955.
File "" in _load_unlocked
665.
File "" in exec_module
678.
File "" in _call_with_frames_removed
219.
File "./instance/urls.py" in
4. url(r'', include('modoboa.urls')),
File "/srv/modoboa/env/lib/python3.6/site-packages/django/urls/conf.py" in include
34. urlconf_module = import_module(urlconf_module)
File "/usr/lib/python3.6/importlib/init.py" in import_module
126. return _bootstrap._gcd_import(name[level:], package, level)
File "" in _gcd_import
994.
File "" in _find_and_load
971.
File "" in _find_and_load_unlocked
955.
File "" in _load_unlocked
665.
File "" in exec_module
678.
File "" in _call_with_frames_removed
219.
File "/srv/modoboa/env/lib/python3.6/site-packages/modoboa/urls.py" in
13. from rest_framework.schemas import get_schema_view
File "/srv/modoboa/env/lib/python3.6/site-packages/rest_framework/schemas/init.py" in
33. authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES,
File "/srv/modoboa/env/lib/python3.6/site-packages/rest_framework/settings.py" in getattr
220. val = perform_import(val, attr)
File "/srv/modoboa/env/lib/python3.6/site-packages/rest_framework/settings.py" in perform_import
168. return [import_from_string(item, setting_name) for item in val]
File "/srv/modoboa/env/lib/python3.6/site-packages/rest_framework/settings.py" in
168. return [import_from_string(item, setting_name) for item in val]
File "/srv/modoboa/env/lib/python3.6/site-packages/rest_framework/settings.py" in import_from_string
180. raise ImportError(msg)
Exception Type: ImportError at /
Exception Value: Could not import 'modoboa.core.drf_authentication.JWTAuthenticationWith2FA' for API setting 'DEFAULT_AUTHENTICATION_CLASSES'. ModuleNotFoundError: No module named 'modoboa.core.drf_authentication'.
@studioluminous commented on GitHub (Jun 28, 2022):
I was able to get in to the web interface and eliminate the debug error by commenting out the rest framework in the settings.py. Even though I've upgraded modoboa and all the modules, on the modoboa web interface it's showing they are all at the old versions.

@tonioo commented on GitHub (Jun 28, 2022):
@studioluminous Modoboa 2+ requires python 3.7 at least, I can see that you're using 3.6 so it won't work.
@studioluminous commented on GitHub (Jun 28, 2022):
My apologies but I'm using python 3.9 as I mentioned. I see that the traceback says 3.6 but as the error says, it's coming from the 3.9 version of python in the virtualenv path.
/srv/modoboa/env/lib/python3.9/site-packages/requests/init.py:109: RequestsDependencyWarning: urllib3 (1.21.1) or chardet (5.0.0)/charset_normalizer (2.0.12) doesn't match a supported version!
@tonioo commented on GitHub (Jun 29, 2022):
If you're seeing 3.6 in you path, then it means your virtualenv is broken in some way. You should not see any other version than 3.9