{"record":{"id":"64b5af68aaf31b59","repo":"alibaba/nacos","slug":"500-64b5af","errorCode":"500","errorMessage":"unpectedException.getMessage()","messagePattern":"unpectedException\\.getMessage\\(\\)","errorType":"exception","errorClass":"NacosRuntimeException","httpStatus":null,"severity":"error","filePath":"plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/users/NacosUserServiceRemoteImpl.java","lineNumber":79,"sourceCode":"        if (null == user) {\n            throw new UsernameNotFoundException(String.format(\"User %s not found\", username));\n        }\n        return new NacosUserDetails(user);\n    }\n    \n    @Override\n    public void updateUserPassword(String username, String password) {\n        Query query = Query.newInstance().addParam(\"username\", username);\n        Map<String, String> body = Map.of(\"newPassword\", password);\n        try {\n            HttpRestResult<String> result = nacosRestTemplate.putForm(\n                buildRemoteUserUrlPath(AuthConstants.USER_PATH),\n                RemoteServerUtil.buildServerRemoteHeader(), query, body, String.class);\n            RemoteServerUtil.singleCheckResult(result);\n        } catch (NacosException e) {\n            throw new NacosRuntimeException(e.getErrCode(), e.getErrMsg());\n        } catch (Exception unpectedException) {\n            throw new NacosRuntimeException(NacosException.SERVER_ERROR,\n                unpectedException.getMessage());\n        }\n    }\n    \n    @Override\n    public Page<User> getUsers(int pageNo, int pageSize, String username) {\n        Query query = Query.newInstance().addParam(\"username\", username).addParam(\"pageNo\", pageNo)\n            .addParam(\"pageSize\", pageSize).addParam(\"search\", \"accurate\");\n        return getUserPageFromRemote(query);\n    }\n    \n    @Override\n    public Page<User> findUsers(String username, int pageNo, int pageSize) {\n        Query query = Query.newInstance().addParam(\"username\", username).addParam(\"pageNo\", pageNo)\n            .addParam(\"pageSize\", pageSize).addParam(\"search\", \"blur\");\n        return getUserPageFromRemote(query);\n    }\n    ","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/users/NacosUserServiceRemoteImpl.java#L61-L97","documentation":"The catch-all fallback of updateUserPassword: any non-NacosException thrown during the proxied password update is rewrapped as NacosRuntimeException(500, cause.getMessage()). This usually indicates the HTTP client threw an unexpected runtime exception, or the response could not be processed — for a fire-and-forget update the typical cause is a network/IO runtime fault.","triggerScenarios":"PUT password update fails with a non-NacosException such as an IllegalStateException from the HTTP client, a NullPointerException, or an uncaught IOException that the client exposed as a runtime error.","commonSituations":"Transient network glitch during the update; HTTP client misconfigured (SSL, proxy); peer returned a body that broke the client internals.","solutions":["Read the wrapped message to identify the underlying exception class.","Retry the update once after a short delay for transient network errors.","Verify HTTP client / TLS configuration if SSL-related text appears.","Check the peer is healthy and serving /user."],"exampleFix":"// before\nuserService.updateUserPassword(username, newPassword);\n\n// after\ntry {\n    userService.updateUserPassword(username, newPassword);\n} catch (NacosRuntimeException e) {\n    if (e.getErrCode() == NacosException.SERVER_ERROR) {\n        log.error(\"password update infra failure for {}: {}\", username, e.getMessage(), e);\n    }\n    throw e;\n}","handlingStrategy":"retry","validationCode":"// Pre-flight: confirm a peer is configured for the proxied update.\nif (RemoteServerUtil.getServerAddresses().isEmpty()) {\n    throw new IllegalStateException(\"no peer configured; password update cannot be proxied\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    userService.updateUserPassword(username, newPassword);\n} catch (NacosRuntimeException e) {\n    if (e.getErrCode() == NacosException.SERVER_ERROR) {\n        log.error(\"password update infra failure: {}\", e.getMessage(), e);\n        // optionally retry once on transient network faults\n    }\n    throw e;\n}","preventionTips":["Log the underlying exception text to identify the runtime fault.","Retry once on transient network errors with backoff.","Verify HTTP client/TLS configuration when SSL text appears.","Keep the peer healthy and serving /user."],"tags":["auth","user-management","remote","password","network"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}