{"record":{"id":"350d6d2075bb4152","repo":"flowable/flowable-engine","slug":"could-not-find-a-user-with-id","errorCode":null,"errorMessage":"Could not find a user with id ''.","messagePattern":"Could not find a user with id ''\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/identity/BaseUserResource.java","lineNumber":41,"sourceCode":"/**\n * @author Frederik Heremans\n */\npublic class BaseUserResource {\n\n    @Autowired\n    protected RestResponseFactory restResponseFactory;\n\n    @Autowired\n    protected IdentityService identityService;\n    \n    @Autowired(required=false)\n    protected BpmnRestApiInterceptor restApiInterceptor;\n\n    protected User getUserFromRequest(String userId) {\n        User user = identityService.createUserQuery().userId(userId).singleResult();\n\n        if (user == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a user with id '\" + userId + \"'.\", User.class);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessUserInfoById(user);\n        }\n        \n        return user;\n    }\n}\n","sourceCodeStart":23,"sourceCodeEnd":51,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/identity/BaseUserResource.java#L23-L51","documentation":"BaseUserResource.getUserFromRequest looks up a user by id via identityService.createUserQuery().userId(userId) and throws FlowableObjectNotFoundException when the query returns null. It backs all user REST endpoints (GET/PUT/DELETE /identity/users/{userId}).","triggerScenarios":"GET, PUT or DELETE /identity/users/{userId} where userId does not match any row in ACT_ID_USER.","commonSituations":"User removed or renamed after the client cached the id; external identity store (LDAP/AD) users not synced into Flowable's ACT_ID_USER table; email used as id instead of the actual userId; typo in the path segment.","solutions":["Confirm the user exists: SELECT * FROM ACT_ID_USER WHERE ID_ = '<userId>' or GET /identity/users to list ids.","Use the exact stored userId, not the email or display name, unless the userId actually is the email.","If identity is managed externally, verify user synchronization into Flowable's identity tables.","Return a 404 to the end user and prompt re-selection rather than retrying with a stale id."],"exampleFix":"// before\nclient.get(\"/identity/users/jdoe@example.com\");\n// after: use the actual stored userId\nUser u = identityService.createUserQuery().userId(\"jdoe\").singleResult();\nif (u != null) client.get(\"/identity/users/\" + u.getId());","handlingStrategy":"try-catch","validationCode":"boolean exists = client.list(\"/identity/users\").stream().anyMatch(u -> userId.equals(u.getId()));","typeGuard":null,"tryCatchPattern":"try {\n    client.get(\"/identity/users/\" + userId);\n} catch (HttpClientErrorException e) {\n    if (e.getStatusCode() == HttpStatus.NOT_FOUND) {\n        log.warn(\"User {} not found in Flowable identity tables\", userId);\n    } else throw e;\n}","preventionTips":["Use the stored userId, never email/display name as a substitute.","Refresh cached user ids after user administration changes.","Confirm user synchronization when identity comes from LDAP/AD."],"tags":["rest-api","identity","user","not-found"],"backgroundTag":"user-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}