{"record":{"id":"ab6646d014e31e5a","repo":"flowable/flowable-engine","slug":"id-cannot-be-null-ab6646","errorCode":null,"errorMessage":"Id cannot be null.","messagePattern":"Id cannot be null\\.","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/identity/GroupCollectionResource.java","lineNumber":124,"sourceCode":"        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessGroupInfoWithQuery(query);\n        }\n\n        return paginateList(allRequestParams, query, \"id\", properties, restResponseFactory::createGroupResponseList);\n    }\n\n    @ApiOperation(value = \"Create a group\", tags = { \"Groups\" }, code = 201)\n    @ApiResponses(value = {\n            @ApiResponse(code = 201, message = \"Indicates the group was created.\"),\n            @ApiResponse(code = 400, message = \"Indicates the id of the group was missing.\")\n    })\n    @PostMapping(value = \"/identity/groups\", produces = \"application/json\")\n    @ResponseStatus(HttpStatus.CREATED)\n    public GroupResponse createGroup(@RequestBody GroupRequest groupRequest) {\n        if (groupRequest.getId() == null) {\n            throw new FlowableIllegalArgumentException(\"Id cannot be null.\");\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.createGroup(groupRequest);\n        }\n\n        // Check if a user with the given ID already exists so we return a CONFLICT\n        if (identityService.createGroupQuery().groupId(groupRequest.getId()).count() > 0) {\n            throw new FlowableConflictException(\"A group with id '\" + groupRequest.getId() + \"' already exists.\");\n        }\n\n        Group created = identityService.newGroup(groupRequest.getId());\n        created.setId(groupRequest.getId());\n        created.setName(groupRequest.getName());\n        created.setType(groupRequest.getType());\n        identityService.saveGroup(created);\n\n        return restResponseFactory.createGroupResponse(created);","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/identity/GroupCollectionResource.java#L106-L142","documentation":"GroupCollectionResource.createGroup validates the request body before creating a group. If GroupRequest.id is null, it throws FlowableIllegalArgumentException because a Flowable group requires a caller-supplied id (unlike users in some setups, group creation does not generate one).","triggerScenarios":"POST /identity/groups with a JSON body missing the \"id\" field (or explicitly setting it to null), e.g. {\"name\":\"Sales\",\"type\":\"security-group\"}.","commonSituations":"Client DTO omits id because another REST API auto-generates ids; JSON field name mismatch (groupId vs id) causing null deserialization; programmatically built request where only name/type were set.","solutions":["Include a non-null \"id\" field in the POST /identity/groups JSON body.","Fix client-side field naming so the id property actually serializes (check for groupId/id mismatch).","Validate the request object on the client before sending."],"exampleFix":"// before\nPOST /identity/groups {\"name\":\"Sales\",\"type\":\"security-group\"}\n// after\nPOST /identity/groups {\"id\":\"sales\",\"name\":\"Sales\",\"type\":\"security-group\"}","handlingStrategy":"validation","validationCode":"if (groupRequest.getId() == null || groupRequest.getId().isBlank()) {\n    throw new IllegalArgumentException(\"Group id is required before POST /identity/groups\");\n}","typeGuard":"boolean hasId(GroupRequest r) { return r != null && r.getId() != null && !r.getId().isEmpty(); }","tryCatchPattern":null,"preventionTips":["Always set id, name and type in group creation payloads.","Check JSON property names match the REST contract (\"id\").","Validate request DTOs before serialization."],"tags":["rest-api","validation","group","bad-request"],"backgroundTag":"missing-required-argument","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"}