Mule 4 : 503 Service Unavailable when working locally
2 min read
I always find myself looking for this simple fix every time I am working on a new Mule project locally. So here it is for those of you who don’t want to search for it anymore. You can bookmark this article as I am sure you’ll need it again in the future.
When starting your Mule project in Debug mode, the build process succeeds but no matter which route you try, the API always returns a 503 Service Unavailable.
In this case, all you need to do is to disable what Mulesoft calls the Gatekeeper. This is a useful system when your API is deployed to block requests when the API is not ready yet to accept requests, but it can get in your way while testing locally. Disabling it will not affect the deployed artifact because the configuration stays in your machine.
To disable the Gatekeeper, here is what you need to do :
- Go to your « Debug configurations »
- Select the « Arguments » tab
- Add the following argument in the « VM arguments » text area
Note : If there was any arguments previously set, append this next to them.
Click « Apply » and then « Debug »
Hopefully, your API works fine and doesn’t return 503 status codes every time anymore. If not, here is an additional step that works for me :
(Optional) Go to the « General » tab and select « Always » in the « Clear Application Data » section. Apply the changes and relaunch your debug configuration.
That’s all, I hope that worked for you 😊 !