Bref Error on Laravel Endpoint #1062
-
Hi there 👋 This was originally posted as a comment on another issue (#385) but I've split it out here into its own issue because of moderator feedback that even though the error message is the same, the issue is likely unrelated. I'm running a Laravel app and receiving an error one particular endpoint. All of my other endpoints work, it's just this one that's failing. At first I thought it might have been a memory overload, but my site is currently deployed on a dedicated server with 1/2 the memory of my lambda functions (500 MB vs 1024 MB). I also thought it might have been a timeout issue, but the endpoint errors out after about 8 seconds, which isn't even close to the 28 second limit on my function (see my serverless config below). This is the error response in my browser:
Super helpful right? It seems like my endpoint code is all running successfully. I sent Log messages to Papertrail all the way up to the return statement in my Controller, and all the logs go in successfully. Plus, no exceptions seem to be thrown in Laravel. Watching the invocation and response in my dev tools, I see the following response header:
and
Here's the functions snippet of my serverless configuration file:
One last final tidbit that makes this all particularly weird. When I return a hard-coded response in my endpoint like Help would be much appreciated :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! First just to start with one general advice (to save yourself some time in the future): always look at the CloudWatch logs first whenever there's an error. That's where everything is logged. Everything else is usually just a distraction (like headers and such). The error message is:
413 is a HTTP status code that says:
My guess is that your endpoint returns a response that is larger than what Lambda allows: 6MB Could it be the case? If that's indeed the source of the error, we can probably write some code in Bref to "enhance" the |
Beta Was this translation helpful? Give feedback.
Hi!
First just to start with one general advice (to save yourself some time in the future): always look at the CloudWatch logs first whenever there's an error. That's where everything is logged. Everything else is usually just a distraction (like headers and such).
The error message is:
413 is a HTTP status code that says:
My guess is that your endpoint returns a response that is larger than what Lambda allows: 6MB
Could it be the case?
If that's indeed the source of the error, we can probably write some code in Bref to "enhance" the
413
code with a more detailed error message.