Mule 4 : 503 Service Unavailable when working locally

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.

The problem

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.

The solution

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 :

  1. Go to your « Debug configurations » 11.png
  2. Select the « Arguments » tab
  3. Add the following argument in the « VM arguments » text area
    -Danypoint.platform.gatekeeper=disabled
    
    2.png Note : If there was any arguments previously set, append this next to them.
  4. 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 :

  5. (Optional) Go to the « General » tab and select « Always » in the « Clear Application Data » section. Apply the changes and relaunch your debug configuration. 3.png

That’s all, I hope that worked for you 😊 !