And using the module manually works...
(venv) mailman@new-server ~ (v3.3.9) [0|127]> *ipython3* /usr/lib/python3/dist-packages/IPython/core/interactiveshell.py:949: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv. warn( Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] Type 'copyright', 'credits' or 'license' for more information IPython 7.31.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: *import MySQLdb*
(venv) mailman@new-sever ~ (v3.3.9)> *fg* Send job 1, 'ipython3' to foreground In [3]: *con = MySQLdb.connect("localhost", "mailman3web", "*****************", "mailman3web")*
In [4]: *cursor = con.cursor()* In [5]: *cursor.execute("show tables")* Out[5]: 34
In [6]: *print(cursor.fetchall())* (('account_emailaddress',), ('account_emailconfirmation',), ('auth_group',), ('auth_group_permissions',), ('auth_permission',), ('auth_user',), ('auth_user_groups',), ('auth_user_user_permissions',), ('django_admin_log',), ('django_content_type',), ('django_mailman3_maildomain',), ('django_mailman3_profile',), ('django_migrations',), ('django_q_ormq',), ('django_q_schedule',), ('django_q_task',), ('django_session',), ('django_site',), ('hyperkitty_attachment',), ('hyperkitty_email',), ('hyperkitty_favorite',), ('hyperkitty_lastview',), ('hyperkitty_mailinglist',), ('hyperkitty_profile',), ('hyperkitty_sender',), ('hyperkitty_tag',), ('hyperkitty_tagging',), ('hyperkitty_thread',), ('hyperkitty_threadcategory',), ('hyperkitty_vote',), ('socialaccount_socialaccount',), ('socialaccount_socialapp',), ('socialaccount_socialapp_sites',), ('socialaccount_socialtoken',))
In [7]: *cursor.execute("select * from account_emailaddress")* Out[7]: 2530
In [8]: *print(cursor.fetchall())*
So what can I do? Is there a way to troubleshoot the root cause of this issue?
Best Regards, Helio Loureiro https://helio.loureiro.eng.br https://github.com/helioloureiro https://mastodon.social/@helioloureiro
On Tue, 19 Dec 2023 at 11:11, Helio Loureiro <helio@loureiro.eng.br> wrote:
Hi,
No luck :(
(venv) mailman@new-server ~ (v3.3.9)> *pip freeze | egrep "mailman-web|django-mailman3|django-allauth"* django-allauth==0.59.0 django-mailman3==1.3.11 mailman-web==0.0.8 (venv) mailman@new-server ~ (v3.3.9)> *pip install -U django-allauth==0.58.0* Collecting django-allauth==0.58.0 Downloading django-allauth-0.58.0.tar.gz (861 kB) ---------------------------------------- 861.7/861.7 KB 9.4 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: requests-oauthlib>=0.3.0 in ./venv/lib/python3.10/site-packages (from django-allauth==0.58.0) (1.3.1) Requirement already satisfied: Django>=3.2 in ./venv/lib/python3.10/site-packages (from django-allauth==0.58.0) (4.1.13) Requirement already satisfied: pyjwt[crypto]>=1.7 in ./venv/lib/python3.10/site-packages (from django-allauth==0.58.0) (2.8.0) Requirement already satisfied: requests>=2.0.0 in ./venv/lib/python3.10/site-packages (from django-allauth==0.58.0) (2.31.0) Requirement already satisfied: python3-openid>=3.0.8 in ./venv/lib/python3.10/site-packages (from django-allauth==0.58.0) (3.2.0) Requirement already satisfied: asgiref<4,>=3.5.2 in ./venv/lib/python3.10/site-packages (from Django>=3.2->django-allauth==0.58.0) (3.7.2) Requirement already satisfied: sqlparse>=0.2.2 in ./venv/lib/python3.10/site-packages (from Django>=3.2->django-allauth==0.58.0) (0.4.4) Requirement already satisfied: cryptography>=3.4.0 in ./venv/lib/python3.10/site-packages (from pyjwt[crypto]>=1.7->django-allauth==0.58.0) (41.0.7) Requirement already satisfied: defusedxml in ./venv/lib/python3.10/site-packages (from python3-openid>=3.0.8->django-allauth==0.58.0) (0.7.1) Requirement already satisfied: urllib3<3,>=1.21.1 in ./venv/lib/python3.10/site-packages (from requests>=2.0.0->django-allauth==0.58.0) (2.1.0) Requirement already satisfied: charset-normalizer<4,>=2 in ./venv/lib/python3.10/site-packages (from requests>=2.0.0->django-allauth==0.58.0) (3.3.2) Requirement already satisfied: idna<4,>=2.5 in ./venv/lib/python3.10/site-packages (from requests>=2.0.0->django-allauth==0.58.0) (3.6) Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.10/site-packages (from requests>=2.0.0->django-allauth==0.58.0) (2023.11.17) Requirement already satisfied: oauthlib>=3.0.0 in ./venv/lib/python3.10/site-packages (from requests-oauthlib>=0.3.0->django-allauth==0.58.0) (3.2.2) Requirement already satisfied: typing-extensions>=4 in ./venv/lib/python3.10/site-packages (from asgiref<4,>=3.5.2->Django>=3.2->django-allauth==0.58.0) (4.9.0) Requirement already satisfied: cffi>=1.12 in ./venv/lib/python3.10/site-packages (from cryptography>=3.4.0->pyjwt[crypto]>=1.7->django-allauth==0.58.0) (1.16.0) Requirement already satisfied: pycparser in ./venv/lib/python3.10/site-packages (from cffi>=1.12->cryptography>=3.4.0->pyjwt[crypto]>=1.7->django-allauth==0.58.0) (2.21) Building wheels for collected packages: django-allauth Building wheel for django-allauth (pyproject.toml) ... done Created wheel for django-allauth: filename=django_allauth-0.58.0-py3-none-any.whl size=1157319 sha256=a430c552101d1ad47bc00b16d1c1d6df728afacdd13823927b4cbfb02c35dbfc Stored in directory: /local/mailman/.cache-ubuntu-22.04/pip/wheels/55/0a/79/e199827a18f310906c2a90b0e92b89c41daf21d2a502db6710 Successfully built django-allauth Installing collected packages: django-allauth Attempting uninstall: django-allauth Found existing installation: django-allauth 0.59.0 Uninstalling django-allauth-0.59.0: Successfully uninstalled django-allauth-0.59.0 Successfully installed django-allauth-0.58.0 (venv) mailman@new-server ~ (v3.3.9)> *mailman-web migrate* System check identified some issues:
WARNINGS: account.EmailAddress: (models.W036) MariaDB does not support unique constraints with conditions. HINT: A constraint won't be created. Silence this warning if you don't care about it. account.EmailAddress: (models.W043) MariaDB does not support indexes on expressions. HINT: An index won't be created. Silence this warning if you don't care about it. Operations to perform: Apply all migrations: account, admin, auth, contenttypes, django_mailman3, django_q, hyperkitty, postorius, sessions, sites, socialaccount Running migrations: Applying account.0004_alter_emailaddress_drop_unique_email...Traceback (most recent call last): File "/local/mailman/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) File "/local/mailman/venv/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 75, in execute return self.cursor.execute(query, args) File "/local/mailman/venv/lib/python3.10/site-packages/MySQLdb/cursors.py", line 179, in execute res = self._query(mogrified_query) File "/local/mailman/venv/lib/python3.10/site-packages/MySQLdb/cursors.py", line 330, in _query db.query(q) File "/local/mailman/venv/lib/python3.10/site-packages/MySQLdb/connections.py", line 257, in query _mysql.connection.query(self, query) MySQLdb.OperationalError: (2013, 'Lost connection to MySQL server during query')
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/local/mailman/venv/bin/mailman-web", line 8, in <module> sys.exit(main()) File "/local/mailman/venv/lib/python3.10/site-packages/mailman_web/manage.py", line 90, in main execute_from_command_line(sys.argv) File "/local/mailman/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/local/mailman/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/local/mailman/venv/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv self.execute(*args, **cmd_options) File "/local/mailman/venv/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute output = self.handle(*args, **options) File "/local/mailman/venv/lib/python3.10/site-packages/django/core/management/base.py", line 96, in wrapped res = handle_func(*args, **kwargs) File "/local/mailman/venv/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 349, in handle post_migrate_state = executor.migrate( File "/local/mailman/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 135, in migrate state = self._migrate_all_forwards( File "/local/mailman/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards state = self.apply_migration( File "/local/mailman/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 252, in apply_migration state = migration.apply(state, schema_editor) File "/local/mailman/venv/lib/python3.10/site-packages/django/db/migrations/migration.py", line 130, in apply operation.database_forwards( File "/local/mailman/venv/lib/python3.10/site-packages/django/db/migrations/operations/fields.py", line 235, in database_forwards schema_editor.alter_field(from_model, from_field, to_field) File "/local/mailman/venv/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 788, in alter_field self._alter_field( File "/local/mailman/venv/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 858, in _alter_field self.execute(self._delete_unique_sql(model, constraint_name)) File "/local/mailman/venv/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 199, in execute cursor.execute(sql, params) File "/local/mailman/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 67, in execute return self._execute_with_wrappers( File "/local/mailman/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers return executor(sql, params, many, context) File "/local/mailman/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute with self.db.wrap_database_errors: File "/local/mailman/venv/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/local/mailman/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) File "/local/mailman/venv/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 75, in execute return self.cursor.execute(query, args) File "/local/mailman/venv/lib/python3.10/site-packages/MySQLdb/cursors.py", line 179, in execute res = self._query(mogrified_query) File "/local/mailman/venv/lib/python3.10/site-packages/MySQLdb/cursors.py", line 330, in _query db.query(q) File "/local/mailman/venv/lib/python3.10/site-packages/MySQLdb/connections.py", line 257, in query _mysql.connection.query(self, query) django.db.utils.OperationalError: (2013, 'Lost connection to MySQL server during query') (venv) mailman@new-server ~ (v3.3.9) [0|1]> *more /etc/mailman3/settings.py* # Mailman Web configuration file. # /etc/mailman3/settings.py
# Get the default settings. from mailman_web.settings.base import * from mailman_web.settings.mailman import *
# Settings below supplement or override the defaults.
#: Default list of admins who receive the emails from error logging. ADMINS = ( ('Mailman Suite Admin', 'root@localhost'), )
# Postgresql database setup. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'mailman3web', 'USER': 'mailman3web', # TODO: Replace this with the password. 'PASSWORD': '***********', 'HOST': 'localhost', # PORT: set to empty string for default. 'PORT': '3306', # OPTIONS: Extra parameters to use when connecting to the database. #'OPTIONS': { # Set sql_mode to 'STRICT_TRANS_TABLES' for MySQL. See # https://docs.djangoproject.com/en/1.11/ref/ # databases/#setting-sql-mode # 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", # 'charset': 'utf8mb4', #},
}
}
# 'collectstatic' command will copy all the static files here. # Alias this location from your webserver to
/static
STATIC_ROOT = '/local/mailman/web/static'# enable the 'compress' command. COMPRESS_ENABLED = True
# Make sure that this directory is created or Django will fail on start. LOGGING['handlers']['file']['filename'] = '/local/mailman/web/logs/mailmanweb.log'
#: See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts ALLOWED_HOSTS = [ "localhost", # Archiving API from Mailman, keep it. "127.0.0.1", # "lists.your-domain.org", # Add here all production domains you have. "*" ]
#: See https://docs.djangoproject.com/en/dev/ref/settings/#csrf-trusted-origins (venv) mailman@new-server ~ (v3.3.9)> *mysql -umailman3web -p -h localhost mailman3web* Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 32 Server version: 10.6.12-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [mailman3web]> show tables; +-------------------------------+ | Tables_in_mailman3web | +-------------------------------+ | account_emailaddress | | account_emailconfirmation | | auth_group | | auth_group_permissions | | auth_permission | | auth_user | | auth_user_groups | | auth_user_user_permissions | | django_admin_log | | django_content_type | | django_mailman3_maildomain | | django_mailman3_profile | | django_migrations | | django_q_ormq | | django_q_schedule | | django_q_task | | django_session | | django_site | | hyperkitty_attachment | | hyperkitty_email | | hyperkitty_favorite | | hyperkitty_lastview | | hyperkitty_mailinglist | | hyperkitty_profile | | hyperkitty_sender | | hyperkitty_tag | | hyperkitty_tagging | | hyperkitty_thread | | hyperkitty_threadcategory | | hyperkitty_vote | | socialaccount_socialaccount | | socialaccount_socialapp | | socialaccount_socialapp_sites | | socialaccount_socialtoken | +-------------------------------+ 34 rows in set (0.000 sec)
Best Regards, Helio Loureiro https://helio.loureiro.eng.br https://github.com/helioloureiro https://mastodon.social/@helioloureiro
On Mon, 18 Dec 2023 at 17:11, Mark Sapiro <mark@msapiro.net> wrote:
On 12/18/23 6:24 AM, Helio Loureiro wrote:
Hi,
Indeed it was the configuration. It was placed into /etc/mailman3/mailman-web.py. After a I changed to /etc/mailman3/settings.py a few things advanced a little bit more.
I had to figure out how to fix mysqlclient installation since there isn't a mention about it and the simple "pip install mysqclient" was breaking with pkg-config issues. But it did work at the end.
Now I can see further messages on mailman3-web than before.
(venv) mailman@new-server ~ (v3.3.9)> mailman-web migrate System check identified some issues:
WARNINGS: account.EmailAddress: (models.W036) MariaDB does not support unique constraints with conditions. HINT: A constraint won't be created. Silence this warning if you don't care about it. account.EmailAddress: (models.W043) MariaDB does not support indexes on expressions. HINT: An index won't be created. Silence this warning if you don't care about it. Operations to perform: Apply all migrations: account, admin, auth, contenttypes, django_mailman3, django_q, hyperkitty, postorius, sessions, sites, socialaccount Running migrations: Applying account.0004_alter_emailaddress_drop_unique_email...Traceback (most recent call last):
I'm not sure why there would be an issue with this migration, but there is a possible compatibility issue depending on how you installed things.
django-mailman3<=1.3.11 is not compatible with django-allauth>=0.58.
In your venv, try
pip install django-allauth\<0.58
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
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 helio@loureiro.eng.br