I have a custom 503 "site down for maintenance" page configured and I see this served publicly when I switch to maintenance mode as described here:
http://devdocs.magento.com/guides/v2.2/install-gde/install/cli/install-cli-subcommands-maint.html
I have run the command magento maintenance:enable --ip=<ip address>, which serves to create the var/.maintenance.flag file containing my office ip address in the whitelist. I thus have M2 running in maintenance mode and I still have full access to the site.
But wait! I now wish to do some work on the site in developer mode, i.e. make code changes in xml and php files. When I switch to developer mode, this disturbs the way maintenance mode works, as it prevents the custom 503 status page from showing and instead renders a stack trace to the public! This issue is raised here, but there are no real answers to this conundrum.
What on earth is the point in having a maintenance mode that does not allow a developer to switch into "developer mode" where the caches are bypassed and we can actually do some work?! This whole setup makes no sense to me. If I leave it in production mode, I will need to manually nuke caches/static files after every change is made, which is massively impractical!
What are people doing to work on live Magento 2 sites? What is the workflow adopted to temporarily switch a live site into maintenance mode and run it in developer mode concurrently? The official Magento 2 docs seem to make no attempt to address this. Can anyone point me in the direction of some resources that explain how to put a live site into maintenance mode, then set to developer mode while still showing custom 503 page to the public?
Note: I have custom modules and theme modules that only permit changes to be made via the admin panel when the site is switched to developer mode, so I MUST be able to go into developer mode. Many thanks.
As it stands right now the only solution is to modify magento's core code, which is not ideal for patching.
This has been something that has annoyed me for quite some time now. I also use the maintenance flag in conjunction with an ip whitelist to show a "Coming Soon" or "Under Construction" page while doing work. In developer mode, as you pointed out, it fails to function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With