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 (Deployment.class) thrown by getDeploymentResources when no deployment exists for the given deploymentId; the endpoint lists a deployment's resources and first verifies the deployment exists. Results in an HTTP 404 response.

Source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/DeploymentResourceCollectionResource.java:66

    @Autowired
    protected RepositoryService repositoryService;
    
    @Autowired(required=false)
    protected BpmnRestApiInterceptor restApiInterceptor;

    @ApiOperation(value = "List resources in a deployment", tags = { "Deployment" }, nickname="listDeploymentResources",
            notes = "The dataUrl property in the resulting JSON for a single resource contains the actual URL to use for retrieving the binary resource.")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Indicates the deployment was found and the resource list has been returned."),
            @ApiResponse(code = 404, message = "Indicates the requested deployment was not found.")
    })
    @GetMapping(value = "/repository/deployments/{deploymentId}/resources", produces = "application/json")
    public List<DeploymentResourceResponse> getDeploymentResources(@ApiParam(name = "deploymentId") @PathVariable String deploymentId) {
        // 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 + "'.", Deployment.class);
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessDeploymentById(deployment);
        }

        List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);

        return restResponseFactory.createDeploymentResourceResponseList(deploymentId, resourceList, contentTypeResolver);
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Call GET /repository/deployments to list valid ids and use one from the response
  2. Verify the id is complete and unmodified when copying between tools
  3. Point the client at the correct Flowable instance/database that holds the deployment
  4. Handle 404 gracefully in clients that poll after a deployment cleanup

Example fix

// before
GET /repository/deployments/abc/resources  // 'abc' is not a deployment id
// after
GET /repository/deployments  -> pick .data[0].id
GET /repository/deployments/2501/resources
Defensive patterns

Strategy: validation

Validate before calling

const ids = (await rest.get('/repository/deployments')).data.data.map(d => d.id);
if (!ids.includes(deploymentId)) throw new Error(`Unknown deployment id ${deploymentId}`);

Try / catch

try {
    await rest.get(`/repository/deployments/${deploymentId}/resources`);
} catch (e) {
    if (e.response?.status === 404) {
        // refresh deployment list and pick a valid id
    }
}

Prevention

When it happens

Trigger: GET /repository/deployments/{deploymentId}/resources with an unknown deploymentId.

Common situations: Truncated/copy-pasted id, id from a different engine instance, deployment removed between listing and fetching resources, tooling storing names instead of ids.

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/069b2ac99d1d2e10. Report an issue: GitHub.