{"record":{"id":"3804047faff17a5d","repo":"flowable/flowable-engine","slug":"the-value-cannot-be-null-380404","errorCode":null,"errorMessage":"The value cannot be null.","messagePattern":"The value cannot be null\\.","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/identity/UserInfoResource.java","lineNumber":81,"sourceCode":"        }\n\n        return restResponseFactory.createUserInfoResponse(key, existingValue, user.getId());\n    }\n\n    @ApiOperation(value = \"Update a user’s info\", tags = { \"Users\" }, nickname = \"updateUserInfo\")\n    @ApiResponses(value = {\n            @ApiResponse(code = 200, message = \"Indicates the user was found and the info has been updated.\"),\n            @ApiResponse(code = 400, message = \"Indicates the value was missing from the request body.\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested user was not found or the user does not have info for the given key. Status description contains additional information about the error.\")\n    })\n    @PutMapping(value = \"/identity/users/{userId}/info/{key}\", produces = \"application/json\")\n    public UserInfoResponse setUserInfo(@ApiParam(name = \"userId\") @PathVariable(\"userId\") String userId, @ApiParam(name = \"key\") @PathVariable(\"key\") String key, @RequestBody UserInfoRequest userRequest) {\n\n        User user = getUserFromRequest(userId);\n        String validKey = getValidKeyFromRequest(user, key);\n\n        if (userRequest.getValue() == null) {\n            throw new FlowableIllegalArgumentException(\"The value cannot be null.\");\n        }\n\n        if (userRequest.getKey() == null || validKey.equals(userRequest.getKey())) {\n            identityService.setUserInfo(user.getId(), key, userRequest.getValue());\n        } else {\n            throw new FlowableIllegalArgumentException(\"Key provided in request body does not match the key in the resource URL.\");\n        }\n\n        return restResponseFactory.createUserInfoResponse(key, userRequest.getValue(), user.getId());\n    }\n\n    @ApiOperation(value = \"Delete a user’s info\", tags = { \"Users\" }, code = 204)\n    @ApiResponses(value = {\n            @ApiResponse(code = 204, message = \"Indicates the user was found and the info for the given key has been deleted. Response body is left empty intentionally.\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested user was not found or the user does not have info for the given key. Status description contains additional information about the error.\")\n    })\n    @DeleteMapping(\"/identity/users/{userId}/info/{key}\")\n    @ResponseStatus(HttpStatus.NO_CONTENT)","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/identity/UserInfoResource.java#L63-L99","documentation":"FlowableIllegalArgumentException thrown by the REST endpoint PUT /identity/users/{userId}/info/{key} when the JSON request body has no 'value' field (or it is JSON null). The library requires a non-null value before it will store a user info entry via IdentityService.setUserInfo. It is a client-side request validation error, not an internal fault.","triggerScenarios":"Calling setUserInfo (PUT identity/users/{userId}/info/{key}) with a body like {} or {\"key\":\"k\"} where userRequest.getValue() == null. Also triggered by sending the wrong JSON field name (e.g. \"val\" instead of \"value\") so the deserialized value stays null.","commonSituations":"Typo'd or missing 'value' property in the request JSON; sending form-encoded data instead of JSON; Content-Type not application/json so the body fails to bind; scripting a bulk user-info import where some records have empty values.","solutions":["Include a non-null \"value\" field in the JSON body, e.g. {\"value\":\"jdoe@example.com\"}.","Verify the request Content-Type is application/json and the field is named exactly \"value\".","If the intent is to remove the info entry, use the DELETE /identity/users/{userId}/info/{key} endpoint instead of PUT with a null value.","Validate the body client-side before sending and return a 400 with a clear message."],"exampleFix":"// before\nPUT /flowable-rest/identity/users/jdoe/info/email\n{}\n\n// after\nPUT /flowable-rest/identity/users/jdoe/info/email\n{\"value\":\"jdoe@example.com\"}","handlingStrategy":"validation","validationCode":"const body = { key: 'email', value: 'jdoe@example.com' };\nif (body.value == null) {\n  throw new Error('PUT user info requires a non-null \"value\" field');\n}\nawait fetch(`/identity/users/${userId}/info/${body.key}`, {\n  method: 'PUT',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify(body)\n});","typeGuard":"function hasValue(body) {\n  return body != null && typeof body === 'object' && body.value !== undefined && body.value !== null;\n}","tryCatchPattern":"try {\n  const res = await fetch(url, opts);\n  if (res.status === 400) {\n    const msg = await res.text();\n    if (msg.includes('The value cannot be null')) { /* fix body: add value */ }\n  }\n} catch (e) { /* network error, not this case */ }","preventionTips":["Always include a non-null \"value\" in the PUT user-info body.","Use Content-Type application/json so Spring binds the UserInfoRequest correctly.","To remove an info entry, call DELETE instead of PUT with null.","Validate request bodies in your client/API layer before hitting Flowable REST."],"tags":["rest","validation","null-value","flowable"],"backgroundTag":"null-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"}