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

Thrown by AppDeploymentResourceCollectionResource.getDeploymentResources when no deployment with the given deploymentId exists — here checked against the generic repositoryService deployment query — before listing its resources. Flowable raises FlowableObjectNotFoundException typed with AppDeployment.class.

Source

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

    @Autowired
    protected AppRepositoryService repositoryService;
    
    @Autowired(required=false)
    protected AppRestApiInterceptor restApiInterceptor;

    @ApiOperation(value = "List resources in a deployment", tags = { "App Deployments" }, 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 = "/app-repository/deployments/{deploymentId}/resources", produces = "application/json")
    public List<AppDeploymentResourceResponse> getDeploymentResources(@ApiParam(name = "deploymentId") @PathVariable String deploymentId) {
        // Check if deployment exists
        AppDeployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
        if (deployment == null) {
            throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", AppDeployment.class);
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessDeploymentById(deployment);
        }

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

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

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Fetch valid deployment ids via GET /app-repository/deployments first.
  2. Verify the REST module's datasource matches where the app was deployed.
  3. Handle FlowableObjectNotFoundException as HTTP 404 in clients.
  4. Note the existence check uses repositoryService, not appRepositoryService — a deployment visible to the app engine but not the shared repository also triggers this; check schema/engine config.

Example fix

// before
List<ResourceResponse> res = restTemplate.getForObject(
  "/app-repository/deployments/" + id + "/resources", List.class);
// after
ResponseEntity<List<ResourceResponse>> resp =
  restTemplate.getForEntity("/app-repository/deployments/" + id + "/resources", List.class);
if (resp.getStatusCode() == HttpStatus.NOT_FOUND) { /* unknown deployment id */ }
Defensive patterns

Strategy: validation

Validate before calling

// Verify deployment id is known before listing resources
try {
    restTemplate.getForObject("/app-repository/deployments/" + id, AppDeploymentResponse.class);
} catch (HttpClientErrorException.NotFound e) {
    throw new IllegalArgumentException("Unknown app deployment: " + id);
}

Try / catch

try {
    return restTemplate.getForObject(url + "/resources", List.class);
} catch (HttpClientErrorException.NotFound e) {
    logger.warn("No deployment {} in this repository", id);
    return Collections.emptyList();
}

Prevention

When it happens

Trigger: GET /app-repository/deployments/{deploymentId}/resources where the deployment does not exist in the queried repository (never existed, deleted, or different database/engine).

Common situations: Wrong base URL family (app-repository vs repository ids); stale ids after deployment cleanup; multi-environment misconfiguration pointing REST at a fresh empty DB.

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/5833713890a12312. Report an issue: GitHub.