Internal Server Error caused by to short VARCHAR column workflowstate.data on mysql.
When a user tried to register anonymously he was greeted with a red box stating the following error message:
<html> <head> <title>Internal Server Error</title> </head> <body> <h1><p>Internal Server Error</p></h1> </body> </html>
After a couple of hours searching through the various mailman logs I finally found the cause of the issue in the file mailman.log
. It appears as if the column workflowstate.data
is to small for the data which is to be stored.
[2020-11-14 18:19:48 +0000] [48] [ERROR] Error handling request /3.1/members
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 135, in handle
self.handle_request(listener, req, client, addr)
File "/usr/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/usr/lib/python3.8/site-packages/mailman/database/transaction.py", line 51, in wrapper
config.db.commit()
File "/usr/lib/python3.8/site-packages/mailman/database/base.py", line 52, in commit
self.store.commit()
File "/usr/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1042, in commit
self.transaction.commit()
File "/usr/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 502, in commit
self._assert_active(prepared_ok=True)
File "/usr/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 289, in _assert_active
raise sa_exc.InvalidRequestError(
sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Sessi
on.rollback(). Original exception was: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely)
(pymysql.err.DataError) (1406, "Data too long for column 'data' at row 1")
[SQL: INSERT INTO workflowstate (token, step, data) VALUES (%(token)s, %(step)s, %(data)s)]
[parameters: {'token': '**************************************', 'step': 'do_confirm_verify', 'data': '{"pre_approved": false, "pre_confirmed": false, "pre_verified": false, "invitation":
false, "address_key": "******.********@*********.**", "subscriber_key": 1, "user_key": "**************************************", "token_owner_key": 1, "send_welcome_message": null}'}]
(Background on this error at: http://sqlalche.me/e/13/9h9h) (Background on this error at: http://sqlalche.me/e/13/7s2a)
The server is running on GNU Mailman 3.3.2 (Tom Sawyer) with Mariadb.
Extending the column to VARCHAR(511) solved the issue.
alter table workflowstate change column data data varchar(511);
Edited by Yoann Kehler