How to resolve 503 service unavailable error in Magento 2?

Error 503 – Service Temporary Unavailable! This is an error called “503” admits when you try to do admin access. Here, you get the error “503 error”! Also, the settings and configurations of Magento 1 and 2 won’t be the same. So, there is no option for you to think like Magento 1 is the back support of Magento 2.

Firstly, cross-check the maintenance mode to confirm the problem started there or not.

Open the Apache error.log to check the presence of below command:

Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration.

Luckily! If the problem is out of maintenance mode then it’s easy to fix the error. Apache 2.4 is the main source of 503 errors. It nearly gives the problem in directives of .htaccess. It takes the responsibility to rewrite the Magento 2 URL. It is not possible to give the entire blame towards Apache 2.4. Cross-check for the mod_access_compat is disable or enable because it has to be enabled at all the time.

A user privileged as root should execute the below command:


Code:
a2enmod access_compat
service <name> restart
CentOS – Add httpd by replacing <name>

Ubuntu – Add apache2 by replacing <name>

Let’s see the solution for fixing the Magento 2 error 503:

Magento 1:
To bring the website into the stage of normal kindly go to the root directory to delete the file .maintenance.flag.

Magento 2: It is quite different here! Only the difference is in the var folder. You need to check the below command in var folder.

Exception printing is disabled by default for security reasons

After running the above command, you will be getting the statement as “Please upgrade your database”. Now, you need to execute the below command from the root directory of Magento 2.

Code:
php bin/magento setup:upgrade
Completed the error fix for 503 errors! It just takes one or two minutes time to confirm all the setting.
Author
bhawanisingh
Views
133
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from bhawanisingh

Top