I just deployed Mailman3 last night. This is the first error message I've encountered from Hyperkitty. It looks like a MySQL configuration issue. I've done some tuning to the wait/timeouts but I'm still getting the error message. I suspect the root cause is the size of the message. mailman qfile shows the message has 84746 lines and the .pck file is 6.9M.
Let me know if there's more specific tuning that needs to be done to cover larger messages.
My MySQL wait/timeouts are set as follows:
MySQL [mysql]> SHOW VARIABLES LIKE "%timeout%"; +-----------------------------+----------+ | Variable_name | Value | +-----------------------------+----------+ | connect_timeout | 120 | | delayed_insert_timeout | 300 | | have_statement_timeout | YES | | innodb_flush_log_at_timeout | 1 | | innodb_lock_wait_timeout | 50 | | innodb_rollback_on_timeout | ON | | interactive_timeout | 28800 | | lock_wait_timeout | 31536000 | | net_read_timeout | 90 | | net_write_timeout | 90 | | rpl_stop_slave_timeout | 31536000 | | slave_net_timeout | 60 | | wait_timeout | 28800 | +-----------------------------+----------+ 13 rows in set (0.002 sec)
MySQL [mysql]> SHOW VARIABLES LIKE "%wait%"; +---------------------------------------------------+----------+ | Variable_name | Value | +---------------------------------------------------+----------+ | innodb_lock_wait_timeout | 50 | | innodb_spin_wait_delay | 6 | | lock_wait_timeout | 31536000 | | performance_schema_events_waits_history_long_size | 0 | | performance_schema_events_waits_history_size | 0 | | wait_timeout | 28800 | +---------------------------------------------------+----------+ 6 rows in set (0.004 sec)
############################################## #######################
ERROR 2021-11-05 09:26:28,656 261 django.request Internal Server Error: /hyperkitty/api/mailman/archive Traceback (most recent call last): File "/opt/mailmanve/lib/python3.6/site-packages/django/db/backends/utils.py", line 86, in _execute return self.cursor.execute(sql, params) File "/opt/mailmanve/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 74, in execute return self.cursor.execute(query, args) File "/opt/mailmanve/lib/python3.6/site-packages/MySQLdb/cursors.py", line 206, in execute res = self._query(query) File "/opt/mailmanve/lib/python3.6/site-packages/MySQLdb/cursors.py", line 319, in _query db.query(q) File "/opt/mailmanve/lib/python3.6/site-packages/MySQLdb/connections.py", line 259, in query _mysql.connection.query(self, query) MySQLdb._exceptions.OperationalError: (2006, 'MySQL server has gone away')
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/opt/mailmanve/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/opt/mailmanve/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "/opt/mailmanve/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/mailmanve/lib/python3.6/site-packages/django/views/decorators/http.py", line 40, in inner return func(request, *args, **kwargs) File "/opt/mailmanve/lib/python3.6/site-packages/hyperkitty/views/mailman.py", line 118, in _decorator return func(request, *args, **kwargs) File "/opt/mailmanve/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "/opt/mailmanve/lib/python3.6/site-packages/hyperkitty/views/mailman.py", line 164, in archive add_to_list(mlist_fqdn, msg) File "/opt/mailmanve/lib/python3.6/site-packages/hyperkitty/lib/incoming.py", line 153, in add_to_list email.save() File "/opt/mailmanve/lib/python3.6/site-packages/django/db/models/base.py", line 749, in save force_update=force_update, update_fields=update_fields) File "/opt/mailmanve/lib/python3.6/site-packages/django/db/models/base.py", line 787, in save_base force_update, using, update_fields, File "/opt/mailmanve/lib/python3.6/site-packages/django/db/models/base.py", line 890, in _save_table results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw) File "/opt/mailmanve/lib/python3.6/site-packages/django/db/models/base.py", line 929, in _do_insert using=using, raw=raw, File "/opt/mailmanve/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/opt/mailmanve/lib/python3.6/site-packages/django/db/models/query.py", line 1204, in _insert return query.get_compiler(using=using).execute_sql(returning_fields) File "/opt/mailmanve/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1394, in execute_sql cursor.execute(sql, params) File "/opt/mailmanve/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/opt/mailmanve/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers return executor(sql, params, many, context) File "/opt/mailmanve/lib/python3.6/site-packages/django/db/backends/utils.py", line 86, in _execute return self.cursor.execute(sql, params) File "/opt/mailmanve/lib/python3.6/site-packages/django/db/utils.py", line 90, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/opt/mailmanve/lib/python3.6/site-packages/django/db/backends/utils.py", line 86, in _execute return self.cursor.execute(sql, params) File "/opt/mailmanve/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 74, in execute return self.cursor.execute(query, args) File "/opt/mailmanve/lib/python3.6/site-packages/MySQLdb/cursors.py", line 206, in execute res = self._query(query) File "/opt/mailmanve/lib/python3.6/site-packages/MySQLdb/cursors.py", line 319, in _query db.query(q) File "/opt/mailmanve/lib/python3.6/site-packages/MySQLdb/connections.py", line 259, in query _mysql.connection.query(self, query) django.db.utils.OperationalError: (2006, 'MySQL server has gone away')
Update: I had to adjust the max_allowed_packet size for my RDS instance which defaulted to just 4MB. My test environment uses MariaDB which currently defaults to 16MB so that helped me identify the issue.
participants (1)
-
dancab@caltech.edu