dosubot[bot] commented on issue #38420:
URL: https://github.com/apache/superset/issues/38420#issuecomment-4001321162

   <!-- Answer -->
   This issue appears related to the webhook notification feature added in [PR 
#36127](https://github.com/apache/superset/pull/36127). There's a related 
discussion with the same Mattermost errors: 
[#38283](https://github.com/apache/superset/discussions/38283).
   
   **Root cause of the errors:**
   
   1. **413 (Request body too large)**: The PNG/PDF attachments are being sent 
directly to Mattermost's Incoming Webhook, which has payload size limits. 
Mattermost webhooks aren't designed to receive large binary file uploads.
   
   2. **400 (multipart/form-data decode failure)**: Mattermost Incoming 
Webhooks expect `application/json` payloads, but Superset is sending 
`multipart/form-data` to include the file attachments. This is a fundamental 
incompatibility.
   
   **The core issue**: Mattermost Incoming Webhooks are not suitable for 
receiving file attachments (PNG/PDF). They only accept JSON text payloads. To 
send files to Mattermost, you'd need to use the [Mattermost Files 
API](https://api.mattermost.com/#tag/files) instead of webhooks, which requires 
authentication tokens rather than webhook URLs.
   
   **Workarounds:**
   - Use **text-only** report format if webhook notifications to Mattermost are 
needed
   - Use **email** notifications for PNG/PDF reports
   - Use **Slack** integration (which properly handles file uploads via the 
SDK) if you have a Mattermost-Slack bridge
   
   This may warrant a documentation update or feature enhancement to clarify 
that webhook endpoints receiving file attachments need to support 
`multipart/form-data` and accept sufficiently large payloads.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/9e84c5ea-bfa1-41bb-9470-1cc6c21ff479?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/9e84c5ea-bfa1-41bb-9470-1cc6c21ff479?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/9e84c5ea-bfa1-41bb-9470-1cc6c21ff479?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/9e84c5ea-bfa1-41bb-9470-1cc6c21ff479?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/9e84c5ea-bfa1-41bb-9470-1cc6c21ff479?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/9e84c5ea-bfa1-41bb-9470-1cc6c21ff479?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/9e84c5ea-bfa1-41bb-9470-1cc6c21ff479?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20issue%20appears%20related%20to%20the%20webhook%20notification%20feature%20added%20in%20%5BPR%20%2336127%5D%28https%3A//github.com/apache/superset/pull/36127%29.%20There%27s%20a%20related%20discussion%20with%20the%20same%20Mattermost%20errors%3A%20%5B%2338283%5D%28https%3A//github.com/apache/superset/discussions/38283%29.%0A%0A%2A%2ARoot%20cause%20of%20the%20errors%3A%2A%2A%0A%0A1.%20%2A%2A413%20%28Request%20body%20too%20large%29%2A%2A%3A%20The%20PNG/PDF%20attachments%20are%20being%20sent%20directly%20to%20Mattermost%27s%20Incoming%20Webhook%2C%20which%20has%20payload%20size%20limits.%20Mattermost%20webhooks%20aren%27t%20designed%20to%20receive%20large%20binary%20file%20uploads.%0A%0A2.%20%2A%2A400%20%28multipart/form-data%20decode%20failure%
 
29%2A%2A%3A%20Mattermost%20Incoming%20Webhooks%20expect%20%60application/json%60%20payloads%2C%20but%20Superset%20is%20sending%20%60multipart/form-data%60%20to%20include%20the%20file%20attachments.%20This%20is%20a%20fundamental%20incompatibility.%0A%0A%2A%2AThe%20core%20issue%2A%2A%3A%20Mattermost%20Incoming%20Webhooks%20are%20not%20suitable%20for%20receiving%20file%20attachments%20%28PNG/PDF%29.%20They%20only%20accept%20JSON%20text%20payloads.%20To%20send%20files%20to%20Mattermost%2C%20you%27d%20need%20to%20use%20the%20%5BMattermost%20Files%20API%5D%28https%3A//api.mattermost.com/%23tag/files%29%20instead%20of%20webhooks%2C%20which%20requires%20authentication%20tokens%20rather%20than%20webhook%20URLs.%0A%0A%2A%2AWorkarounds%3A%2A%2A%0A-%20Use%20%2A%2Atext-only%2A%2A%20report%20format%20if%20webhook%20notifications%20to%20Mattermost%20are%20needed%0A-%20Use%20%2A%2Aemail%2A%2A%20notifications%20for%20PNG/PDF%20reports%0A-%20Use%20%2A%2ASlack%2A%2A%20integration%20%28which%20properly
 
%20handles%20file%20uploads%20via%20the%20SDK%29%20if%20you%20have%20a%20Mattermost-Slack%20bridge%0A%0AThis%20may%20warrant%20a%20documentation%20update%20or%20feature%20enhancement%20to%20clarify%20that%20webhook%20endpoints%20receiving%20file%20attachments%20need%20to%20support%20%60multipart/form-data%60%20and%20accept%20sufficiently%20large%20payloads.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/38420)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to