Error 500 only sometimes
Hi, I'm having an issue with my laravel app on digital ocean.
When I visit my website, sometimes the page loads normally and sometimes I get a 500 error.
Why does error 500 only appear sometimes?
You can enter this link to test: https://easypost.tech/
You will see that sometimes the website loads and sometimes a 500 error appears.
Hi there,
I would recommend checking your Laravel log at storage/logs/laravel.log
for more information on what the actual error is.
The 500 error is displayed when Laravel ENV is set to production so that the actual error is hidden. But in the log you should be able to see the actual error that is causing the problem.
Feel free to share the actual error here.
















There are no errors in my laravel.log
What you could do is temporarily enable debug mode so you could see the error displayed on the site directly. You can do that by changing the APP_ENV
from prod
to local
so you could take a screenshot of the error and then rever the change.
I have a hunch that the problem is with sessions, if you've deployed your app on the DigitalOcean App Platform, and if you've selected a plan with multiple containers, then you would also need to setup Redis so that the containers could share the sessions. You can add a Redis cluster to your setup and then define the standard Redis details as ENV variables.
Alternatively, you could scale down to just a single container rather than using multiple ones.
Let me know how it goes!
Best,
Bobby
















Thanks, Bobby!
No problem at all! Happy to help!