MuleSoft · HTTP Connector
HTTP:NOT_FOUND
HTTP:NOT_FOUND means the HTTP Request operation received a 404 response because the server could not find the requested resource. Check the URL shown in the error description, then correct the request or handle the error type in an error handler.
VerifiedLast verified
01Error text
HTTP GET on resource 'http://jsonplaceholder.typicode.com:80/mybadrequest' failed: not found (404).
Error type: HTTP:NOT_FOUND02Likely causes
- The server could not find a resource at the URL the HTTP Request operation called. The example in the Mule documentation requests a path that does not exist.
- By default, HTTP Connector raises an error for any response with a status code of 400 or above, so a 404 that you treat as a normal answer still fails the flow.
03How to fix it
- Read
error.description. It names the HTTP method and the full URL that was called, so you can see which resource was missing. - Correct the host, base path, path or URI parameters on the HTTP Request operation or its configuration so the URL points to a resource that exists.
- Turn on HTTP wire logging to see the exact request and response: in
log4j2.xml, enable the loggerorg.mule.service.http.impl.service.HttpMessageLoggeratDEBUGlevel. - If a missing resource is an expected outcome, add an On Error Continue or On Error Propagate handler with the type
HTTP:NOT_FOUND. - Or set a response validator on the request so that 404 counts as success, for example
<http:success-status-code-validator values="200,404" />.
iNotes
The error text above is the example from the Mule documentation. In your logs the method and URL are your own.
04Official documentation
→Related errors
- HTTP:BAD_REQUESTHTTP:BAD_REQUEST means the server could not understand the request the HTTP Request operation sent because its syntax was invalid (HTTP 400). Log the outgoing request, compare it with what the server expects, and correct the body, headers or parameters.
- HTTP:UNAUTHORIZEDHTTP:UNAUTHORIZED means the server rejected the HTTP Request operation because authentication failed or was not provided (HTTP 401). Send the credentials the server expects, and handle the error type if a rejected call is something the flow should survive.
- APIKIT:NOT_FOUNDAPIKIT:NOT_FOUND is the APIkit for REST error type that maps to HTTP status 404 with the response message "Resource not found". APIkit validates incoming requests against your RAML or OAS API specification, so compare the failing request with the specification.
Test every fix in a non-production environment before you apply it to production. See how entries are verified.
More for MuleSoft work:Open MuleSoft jobsMuleSoft rates and salariesHire a senior MuleSoft developer