Diagnose and fix service unavailable and an error occurred
Last update: Thu Nov 07 2024 00:00:00 GMT+0000 (Coordinated Universal Time)
- Topics:
- Cloud
- Site Management
CREATED FOR:
- Beginner
- Intermediate
- Developer
Learn how to triage and resolve two common errors seen on Adobe Commerce Cloud projects. Understand how and why these errors happen and what are the recommended steps to resolve them.
Who is this video for
- Developers and IT Professionals
- System Administrators
Video Content
- Diagnose and Resolve Storage Issues:
- Manage Maintenance Mode
- Efficient Troubleshooting tips
Transcript
as Russell with Adobe, triage and fix a cloud project that’s returning two different errors. The first one is the error that shows an error has happened during application run. And the other one that we’ll go through is when you see the message service temporarily unavailable. We’ll first focus on the problem that you see the message and error has happened during application run, see the application log, the exception log for details. So we’re going to use the advice here and we’re going to look at the log and see if we can figure this out. So we’re going to SSH into the environment. And I’ve already done that. And so this is a dev environment. So we are going to look at the exception log and we’re going to run the tail command and we’re just going to look at the last five lines. And the exception log is under var log and then exception.log. And you’ll notice that one of the last messages is that no space left on device. So to prove that, we’re just going to double check and we’re going to do the df-h. And we’re going to focus on this dev mapper line. And sure enough, we’ve allocated 4.9 gigabytes, but we’ve used 4.9. We have validated that this is our issue and so we are going to decide which is our best option. Our first option would be to just add more space. This happens through a YAML file, but for us, we want to get this fixed sooner than later. So we want to actually just find our offending files and let’s find a few and maybe just remove one of the larger ones so that way we can get some space and we can get back up and running. So I ran another command, this find command. And what this outputs is the top 15 offending files that are the largest. And because I did set this up, I know that all of these in this pubmedia file are just bloated files to show the problem. And so it is safe to delete. I would definitely recommend that if you’re unsure, use rsync or FTP and pull these files down. But for us, we’re just going to do the rm-rf. And we’re just going to get rid of that particular file. So now that it’s done, we can run df-h. And once again, we’re going to focus on this dev mapper line. And it looks like we’ve once again allocated 4.9 gigs, but we’ve only used 4.8, which means we have 90 megs free, which is still 99%, but now we have opened up just enough room to where we shouldn’t have any problems. So if we go back to our terminal of the window command, now instead of getting that error has happened during an application run, we have a new error. And this is a 503, service unavailable. This is more times than not just an issue with somebody leaving maintenance mode on. So we’re going to toggle back to our application after we’ve SSH’d in. And we’re going to run phpbin magento. And we’re just going to do maintenance. Status. And what this will do, well, this will give us a output on whether we’re in maintenance mode or not. And yes, maintenance is active. So to turn that off, we go phpbin magento. And we’re just going to use some shorthand. And now we’ve disabled maintenance mode. So let’s go back to our other terminal and we’re going to run that same curl command. And there we go. We have output coming back, which means everything is working as it should. I hope this really helps you diagnose two of the more common issues that you might find on one of these dev environments for Adobe Commerce Cloud. And please continue to use Experience League to continue your journey for all your Adobe Commerce learnings and all the other Adobe products.
Commands used in the video
Find the last 5 lines of the exception log mentioned in the response message.
tail -n 5 ~/var/log/exception.log
To check hard drive space. Pay attention to the line dev/mapper/xxxx
df -h
Lets find the top 15 largest files
find -type f -exec du -Sh {} + | sort -rh | head -n 15
Display the status of maintenance mode
php bin/magento maintenance:status
Disable the maintenance mode
php bin/magento maintenance:disable
recommendation-more-help
3a5f7e19-f383-4af8-8983-d01154c1402f