Postorius 500 Internal Server Error when viewing held messages for i3wm list #13441

Closed
opened 2026-06-29 22:53:55 +00:00 by jflory7 · 3 comments
Member

Description of request

I am encountering a 500 Internal Server Error in the Postorius web interface that is currently preventing me from moderating the held message queue for the i3wm@lists.fedoraproject.org mailing list.

Description of request

Please investigate the Postorius backend logs and resolve the 500 error so I can access the moderation queue and clear the held messages.

Steps to Reproduce

  1. Log in to the Fedora Postorius interface (User: jwheel).
  2. Navigate to the i3wm mailing list management page.
  3. Click to view the held messages / moderation queue.
  4. The page crashes with a red banner error.

Error Details

  • Error Message: HTTP Error 500: {"title": "500 Internal Server Error"}
  • Environment: Postorius Version 1.3.8 (GNU Mailman)

A screenshot of the Postorius web interface showing the logged-in user jwheel and a prominent heading reading "Something went wrong". Below the heading, a pink notification box displays the exact text "HTTP Error 500: {'title': '500 Internal Server Error'}".

Deadline (2026-07-17)

No hard deadline, but resolving this as soon as bandwidth allows would be greatly appreciated so legitimate messages don't remain stuck in moderation limbo.

Thanks!

CC: @x3mboy @nasirhm @defolos @odilhao

### Description of request I am encountering a 500 Internal Server Error in the Postorius web interface that is currently preventing me from moderating the [held message queue](https://lists.fedoraproject.org/admin/lists/i3wm.lists.fedoraproject.org/held_messages) for the `i3wm@lists.fedoraproject.org` mailing list. ### Description of request Please investigate the Postorius backend logs and resolve the 500 error so I can access the moderation queue and clear the held messages. ### Steps to Reproduce 1. Log in to the Fedora Postorius interface (User: `jwheel`). 2. Navigate to the `i3wm` mailing list management page. 3. Click to view the [held messages / moderation queue](https://lists.fedoraproject.org/admin/lists/i3wm.lists.fedoraproject.org/held_messages). 4. The page crashes with a red banner error. ### Error Details * **Error Message:** `HTTP Error 500: {"title": "500 Internal Server Error"}` * **Environment:** Postorius Version 1.3.8 (GNU Mailman) ![A screenshot of the Postorius web interface showing the logged-in user jwheel and a prominent heading reading "Something went wrong". Below the heading, a pink notification box displays the exact text "HTTP Error 500: {'title': '500 Internal Server Error'}".](/attachments/8a6e4e23-cc50-478f-8ca1-c15e6f4634cd "A screenshot of the Postorius web interface showing the logged-in user jwheel and a prominent heading reading \"Something went wrong\". Below the heading, a pink notification box displays the exact text \"HTTP Error 500: {'title': '500 Internal Server Error'}\".") ### Deadline (2026-07-17) No hard deadline, but resolving this as soon as bandwidth allows would be greatly appreciated so legitimate messages don't remain stuck in moderation limbo. Thanks! CC: @x3mboy @nasirhm @defolos @odilhao
Owner

Found out the error:

2026-07-02 10:53:33 [FALCON] [ERROR] GET /3.1/lists/i3wm@lists.fedoraproject.org/held?count=10&page=1 => Traceback (most recent call last):
  File "falcon/app.py", line 365, in falcon.app.App.__call__
  File "/usr/lib/python3.9/site-packages/mailman/rest/post_moderation.py", line 192, in on_get
    resource = self._make_collection(request)
  File "/usr/lib/python3.9/site-packages/mailman/rest/helpers.py", line 182, in _make_collection
    entries = [as_dict(resource) for resource in collection]
  File "/usr/lib/python3.9/site-packages/mailman/rest/helpers.py", line 182, in <listcomp>
    entries = [as_dict(resource) for resource in collection]
  File "/usr/lib/python3.9/site-packages/mailman/rest/post_moderation.py", line 183, in _resource_as_dict
    assert resource is not None, resource
AssertionError: None

It seems some e-mail is not available anymore. I will try to trace it in db and remove it.

Found out the error: ``` 2026-07-02 10:53:33 [FALCON] [ERROR] GET /3.1/lists/i3wm@lists.fedoraproject.org/held?count=10&page=1 => Traceback (most recent call last): File "falcon/app.py", line 365, in falcon.app.App.__call__ File "/usr/lib/python3.9/site-packages/mailman/rest/post_moderation.py", line 192, in on_get resource = self._make_collection(request) File "/usr/lib/python3.9/site-packages/mailman/rest/helpers.py", line 182, in _make_collection entries = [as_dict(resource) for resource in collection] File "/usr/lib/python3.9/site-packages/mailman/rest/helpers.py", line 182, in <listcomp> entries = [as_dict(resource) for resource in collection] File "/usr/lib/python3.9/site-packages/mailman/rest/post_moderation.py", line 183, in _resource_as_dict assert resource is not None, resource AssertionError: None ``` It seems some e-mail is not available anymore. I will try to trace it in db and remove it.
zlopez self-assigned this 2026-07-02 11:06:37 +00:00
Owner

I fixed it by finding the messages that didn't had body anymore by running this script in mailman shell:

from mailman.interfaces.listmanager import IListManager
from mailman.interfaces.requests import IListRequests, RequestType
from mailman.interfaces.messages import IMessageStore
from zope.component import getUtility

# 1. Get the managers
list_manager = getUtility(IListManager)
msg_db = getUtility(IMessageStore)

# 2. Grab your mailing list object
mlist = list_manager.get('i3wm@lists.fedoraproject.org')

if mlist is None:
    print("Mailing list not found. Check the email address string.")
else:
    req_db = IListRequests(mlist)
    
    print(f"Scanning held messages for: {mlist.list_name}\n" + "-"*50)
    
    # 3. req_db.held_requests is an iterator for all currently held items
    count = 0
    for request in req_db.held_requests:
        # request is an object containing metadata (id, key, data, request_type)
        
        # We ensure it's a held message (RequestType.held_message corresponds to type 1)
        if request.request_type == RequestType.held_message:
            count += 1
            print(f"[{count}] DB Request ID: {request.id}")
            print(f"    Message Key (Hash): {request.key}")
            
            # 4. Check if the message actually exists in the store
            msg = msg_db.get_message_by_id(request.key)
            if msg:
                print(f"    Status: VALID (Subject: '{msg.get('subject', 'No Subject')}')")
                print(f"    Sender: {msg.get('from', 'Unknown')}")
            if not msg:
                print("    Status: WARNING (Request metadata exists, but email body is MISSING)")
            print("-" * 30)
            
    if count == 0:
        print("No held messages found for this list.")

In the end I removed 41 messages from the held messages and the admin interface for held messages started working again.

Closing this as done.

I fixed it by finding the messages that didn't had body anymore by running this script in `mailman shell`: ``` from mailman.interfaces.listmanager import IListManager from mailman.interfaces.requests import IListRequests, RequestType from mailman.interfaces.messages import IMessageStore from zope.component import getUtility # 1. Get the managers list_manager = getUtility(IListManager) msg_db = getUtility(IMessageStore) # 2. Grab your mailing list object mlist = list_manager.get('i3wm@lists.fedoraproject.org') if mlist is None: print("Mailing list not found. Check the email address string.") else: req_db = IListRequests(mlist) print(f"Scanning held messages for: {mlist.list_name}\n" + "-"*50) # 3. req_db.held_requests is an iterator for all currently held items count = 0 for request in req_db.held_requests: # request is an object containing metadata (id, key, data, request_type) # We ensure it's a held message (RequestType.held_message corresponds to type 1) if request.request_type == RequestType.held_message: count += 1 print(f"[{count}] DB Request ID: {request.id}") print(f" Message Key (Hash): {request.key}") # 4. Check if the message actually exists in the store msg = msg_db.get_message_by_id(request.key) if msg: print(f" Status: VALID (Subject: '{msg.get('subject', 'No Subject')}')") print(f" Sender: {msg.get('from', 'Unknown')}") if not msg: print(" Status: WARNING (Request metadata exists, but email body is MISSING)") print("-" * 30) if count == 0: print("No held messages found for this list.") ``` In the end I removed 41 messages from the held messages and the admin interface for held messages started working again. Closing this as done.
Author
Member

Awesome! Thanks for figuring this out @zlopez 🙏🏻

Awesome! Thanks for figuring this out @zlopez 🙏🏻
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
infra/tickets#13441
No description provided.