Hi all, I am using magento cloud.
My staging server show error 503 Server unavailable atm.
I found this message in site.log
Maintenace flag is set, not starting nginx
I checked with bin/magento maintenance:status
maintenance mode is not active.
anyone know how to fix it?
Kindly run below commands,
php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f php bin/magento indexer:reindex php bin/magento cache:flush php bin/magento maintenance:disable
cannot run static-content deploy with -f option. no this option.
Ran everything without any error. no luck.
The problem is nginx did not start after deployment
I read the deploy log. It disabled maintenance mode already after deployment.
but magento cloud is managed hosting,
you need to ask your hosting support -
why you asking on community forums???
sigh.... they won't fix it immediately because its not happening at production and I need to apply new function to production asap. I did a lot of research already but no luck so far.
Here are some tips to troubleshoot the 503 error and the 'Maintenance flag is set' issue on Magento Cloud:
Check for and remove any .maintenance.flag file in the codebase.
Flush all caches and clean generated files.
Redeploy the codebase to eliminate any stale maintenance flags.
Verify Nginx and PHP-FPM configs don't have active maintenance directives.
Check for extension conflicts triggering maintenance mode.
Refresh backend services like Redis, and Elasticsearch.
Contact Magento Cloud support if the issue persists after trying these steps. A full environment rebuild may be required.
The goal is to remove any erroneous maintenance flags, flush caches, redeploy fresh code, and ensure services are running properly without conflicts. That should resolve the staging environment's 503 error.