mailjet-apiv3-java icon indicating copy to clipboard operation
mailjet-apiv3-java copied to clipboard

Unexpected errors while sending large attachment

Open Kristianrosland opened this issue 3 years ago • 2 comments

Unexpected error when sending attachments larger than the limit of 15MB in a transactional email.

I would expect the mailjet client to return a send error like mj-0011 (.. the payload size is over the limit), but instead I get a MailjetClientCommunicationException with Caused by: okhttp3.internal.http2.ConnectionShutdownException.

Is this expected behavior? If so, when is the mj-0011 error used?

If I use latest version of okhttp (4.9.3), I get cause okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL.

Kristianrosland avatar May 13 '22 13:05 Kristianrosland

This appears to be a problem with the okhttp-client, as it works when I hit the API from postman.

Kristianrosland avatar May 18 '22 13:05 Kristianrosland

@Kristianrosland, thank you for raising this issue. Yes, the total email message size must not exceed 15MB. https://dev.mailjet.com/email/reference/send-emails/#:~:text=The%20total%20size%20of%20attachments,should%20not%20exceed%2015%20MB.

https://documentation.mailjet.com/hc/en-us/articles/360043179773-What-is-the-size-limit-for-attachments-files-sent-via-Mailjet

When I've tried to use the latest okhttp-client 5.0.0-alpha.10, the error looks more readable <html><body><h1>413 Request Entity Too Large</h1></body></html> The okhttp-client will be updated once 5.0 is released.

When hit the API from Postman, got the same error:

<html>
<body>
	<h1>413 Request Entity Too Large</h1>
</body>
</html>

If so, please ask Mailjet Support about mj-0011 error. https://www.mailjet.com/contact/support/

szagr avatar Sep 24 '22 19:09 szagr