On 2/22/21 8:26 AM, Marco Marinello wrote:
Dear Mark,
thank you for your answer. I can confirm my Hyperkitty works just fine for archiving messages. I can even confirm Hyperkitty can reach Mailman REST API. I haven't touched the LOGGING configuration but here you go (can even confirm hyperkitty.log is filled correctly with logs):
What I was trying to say is this
KeyError at /hyperkitty/list/my@lists.domain.eu/pop-threads 'file'
exception often occurs in messages sent by Django to site admins and is never actually relates to the real problem and should just be ignored.
In mailman.log, instead, it seems like there's some issue with PostgreSQL
[2021-02-21 18:57:19 +0000] [11685] [ERROR] Error handling request /3.1/users/user@example.com Traceback (most recent call last): File "/opt/mailman/venv/lib64/python3.6/site-packages/gunicorn/workers/sync.py", line 134, in handle self.handle_request(listener, req, client, addr) File "/opt/mailman/venv/lib64/python3.6/site-packages/gunicorn/workers/sync.py", line 175, in handle_request respiter = self.wsgi(environ, resp.start_response) File "/opt/mailman/venv/lib64/python3.6/site-packages/mailman/database/transaction.py", line 50, in wrapper rtn = function(*args, **kws) File "/opt/mailman/venv/lib64/python3.6/site-packages/mailman/rest/wsgiapp.py", line 193, in __call__ return super().__call__(environ, start_response) File "falcon/api.py", line 274, in falcon.api.API.__call__ File "falcon/api.py", line 269, in falcon.api.API.__call__ File "/opt/mailman/venv/lib64/python3.6/site-packages/mailman/rest/users.py", line 211, in on_get okay(response, self._resource_as_json(self._user)) File "/opt/mailman/venv/lib64/python3.6/site-packages/mailman/rest/helpers.py", line 124, in _resource_as_json resource = self._resource_as_dict(resource) File "/opt/mailman/venv/lib64/python3.6/site-packages/mailman/rest/users.py", line 130, in _resource_as_dict user_id = self.api.from_uuid(user.user_id) File "/opt/mailman/venv/lib64/python3.6/site-packages/mailman/core/api.py", line 78, in from_uuid return uuid.hex AttributeError: 'NoneType' object has no attribute 'hex' [21/Feb/2021:18:57:19 +0000] "GET /3.1/users/user@example.com HTTP/1.1" 500 0 "-" "-"
I think this is the real issue. HyperKitty is trying to get the user information from core for user@example.com and this is throwing the AttributeError resulting in the 500. This is most likely some kind of database issue.
at this point
File "/opt/mailman/venv/lib64/python3.6/site-packages/mailman/rest/users.py", line 211, in on_get okay(response, self._resource_as_json(self._user))
self._user is not None, but at this point
File "/opt/mailman/venv/lib64/python3.6/site-packages/mailman/rest/users.py", line 130, in _resource_as_dict user_id = self.api.from_uuid(user.user_id)
user.user_id is None.
If I were you, I would look at the database. First, I would find the entry in the address table. I.e.,
select user_id from address where email = 'user@example.com';
then the uid
select uid from uid where id = <the user_id from above>
I suspect there is no uid entry for this id.
You might get more information from
$ /opt/mailman/mm/bin/mailman shell Welcome to the GNU Mailman shell Use commit() to commit changes. Use abort() to discard changes since the last commit. Exit with ctrl+D does an implicit commit() but exit() does not.
um = getUtility(IUserManager) usr = um.get_user('user@example.com')
which I suspect will also throw an exception, but if not
usr.id
should return the id found by select user_id from address where email = 'user@example.com';
and
usr.user_id
should return the uiud which should not be None
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan