(venv) mailman-web migrate (as explained) fails with "django.core.exceptions.ImproperlyConfigured: allauth.account.middleware.AccountMiddleware must be added to settings.MIDDLEWARE"
I followed all single steps until this: https://docs.list.org/en/latest/install/virtualenv.html#run-database-migrati... (I will improve the documentation with the missing parts later today),
Now I got this and got stucked and need your help: django.core.exceptions.ImproperlyConfigured: allauth.account.middleware.AccountMiddleware must be added to settings.MIDDLEWARE
full stack: (venv) mailman@mail:/run$ mailman-web migrate Traceback (most recent call last): File "/opt/mailman/venv/bin/mailman-web", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/mailman_web/manage.py", line 37, in main execute_from_command_line(sys.argv) File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 420, in execute django.setup() File "/opt/mailman/venv/lib/python3.11/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/opt/mailman/venv/lib/python3.11/site-packages/django/apps/registry.py", line 124, in populate app_config.ready() File "/opt/mailman/venv/lib/python3.11/site-packages/allauth/account/apps.py", line 15, in ready raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: allauth.account.middleware.AccountMiddleware must be added to settings.MIDDLEWARE
On Thu, Oct 19, 2023 at 2:27 PM Wikinaut <mail@tgries.de> wrote:
I followed all single steps until this: https://docs.list.org/en/latest/install/virtualenv.html#run-database-migrati... (I will improve the documentation with the missing parts later today),
Now I got this and got stucked and need your help: django.core.exceptions.ImproperlyConfigured: allauth.account.middleware.AccountMiddleware must be added to settings.MIDDLEWARE
full stack: (venv) mailman@mail:/run$ mailman-web migrate Traceback (most recent call last): File "/opt/mailman/venv/bin/mailman-web", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/mailman_web/manage.py", line 37, in main execute_from_command_line(sys.argv) File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 420, in execute django.setup() File "/opt/mailman/venv/lib/python3.11/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/opt/mailman/venv/lib/python3.11/site-packages/django/apps/registry.py", line 124, in populate app_config.ready() File "/opt/mailman/venv/lib/python3.11/site-packages/allauth/account/apps.py", line 15, in ready raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: allauth.account.middleware.AccountMiddleware must be added to settings.MIDDLEWARE
See this: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
Just for the record:
I did a fresh installation. Perhaps the documentation is in the need of heavy upgrading? I will report my findings I already have (i.e. missing steps & dependencies), later, when I got it running.
I used this x = list(MIDDLEWARE) x.insert(0, 'allauth.account.middleware.AccountMiddleware') MIDDLEWARE = x
but got (running mysql! with all the needed settings) SystemError: initialization of _psycopg raised unreported exception
arrrgh
(venv) mailman-web migrate Traceback (most recent call last): File "/opt/mailman/venv/bin/mailman-web", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/mailman_web/manage.py", line 37, in main execute_from_command_line(sys.argv) File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/base.py", line 402, in run_from_argv self.execute(*args, **cmd_options) File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/base.py", line 448, in execute output = self.handle(*args, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/base.py", line 96, in wrapped res = handle_func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 97, in handle self.check(databases=[database]) File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/base.py", line 475, in check all_issues = checks.run_checks( ^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/checks/urls.py", line 14, in check_url_config return check_resolver(resolver) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/checks/urls.py", line 24, in check_resolver return check_method() ^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/urls/resolvers.py", line 494, in check for pattern in self.url_patterns: ^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__ res = instance.__dict__[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/urls/resolvers.py", line 715, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) ^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__ res = instance.__dict__[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/urls/resolvers.py", line 708, in urlconf_module return import_module(self.urlconf_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1206, in _gcd_import File "<frozen importlib._bootstrap>", line 1178, in _find_and_load File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/opt/mailman/venv/lib/python3.11/site-packages/mailman_web/urls.py", line 31, in <module> path('archives/', include('hyperkitty.urls')), ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/urls/conf.py", line 38, in include urlconf_module = import_module(urlconf_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1206, in _gcd_import File "<frozen importlib._bootstrap>", line 1178, in _find_and_load File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/opt/mailman/venv/lib/python3.11/site-packages/hyperkitty/urls.py", line 29, in <module> from hyperkitty.api import email as api_email File "/opt/mailman/venv/lib/python3.11/site-packages/hyperkitty/api/email.py", line 25, in <module> from rest_framework import generics, serializers File "/opt/mailman/venv/lib/python3.11/site-packages/rest_framework/generics.py", line 9, in <module> from rest_framework import mixins, views File "/opt/mailman/venv/lib/python3.11/site-packages/rest_framework/mixins.py", line 8, in <module> from rest_framework.response import Response File "/opt/mailman/venv/lib/python3.11/site-packages/rest_framework/response.py", line 11, in <module> from rest_framework.serializers import Serializer File "/opt/mailman/venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 27, in <module> from rest_framework.compat import postgres_fields File "/opt/mailman/venv/lib/python3.11/site-packages/rest_framework/compat.py", line 26, in <module> from django.contrib.postgres import fields as postgres_fields File "/opt/mailman/venv/lib/python3.11/site-packages/django/contrib/postgres/fields/__init__.py", line 1, in <module> from .array import * # NOQA ^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/contrib/postgres/fields/array.py", line 3, in <module> from django.contrib.postgres import lookups File "/opt/mailman/venv/lib/python3.11/site-packages/django/contrib/postgres/lookups.py", line 4, in <module> from .search import SearchVector, SearchVectorExact, SearchVectorField File "/opt/mailman/venv/lib/python3.11/site-packages/django/contrib/postgres/search.py", line 1, in <module> import psycopg2 File "/opt/mailman/venv/lib/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa SystemError: initialization of _psycopg raised unreported exception
The same error popped up after having removed the code in /etc/mailman3/settings.py) and downgrading as suggested by you (pip install django-allauth\<0.56):
.... File "/opt/mailman/venv/lib/python3.11/site-packages/django/contrib/postgres/lookups.py", line 4, in <module> from .search import SearchVector, SearchVectorExact, SearchVectorField File "/opt/mailman/venv/lib/python3.11/site-packages/django/contrib/postgres/search.py", line 1, in <module> import psycopg2 File "/opt/mailman/venv/lib/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa SystemError: initialization of _psycopg raised unreported exception
On Thu, Oct 19, 2023 at 3:02 PM Wikinaut <mail@tgries.de> wrote:
I used this x = list(MIDDLEWARE) x.insert(0, 'allauth.account.middleware.AccountMiddleware') MIDDLEWARE = x
but got (running mysql! with all the needed settings) SystemError: initialization of _psycopg raised unreported exception
arrrgh
[snip]
File "/opt/mailman/venv/lib/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa SystemError: initialization of _psycopg raised unreported exception
If you say you are using MySQL, then I don't understand why you are having issues with psycopg as this has nothing to do with MySQL, but PostgreSQL. Which is which? Maybe you need to relax a bit, then start over again?
Can we see what you have in /etc/mailman3/mailman.cfg and /etc/mailman3/settings.py?
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
On 10/19/23 05:02, Wikinaut wrote:
(venv) mailman-web migrate Traceback (most recent call last):
...
File "/opt/mailman/venv/lib/python3.11/site-packages/django/contrib/postgres/search.py", line 1, in <module> import psycopg2 File "/opt/mailman/venv/lib/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa SystemError: initialization of _psycopg raised unreported exception
Since you are using MySql and not PostgreSQL, in your venv do
pip uninstall psycopg2_binary
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Dear Mark,
Thanks. Yeah! I confirm that this fixed the show stopper.
I was "_forced_" :-) to install that in one of the very first steps of the documentation. https://docs.list.org/en/latest/install/virtualenv.html#installing-mailman-c...
What I suggest is:
I will (try to help) to fix the documentation, so that it also can work for mysql. Please, I am willing to help.
On 10/19/23 11:48, Wikinaut wrote:
I was "_forced_" :-) to install that in one of the very first steps of the documentation. https://docs.list.org/en/latest/install/virtualenv.html#installing-mailman-c...
What I suggest is:
I will (try to help) to fix the documentation, so that it also can work for mysql. Please, I am willing to help.
It seems to me that adding a sentence following "This will install latest release of Mailman Core, and Python bindings for Postgresql database." such as "If you are using a different database manager, do not install psycopg2-binary." would suffice. What do you think?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Yes, I agree. (because the whole installation page is dedicated to postgresql, I lnow, but I forgot when copying & pasting this line).
Hello Mark,
I am also using MySql/MariaDb, I followed your suggestion. This would uninstall a lot of other packages, is that safe? I did not continue.
$ pip uninstall psycopg2_binary Found existing installation: psycopg2-binary 2.9.6 Uninstalling psycopg2-binary-2.9.6: Would remove: /opt/mailman/venv/lib/python3.11/site-packages/psycopg2/* /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary-2.9.6.dist-info/* /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libcom_err-2abe824b.so.2.1 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libcrypto-2cd0ac56.so.1.1 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libgssapi_krb5-497db0c6.so.2.2 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/libk5crypto- b1f99d5c.so.3.1 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/libkeyutils- dfe70bd6.so.1.5 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/libkrb5- fcafa220.so.3.3 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/libkrb5support- d0bcff84.so.0.1 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ liblber-69811697.so.2.0.200 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/libldap- e7812872.so.2.0.200 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libpcre-9513aab5.so.1.2.0 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libpq-227f62f1.so.5.15 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libsasl2-883649fd.so.3.0.0 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libselinux-0922c95c.so.1 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libssl-0331cfe8.so.1.1 Proceed (Y/n)? n Regards, Eggert
Am Donnerstag, 19. Oktober 2023, 20:31:08 CEST schrieb Mark Sapiro:
On 10/19/23 05:02, Wikinaut wrote:
(venv) mailman-web migrate
Traceback (most recent call last): ...
File "/opt/mailman/venv/lib/python3.11/site-packages/django/contrib/postgre s/search.py", line 1, in <module>>
import psycopg2File "/opt/mailman/venv/lib/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module>>
from psycopg2._psycopg import ( # noqaSystemError: initialization of _psycopg raised unreported exception
Since you are using MySql and not PostgreSQL, in your venv do
pip uninstall psycopg2_binary
On 10/19/23 12:12, Eggert Ehmke via Mailman-users wrote:
Hello Mark,
I am also using MySql/MariaDb, I followed your suggestion. This would uninstall a lot of other packages, is that safe? I did not continue.
$ pip uninstall psycopg2_binary Found existing installation: psycopg2-binary 2.9.6 Uninstalling psycopg2-binary-2.9.6: Would remove: /opt/mailman/venv/lib/python3.11/site-packages/psycopg2/* /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary-2.9.6.dist-info/* /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libcom_err-2abe824b.so.2.1 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libcrypto-2cd0ac56.so.1.1 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libgssapi_krb5-497db0c6.so.2.2 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/libk5crypto- b1f99d5c.so.3.1 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/libkeyutils- dfe70bd6.so.1.5 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/libkrb5- fcafa220.so.3.3 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/libkrb5support- d0bcff84.so.0.1 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ liblber-69811697.so.2.0.200 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/libldap- e7812872.so.2.0.200 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libpcre-9513aab5.so.1.2.0 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libpq-227f62f1.so.5.15 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libsasl2-883649fd.so.3.0.0 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libselinux-0922c95c.so.1 /opt/mailman/venv/lib/python3.11/site-packages/psycopg2_binary.libs/ libssl-0331cfe8.so.1.1 Proceed (Y/n)? n
Yes, it is safe. the things listed other than psycopg2/* are just installation information about psycopg2_binary. No other packages are actually involved.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Thu, Oct 19, 2023 at 2:56 PM Wikinaut <mail@tgries.de> wrote:
Just for the record:
I did a fresh installation. Perhaps the documentation is in the need of heavy upgrading? I will report my findings I already have (i.e. missing steps & dependencies), later, when I got it running.
You can suggest the modifications you need to see in the documentation.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
On 10/19/23 04:56, Wikinaut wrote:
Just for the record:
I did a fresh installation. Perhaps the documentation is in the need of heavy upgrading?
This is a transient issue. It is currently fixed in the heads of the gitlab branches and will be in the next releases.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
This is due to a change in the dependencies. You can either demand an older version of django-allauth when doing your install, or I fixed it with this line added to the very end of my settings.py:
# Fix for updated django-allauth MIDDLEWARE += ('allauth.account.middleware.AccountMiddleware',)
--Jered
----- On Oct 19, 2023, at 7:27 AM, Wikinaut mail@tgries.de wrote:
I followed all single steps until this: https://docs.list.org/en/latest/install/virtualenv.html#run-database-migrati... (I will improve the documentation with the missing parts later today),
Now I got this and got stucked and need your help: django.core.exceptions.ImproperlyConfigured: allauth.account.middleware.AccountMiddleware must be added to settings.MIDDLEWARE
full stack: (venv) mailman@mail:/run$ mailman-web migrate Traceback (most recent call last): File "/opt/mailman/venv/bin/mailman-web", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/mailman_web/manage.py", line 37, in main execute_from_command_line(sys.argv) File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 420, in execute django.setup() File "/opt/mailman/venv/lib/python3.11/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/opt/mailman/venv/lib/python3.11/site-packages/django/apps/registry.py", line 124, in populate app_config.ready() File "/opt/mailman/venv/lib/python3.11/site-packages/allauth/account/apps.py", line 15, in ready raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: allauth.account.middleware.AccountMiddleware must be added to settings.MIDDLEWARE
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
This message sent to jered@convivian.com
Yes. And why isn't that added to the documentation yet, I am just asking.
It does not yet fix the other next issue (SystemError: initialization of _psycopg raised unreported exception) where I did not say anything about postgresql.... (settings and mailmain info looks fine; grep is silent about pg in any settings file, all pg-stuff is commented-out, look)
/etc/mailman3/grep pg * mailman-web.py: # Use 'sqlite3', 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. mailman-web.py: #'ENGINE': 'django.db.backends.postgresql_psycopg2', mailman-web.py:# management command after each code upgrade. mailman-web.py.backup: # Use 'sqlite3', 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. mailman-web.py.backup: #'ENGINE': 'django.db.backends.postgresql_psycopg2', mailman-web.py.backup:# management command after each code upgrade. mailman-web.py.ucf-dist: # Use 'sqlite3', 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. mailman-web.py.ucf-dist: #'ENGINE': 'django.db.backends.postgresql_psycopg2', mailman-web.py.ucf-dist:# management command after each code upgrade. grep: __pycache__: Is a directory settings.py:# 'ENGINE': 'django.db.backends.postgresql_psycopg2', settings.py: # Use 'sqlite3', 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. settings.py: #'ENGINE': 'django.db.backends.postgresql_psycopg2',
Now I wanted to start uwsgi, after having setup everything as documented but I got in the error log this:
ModuleNotFoundError: No module named 'allauth.account.middleware'
see below
cat /opt/mailman/web/logs/uwsgi-error.log
*** Starting uWSGI 2.0.22 (64bit) on [Thu Oct 19 19:25:37 2023] *** current working directory: /etc/mailman3 detected binary path: /opt/mailman/venv/bin/uwsgi !!! no internal routing support, rebuild with pcre support !!! ... uwsgi socket 0 bound to TCP address 0.0.0.0:8000 fd 8 Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] PEP 405 virtualenv detected: /opt/mailman/venv/ Set PythonHome to /opt/mailman/venv/ Python main interpreter initialized at 0x7fbaf9160018 python threads support enabled ... *** Operational MODE: preforking+threaded *** Traceback (most recent call last): File "/opt/mailman/venv/lib/python3.11/site-packages/mailman_web/wsgi.py", line 14, in <module> application = get_wsgi_application() ^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application return WSGIHandler() ^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/handlers/wsgi.py", line 125, in __init__ self.load_middleware() File "/opt/mailman/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 40, in load_middleware middleware = import_string(middleware_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/utils/module_loading.py", line 30, in import_string return cached_import(module_path, class_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman/venv/lib/python3.11/site-packages/django/utils/module_loading.py", line 15, in cached_import module = import_module(module_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'allauth.account.middleware' unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic mode *** ... --- no python application found, check your startup logs for errors --- SIGINT/SIGTERM received...killing workers... [uwsgi-daemons] stopping daemon (pid: 364954): /opt/mailman/venv/bin/mailman-web qcluster 19:26:00 [Q] INFO Q Cluster kilo-april-failed-carbon stopping. 19:26:00 [Q] INFO Q Cluster kilo-april-failed-carbon has stopped. worker 1 buried after 1 seconds worker 2 buried after 1 seconds goodbye to uWSGI.
On 10/19/23 12:30, Wikinaut wrote:
Now I wanted to start uwsgi, after having setup everything as documented but I got in the error log this:
ModuleNotFoundError: No module named 'allauth.account.middleware'
As it says at https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
"Note either downgrade django-allauth or update MIDDLEWARE, but not both."
Now you have added 'allauth.account.middleware.AccountMiddleware' to MIDDLEWARE and downgraded django-allauth<0.56.
You can either do
pip install --upgrade django-allauth
or remove
x = list(MIDDLEWARE)
x.insert(0, 'allauth.account.middleware.AccountMiddleware')
MIDDLEWARE = x
from /etc/mailman3/settings.py. Either will do, but DO NOT DO BOTH.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Confirmed.
pip install --upgrade django-allauth
solved that issue.
Now I set up "mailman-web createsuperuser" and confirmed my e-mail etc. and I am logged in as admin.
However myserver/mailman3 page is throwing
Erfolgreich als Admin angemeldet. Something went wrong
HTTP Error 401: REST API authorization failed
Even when the API keys are unchanged from my previous installation. Any idea what can be wrong here?
On 10/19/23 13:15, Wikinaut wrote:
However myserver/mailman3 page is throwing
Erfolgreich als Admin angemeldet. Something went wrong
HTTP Error 401: REST API authorization failed
Even when the API keys are unchanged from my previous installation. Any idea what can be wrong here?
what does the command mailman info
show for REST credentials? The
defaults for these are
REST credentials: restadmin:restpass
set by
admin_user: restadmin admin_pass: restpass
in the [webservice] section of mailman.cfg
and the corresponding defaults for Django settings are:
MAILMAN_REST_API_USER = 'restadmin' MAILMAN_REST_API_PASS = 'restpass'
If you have something different, is it set in both mailman.cfg and settings.py?
Is there more information in /opt/mailman/mm/var/logs/mailman.log or /opt/mailman/web/logs/mailmanweb.log?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi. Works.
Reason found: I scrutinzed /etc/mailman3/settings.py (which I set up in full accordance to (*) https://docs.list.org/en/latest/install/virtualenv.html#initial-configuratio... ) --
-- these two constants were simply missing in your template in the documentation:
MAILMAN_REST_API_USER = 'restadmin' MAILMAN_REST_API_PASS = 'restpass'
May I kindly suggest to please adjust the documentation section here (*)?
Background question:
From my former installation I found /etc/mailman3/mailman-hyperkitty.cfg -- what is the relevance of this file now? It looks to me that mailman-hyperkitty.cfg is now superseded by settings.py and the kitty-file can be deleted.
Am I correct?
On Fri, Oct 20, 2023, 08:45 Wikinaut <mail@tgries.de> wrote:
Hi. Works.
Reason found: I scrutinzed /etc/mailman3/settings.py (which I set up in full accordance to (*) https://docs.list.org/en/latest/install/virtualenv.html#initial-configuratio... ) --
-- these two constants were simply missing in your template in the documentation:
MAILMAN_REST_API_USER = 'restadmin' MAILMAN_REST_API_PASS = 'restpass'
May I kindly suggest to please adjust the documentation section here (*)?
Did you by any chance remove a few lines from the file? We have always used that documentation and apart from the few quirks with software version it has always led to a working instance of MM3. Maybe you can suggest what is missing in the file that need to be added?
The lines are missing in your block here:
https://docs.list.org/en/latest/install/virtualenv.html#initial-configuratio...
On October 19, 2023 11:54:03 PM PDT, Wikinaut <mail@tgries.de> wrote:
The lines are missing in your block here:
https://docs.list.org/en/latest/install/virtualenv.html#initial-configuratio...
Those lines are in mailman_web/settings/mailman.py which should be imported in settings.py.
I don't know what your original issue was, but adding those lines to settings.py shouldn't make any difference as long as settings.py contains from mailman_web.settings.mailman import *
-- Mark Sapiro <mark@msapiro.net> Sent from my Not_an_iThing with standards compliant, open source software.
it has:
# Mailman Web configuration file. # /etc/mailman3/settings.py
# Get the default settings. from mailman_web.settings.base import * from mailman_web.settings.mailman import *
On 10/20/23 05:43, Wikinaut wrote:
it has:
# Mailman Web configuration file. # /etc/mailman3/settings.py
# Get the default settings. from mailman_web.settings.base import * from mailman_web.settings.mailman import *
As I said, I don't know what caused your original authentication failure or what fixed it, but it wasn't the addition of
MAILMAN_REST_API_USER = 'restadmin'
MAILMAN_REST_API_PASS = 'restpass'
to /etc/mailman3/settings.py. You can verify this by activating your venv and doing
>>> MAILMAN_REST_API_USER
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'MAILMAN_REST_API_USER' is not defined
>>> MAILMAN_REST_API_USER
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'MAILMAN_REST_API_USER' is not defined
>>> MAILMAN_REST_API_PASS
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'MAILMAN_REST_API_PASS' is not defined
>>> from mailman_web.settings.mailman import *
>>> MAILMAN_REST_API_USER
'restadmin'
>>> MAILMAN_REST_API_PASS
'restpass'
>>>
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 10/21/23 09:58, Mark Sapiro wrote:
You can verify this by activating your venv and doing
>>> MAILMAN_REST_API_USER Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'MAILMAN_REST_API_USER' is not defined >>> MAILMAN_REST_API_USER Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'MAILMAN_REST_API_USER' is not defined >>> MAILMAN_REST_API_PASS Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'MAILMAN_REST_API_PASS' is not defined >>> from mailman_web.settings.mailman import * >>> MAILMAN_REST_API_USER 'restadmin' >>> MAILMAN_REST_API_PASS 'restpass' >>>
Omitted in the above was invoking Python as in
(venv) mark@msapiro:~$ python
Python 3.9.16 (main, Dec 11 2022, 12:49:23)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> MAILMAN_REST_API_USER
etc, as above
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Wikinaut writes:
I followed all single steps until this: https://docs.list.org/en/latest/install/virtualenv.html#run-database-migrati... (I will improve the documentation with the missing parts later today),
Now I got this and got stucked and need your help: django.core.exceptions.ImproperlyConfigured: allauth.account.middleware.AccountMiddleware must be added to settings.MIDDLEWARE
If you use the mailman-web setup, the allauth, allauth.account, and allauth.socialaccount applications are present in the initial INSTALLED_APPS tuple in the settings package. The example_projects in Postorius and HyperKitty each provide a very similar settings.py but with more extensive provision of socialauth providers.
I strongly recommend you use the mailman-web settings package as a template for your own.
Regarding the PostgreSQL bias, PostgreSQL is just more Mailman-friendly. We'll be happy to add more MySQL documentation, but I don't think any of the core devs use it where they have to make a choice. (For example I myself use MySQL only in my MediaWiki instance and I have done zero configuration of it.) There is at least one known gotcha for default installations of MySQL (it's terribly ungraceful when there are non-BMP UTF-8 characters), but any other warts or optimizations would be very welcome.
Steve
Stephen J. Turnbull writes:
If you use the mailman-web setup, the allauth, allauth.account, and allauth.socialaccount applications are present in the initial INSTALLED_APPS tuple in the settings package.
Sorry, I see that there was an actual issue here, that will be resolved in future releases.
I strongly recommend you use the mailman-web package Regarding the PostgreSQL bias, PostgreSQL is just more Mailman-friendly.
I still stand by these recommendations, unless you have a clear preference yourself.
参加者 (6)
-
Eggert Ehmke
-
Jered Floyd
-
Mark Sapiro
-
Odhiambo Washington
-
Stephen J. Turnbull
-
Wikinaut