REST API http://.../3.1/users/../preferred_address returns 404 for GET and POST
Postorius 1.3.6 does not work anymore when displaying the details of a list that I own (https://lists.XXX.org/mailman3/postorius/lists/rapcs-pilotes.listsXXXorg/) . It worked before but there was several upgrades in between (Ubuntu, apt packages, MySQL, Python).
It displays the usual header/footer of the page but with "Something went wrong" above a red box with "HTTP Error 404:".
/var/log/mailman3/mailman.log last entries are below (note the 404 result codes in the REST API): Apr ... 127.0.0.1 - - "GET /3.1/users/d5...94 HTTP/1.1" 200 418 Apr ... 127.0.0.1 - - "GET /3.1/users/d5...94/preferred_address HTTP/1.1" 404 0 Apr ... 127.0.0.1 - - "GET /3.1/addresses/eric@XXX.org HTTP/1.1" 200 379 Apr ... 127.0.0.1 - - "POST /3.1/users/d5...94/preferred_address HTTP/1.1" 404 0
/var/log/mailman3/web/mailman-web.log of course has an exception about this 404 result code.
Using the MM3 shell, the preferred_address can be displayed and even modified. There are also good values in the MySQL database. Other API endpoints for users work fine (preferences, addresses, ...)
Postorius system information is: Mailman Core Version GNU Mailman 3.2.2 (La Villa Strangiato) Mailman Core API Version 3.1 Mailman Core Python Version 3.8.10 (default, Mar 13 2023, 10:26:41) [GCC 9.4.0]
Running Ubuntu 20.04.4 LTS and Python 3.8
Thanks in advance for any hint to solve this issue (I have held messages that I would love to accept)
On 4/13/23 05:07, Eric Vyncke wrote:
/var/log/mailman3/web/mailman-web.log of course has an exception about this 404 result code.
Using the MM3 shell, the preferred_address can be displayed and even modified. There are also good values in the MySQL database. Other API endpoints for users work fine (preferences, addresses, ...)
In Mailman shell, have you done
um = getUtility(IUserManager) usr = um.get_user_by_id('d5...94') usr.preferred_address
Where 'd5...94' is the full uuid from the mailman.log entries?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 4/13/23 05:07, Eric Vyncke wrote:
Thanks in advance for any hint to solve this issue (I have held messages that I would love to accept)
You can accept them via mailman shell. E.g., to accept all held messages for a list
$ mailman shell -l list@example.com
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.
The variable 'm' is the list.example.com mailing list
>>> from mailman.app.moderator import handle_message
>>> requestsdb = IListRequests(m)
>>> for req in requestsdb.held_requests:
... handle_message(m, req.id, Action.accept)
...
>>>
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
It seems to be working, thank you. I will save this piece of code for another time.
Cheeers
Humm after some more investigations, it seems that my mailman3 installation via debian packages is completely mixed up :-( This would explain the issue if the REST API is using 3.2.2 code and postorius is expecting 3.3.5...
drwxr-xr-x 29 root root 4096 Nov 18 2021 /usr/lib/python3/dist-packages/mailman drwxr-xr-x 2 root root 4096 Nov 18 2021 /usr/lib/python3/dist-packages/mailman-3.2.2.egg-info drwxr-xr-x 8 root root 4096 Nov 18 2021 /usr/lib/python3/dist-packages/mailmanclient drwxr-xr-x 2 root root 4096 Nov 18 2021 /usr/lib/python3/dist-packages/mailmanclient-3.2.2.egg-info drwxr-xr-x 4 root root 4096 Apr 13 14:29 /usr/lib/python3/dist-packages/mailman_hyperkitty drwxr-xr-x 2 root root 4096 Apr 13 14:28 /usr/lib/python3/dist-packages/mailman_hyperkitty-1.1.0.egg-info drwxr-sr-x 30 root staff 4096 Apr 13 09:32 /usr/local/lib/python3.8/dist-packages/mailman drwxr-sr-x 2 root staff 4096 Nov 18 2021 /usr/local/lib/python3.8/dist-packages/mailman-3.3.5.dist-info drwxr-sr-x 9 root staff 4096 Nov 18 2021 /usr/local/lib/python3.8/dist-packages/mailmanclient drwxr-sr-x 2 root staff 4096 Nov 18 2021 /usr/local/lib/python3.8/dist-packages/mailmanclient-3.3.3.dist-info drwxr-sr-x 4 root staff 4096 Apr 12 20:47 /usr/local/lib/python3.8/dist-packages/mailman_web drwxr-sr-x 2 root staff 4096 Nov 18 2021 /usr/local/lib/python3.8/dist-packages/mailman_web-0.0.5.dist-info
On 4/13/23 13:21, Eric Vyncke wrote:
Humm after some more investigations, it seems that my mailman3 installation via debian packages is completely mixed up :-( This would explain the issue if the REST API is using 3.2.2 code and postorius is expecting 3.3.5...
drwxr-xr-x 29 root root 4096 Nov 18 2021 /usr/lib/python3/dist-packages/mailman drwxr-xr-x 2 root root 4096 Nov 18 2021 /usr/lib/python3/dist-packages/mailman-3.2.2.egg-info drwxr-xr-x 8 root root 4096 Nov 18 2021 /usr/lib/python3/dist-packages/mailmanclient drwxr-xr-x 2 root root 4096 Nov 18 2021 /usr/lib/python3/dist-packages/mailmanclient-3.2.2.egg-info drwxr-xr-x 4 root root 4096 Apr 13 14:29 /usr/lib/python3/dist-packages/mailman_hyperkitty drwxr-xr-x 2 root root 4096 Apr 13 14:28 /usr/lib/python3/dist-packages/mailman_hyperkitty-1.1.0.egg-info drwxr-sr-x 30 root staff 4096 Apr 13 09:32 /usr/local/lib/python3.8/dist-packages/mailman drwxr-sr-x 2 root staff 4096 Nov 18 2021 /usr/local/lib/python3.8/dist-packages/mailman-3.3.5.dist-info drwxr-sr-x 9 root staff 4096 Nov 18 2021 /usr/local/lib/python3.8/dist-packages/mailmanclient drwxr-sr-x 2 root staff 4096 Nov 18 2021 /usr/local/lib/python3.8/dist-packages/mailmanclient-3.3.3.dist-info drwxr-sr-x 4 root staff 4096 Apr 12 20:47 /usr/local/lib/python3.8/dist-packages/mailman_web drwxr-sr-x 2 root staff 4096 Nov 18 2021 /usr/local/lib/python3.8/dist-packages/mailman_web-0.0.5.dist-info
Yes, that would be the problem if the Python running Mailman core was using libraries in /usr/lib/python3/dist-packages/ and the Python running Django was using libraries in /usr/local/lib/python3.8/dist-packages/. The ability to get/set preferred_address via REST was added to Mailman core 3.3.0 and is not in 3.2.2.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Eric Vyncke
-
Mark Sapiro