Receiving mongodb error (appear in st2workflow logs) sending a 2MB content How it reached ~18MB?
Open
Nobody has claimed this yet.
stale
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
Receiving mongodb error (appear in st2workflow logs) sending a 2MB file How it reached ~18MB?
Workflow execution completed with errors. (type='error',message="OperationError: Could not save document (BSONObj size: 18680128 (0x11D0940) is invalid. Size must be between 0 and 16793600(16MB
) First element: _id: ObjectId('616e796a84fc83000116d6c7'))",task_id='parse_email_attachments',route=1)
I assume part of this issue is because ST store also the whole context for each task.
Although I saw my object is ~13MB in mongo:

ST 3.1\3.4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the st2workflow logs for task parse_email_attachments and the reported BSONObj size error. Compare the 2MB attachment with the stored MongoDB document and workflow task context to identify where the document grows. Done means the source of the size increase is documented and the workflow no longer exceeds MongoDB's 16MB document limit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, python
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100