{"record":{"id":"1da7ceb9a01bd5a3","repo":"pinpoint-apm/pinpoint","slug":"user-information-validation-failed-to-creating-use","errorCode":null,"errorMessage":"User information validation failed to creating user information.","messagePattern":"User information validation failed to creating user information\\.","errorType":"http","errorClass":"ResponseStatusException","httpStatus":400,"severity":"error","filePath":"web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/UserController.java","lineNumber":64,"sourceCode":"@RestController\n@RequestMapping(\"/api/user\")\n@Validated\npublic class UserController {\n    private final Logger logger = LogManager.getLogger(this.getClass());\n\n    public final static String USER_ID = \"userid\";\n\n    private final UserService userService;\n\n    public UserController(UserService userService) {\n        this.userService = Objects.requireNonNull(userService, \"userService\");\n    }\n\n    @PreAuthorize(\"hasPermission(null, null, T(com.navercorp.pinpoint.web.security.PermissionChecker).PERMISSION_ADMINISTRATION_EDIT_USER)\")\n    @PostMapping\n    public Response insertUser(@RequestBody User user) {\n        if (!ValueValidator.validateUser(user)) {\n            throw new ResponseStatusException(\n                    HttpStatus.BAD_REQUEST,\n                    \"User information validation failed to creating user information.\"\n            );\n        }\n        userService.insertUser(user);\n        return SimpleResponse.ok();\n    }\n\n    @PreAuthorize(\"hasPermission(null, null, T(com.navercorp.pinpoint.web.security.PermissionChecker).PERMISSION_ADMINISTRATION_EDIT_USER)\")\n    @DeleteMapping\n    public Response deleteUser(@RequestBody User user) {\n        if (StringUtils.isEmpty(user.getUserId())) {\n            throw new ResponseStatusException(\n                    HttpStatus.BAD_REQUEST,\n                    \"there is not userId in params to delete user\"\n            );\n        }\n        userService.deleteUser(user.getUserId());","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/UserController.java#L46-L82","documentation":"Pinpoint's UserController rejects a POST /user request when the submitted User object fails ValueValidator.validateUser, throwing a 400 ResponseStatusException. The validator enforces required/shape rules (e.g. valid userId, name, etc.) before any user record is created. No user is inserted when this fires.","triggerScenarios":"POST /user (admin-only endpoint) with a JSON body missing or containing invalid User fields (e.g. blank userId, malformed name/email/phone/department) so ValueValidator.validateUser returns false.","commonSituations":"Hand-crafted admin scripts or curl calls omitting required fields; UI forms submitted with empty userId; API upgrades where User field rules changed; automation posting users with null instead of empty strings.","solutions":["Check the User JSON body includes all required fields (at minimum a non-empty userId) and no invalid values","Compare your payload against ValueValidator.validateUser rules in web/src/main/java/com/navercorp/pinpoint/web/util and fix the offending field","Ensure the request Content-Type is application/json and the body parses into a User object (a mismatched body can leave fields null)","Call GET /user to confirm the user doesn't already exist in a conflicting state"],"exampleFix":"// before\ncurl -X POST /user -d '{\"name\":\"alice\"}'\n// after\ncurl -X POST /user -H 'Content-Type: application/json' -d '{\"userId\":\"alice\",\"name\":\"Alice\",\"department\":\"dev\"}'","handlingStrategy":"validation","validationCode":"// Java/JS check before POST /user\nfunction isValidUser(u) {\n  return !!u && typeof u.userId === 'string' && u.userId.length > 0 &&\n         typeof u.name === 'string' && u.name.length > 0;\n}\nif (!isValidUser(payload)) throw new Error('User validation failed client-side');","typeGuard":"function isUser(u) {\n  return typeof u === 'object' && u !== null && typeof u.userId === 'string';\n}","tryCatchPattern":"try {\n  await axios.post('/user', payload);\n} catch (e) {\n  if (e.response && e.response.status === 400) {\n    console.error('User validation failed:', e.response.data);\n  }\n  throw e;\n}","preventionTips":["Validate required User fields (userId, name) against ValueValidator rules before calling the API","Use a typed client/DTO so missing fields are caught at compile time","Send Content-Type: application/json","Check for existing users via GET /user before creating"],"tags":["http-400","validation","rest-api","user-management"],"backgroundTag":"schema-validation-failed","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}