dongnvwang8591 2018-10-22 12:11
浏览 121

在SQS上使用Laravel发送邮件时出错:导致400 Bad Request响应/ 413实体响应太大

I have a script that fetches some data from GA and updates a few entries in my database. It's in a cron and runs every morning. It typically takes about 2.5-3 hours to run. Post completion, I am sending an email to a few people on the team. The contents of this email are similar to: "name of the cron: ran successfully". I am using Laravel (5.6) mailables and multiple scripts use the same method to send a completion mail in the same way. The body of email is sent as an HTML string through data (using with() in build() method of mailable I created). Mails are queued on Amazon SQS. None of the other scripts are producing this error. Here is some excerpt from the error I get in console:

<?xml version="1.0"?>
<ErrorResponse xmlns="http://queue.amazonaws.com/doc/2  
  012-11-05/"><Error><Type>Sender</Type><Code>I (truncated...)                 
   InvalidParameterValue (client): One or more parameters are invalid. Reason  
  : Message must be shorter than 262144 bytes. - <?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
<Error>
<Type>Sender</Type>
<Code>InvalidParameterValue</Code>
<Message>One or more parameters are invalid. Reason: Message must be shorter than 262144 bytes.
</Message>
<Detail/>
</Error>
<RequestId>d1a6b7ca-33b4-54ca-bf23-e38d3228e1d6</RequestId>  
</ErrorResponse>

There are no attachments or images in this email. I am wondering how a plain text email can exceed the limit of 256 KB. Any ideas?

Update: My bad. There is one more email that is sent via this script. It's sent to users of the website. It doesn't have any attachments, but a few logos (< 15 KB in total). Rest is plain text and links. It is sent to multiple users throughout the course, but the error is not thrown immediately, so it's not happening on every email. I have tried simulating both mails through tinker and it has worked. I was not serializing the data in the users' mail. Could that be the issue?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 关于多单片机模块化的一些问题
    • ¥30 seata使用出现报错,其他服务找不到seata
    • ¥35 引用csv数据文件(4列1800行),通过高斯-赛德尔法拟合曲线,在选取(每五十点取1点)数据,求该数据点的曲率中心。
    • ¥20 程序只发送0X01,串口助手显示不正确,配置看了没有问题115200-8-1-no,如何解决?
    • ¥15 Google speech command 数据集获取
    • ¥15 vue3+element-plus页面崩溃
    • ¥15 像这种代码要怎么跑起来?
    • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
    • ¥15 pyqt5tools安装失败
    • ¥15 mmdetection