flowable/flowable-engine · error · FlowableObjectNotFoundException
Could not find a deployment with id '${deploymentId}'.
Error message
Could not find a deployment with id '${deploymentId}'. What it means
FlowableObjectNotFoundException thrown by getDeploymentResource when the deployment identified by deploymentId does not exist (query returns null). Note this variant omits the resource class in the constructor. Mapped to HTTP 404 by the REST exception handler.
Source
Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/DeploymentResourceResource.java:79
* @ApiImplicitParam(name = "resourceId", dataType = "string", value =
* "The id of the resource to get. Make sure you URL-encode the resourceId in case it contains forward slashes. Eg: use diagrams%2Fmy-process.bpmn20.xml instead of diagrams/Fmy-process.bpmn20.xml."
* , paramType = "path") })
*/
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Indicates both deployment and resource have been found and the resource has been returned."),
@ApiResponse(code = 404, message = "Indicates the requested deployment was not found or there is no resource with the given id present in the deployment. The status-description contains additional information.")
})
@GetMapping(value = "/repository/deployments/{deploymentId}/resources/**", produces = "application/json")
public DeploymentResourceResponse getDeploymentResource(@ApiParam(name = "deploymentId") @PathVariable("deploymentId") String deploymentId, HttpServletRequest request) {
// The ** is needed because the name of the resource can actually contain forward slashes.
// For example org/flowable/model.bpmn2. The number of forward slashes is unknown.
// Using ** means that everything should get matched.
// See also https://stackoverflow.com/questions/31421061/how-to-handle-requests-that-includes-forward-slashes/42403361#42403361
// Check if deployment exists
Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
if (deployment == null) {
throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.");
}
if (restApiInterceptor != null) {
restApiInterceptor.accessDeploymentById(deployment);
}
String pathInfo = request.getPathInfo();
String resourceName = pathInfo.replace("/repository/deployments/" + deploymentId + "/resources/", "");
List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);
if (resourceList.contains(resourceName)) {
// Build resource representation
DeploymentResourceResponse response = restResponseFactory.createDeploymentResourceResponse(deploymentId, resourceName, contentTypeResolver.resolveContentType(resourceName));
return response;
} else {
// Resource not found in deploymentView on GitHub (pinned to d6d39ce1c6)
Solutions
- Confirm the deploymentId from GET /repository/deployments before requesting a resource
- URL-encode the resource name when it contains '/' (the endpoint uses ** matching)
- Check that the deployment still exists (not cleaned up) on the target engine
- Verify you are hitting the right REST context path and engine
Example fix
// before GET /repository/deployments/1/resources/my/folder/process.bpmn20.xml // unencoded // after GET /repository/deployments/1/resources/my%2Ffolder%2Fprocess.bpmn20.xml
Defensive patterns
Strategy: validation
Validate before calling
const resources = (await rest.get(`/repository/deployments/${deploymentId}/resources`)).data;
if (!resources.length) throw new Error('Deployment has no resources or does not exist'); Try / catch
try {
await rest.get(`/repository/deployments/${deploymentId}/resources/${encodeURIComponent(name)}`);
} catch (e) {
if (e.response?.status === 404) {
// distinguish: bad deploymentId vs bad resourceName by listing first
}
} Prevention
- URL-encode resource names containing slashes
- Validate the deploymentId against the deployments list before resource calls
- Use the REST context path and engine you deployed to
When it happens
Trigger: GET /repository/deployments/{deploymentId}/resources/{resourceName} where deploymentId does not match any deployment (checked before looking up the resource itself).
Common situations: Resource path containing forward slashes confusing the URL mapping so the wrong segment is captured as deploymentId, stale deployment id, wrong engine/database.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Could not find a deployment with id '${deploymentId}'.
- Could not find a resource with id '${resourceName}' in deplo
- Could not find a resource with id '<resourceName>' in deploy
- Could not find an app deployment with id '<deploymentId>
- Could not find a deployment with id '<deploymentId>'.
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/5010e238aa10fb8f.
Report an issue: GitHub.