{"record":{"id":"fc6b614a8096e078","repo":"apolloconfig/apollo","slug":"create-or-update-user-operation-is-unsupported","errorCode":null,"errorMessage":"Create or update user operation is unsupported","messagePattern":"Create or update user operation is unsupported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":500,"severity":"error","filePath":"apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/UserController.java","lineNumber":117,"sourceCode":"    if (!consumerRequest && !unifiedPermissionValidator.isSuperAdmin()\n        && (!user.getUsername().equals(userInfoHolder.getUser().getUserId())\n            || user.getEnabled() != USER_ENABLED)) {\n      throw new AccessDeniedException(\"Create or update user operation is forbidden\");\n    }\n\n    CheckResult pwdCheckRes = passwordChecker.checkWeakPassword(user.getPassword());\n    if (!pwdCheckRes.isSuccess()) {\n      throw new BadRequestException(pwdCheckRes.getMessage());\n    }\n\n    if (userService instanceof SpringSecurityUserService) {\n      if (Boolean.TRUE.equals(isCreate)) {\n        ((SpringSecurityUserService) userService).create(user);\n      } else {\n        ((SpringSecurityUserService) userService).update(user);\n      }\n    } else {\n      throw new UnsupportedOperationException(\"Create or update user operation is unsupported\");\n    }\n    return ResponseEntity.ok().build();\n  }\n\n  @Override\n  public ResponseEntity<Void> changeUserEnabled(OpenUserDTO openUserDTO, String operator) {\n    boolean consumerRequest = requireUserManagementMutationPermission(operator);\n    if (!consumerRequest && !unifiedPermissionValidator.isSuperAdmin()) {\n      throw new AccessDeniedException(\"Change user enabled operation is forbidden\");\n    }\n    UserPO user = OpenApiModelConverters.toUserPO(openUserDTO);\n    if (userService instanceof SpringSecurityUserService) {\n      ((SpringSecurityUserService) userService).changeEnabled(user);\n    } else {\n      throw new UnsupportedOperationException(\"change user enabled is unsupported\");\n    }\n    return ResponseEntity.ok().build();\n  }","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/apolloconfig/apollo/blob/d95fc18d112589efc09ddcbe1507047584d55251/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/UserController.java#L99-L135","documentation":"Thrown by createOrUpdateUser when the configured UserService implementation is not SpringSecurityUserService, so Apollo cannot create or update users locally.","triggerScenarios":"Thrown when the configured user service SPI does not support creating or updating users (e.g. LDAP-backed user storage is read-only).","commonSituations":"Apollo is configured with LDAP/SSO user provider; user management is delegated to an external directory.","solutions":["Configure Apollo to use the Spring Security user service (the default built-in user management) if user creation/update must be supported.","If using an external identity provider (e.g., LDAP), manage users in that system instead of through this endpoint."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d95fc18d112589efc09ddcbe1507047584d55251","analyzedAt":"2026-08-14T04:00:05.477Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}