{"record":{"id":"71bf67f33628d73c","repo":"alibaba/nacos","slug":"500-71bf67","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/roles/NacosRoleServiceRemoteImpl.java","lineNumber":87,"sourceCode":"            throw new NacosRuntimeException(NacosException.SERVER_ERROR,\n                unpectedException.getMessage());\n        }\n    }\n    \n    @Override\n    public void deletePermission(String role, String resource, String action) {\n        Query query = Query.newInstance().addParam(\"role\", role).addParam(\"resource\", resource)\n            .addParam(\"action\", action);\n        try {\n            HttpRestResult<String> result = nacosRestTemplate.delete(\n                buildRemotePermissionUrlPath(AuthConstants.PERMISSION_PATH),\n                RemoteServerUtil.buildServerRemoteHeader(), query, String.class);\n            RemoteServerUtil.singleCheckResult(result);\n            invalidateRolePermissions(role);\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 List<PermissionInfo> getPermissions(String role) {\n        List<PermissionInfo> cached = getCachedPermissionInfoMap().get(role);\n        if (cached != null) {\n            return cached;\n        }\n        reload();\n        return getCachedPermissionInfoMap().get(role);\n    }\n    \n    @Override\n    public Page<PermissionInfo> getPermissions(String role, int pageNo, int pageSize) {\n        Query query = Query.newInstance().addParam(\"role\", role).addParam(\"pageNo\", pageNo)\n            .addParam(\"pageSize\", pageSize).addParam(\"search\", \"accurate\");","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/roles/NacosRoleServiceRemoteImpl.java#L69-L105","documentation":"Thrown by deletePermission's remote path when an unexpected (non-Nacos) exception occurs while calling nacosRestTemplate.delete or parsing the response. It is wrapped as a NacosRuntimeException with code NacosException.SERVER_ERROR (500) and the underlying exception's message. Typical root causes are network/IO failures, connection timeouts, or JSON deserialization errors rather than an application-level rejection.","triggerScenarios":"The target Nacos server node is unreachable, the HTTP connection times out or is reset, the response body is malformed (cannot be parsed), or an SSL/TLS handshake fails during the forwarded DELETE.","commonSituations":"cluster.conf lists a dead/unreachable node; network partition between console and server nodes; firewall dropping the inter-node port; expired/mismatched TLS certs; node temporarily down for restart.","solutions":["Check cluster.conf and ensure all listed server addresses are reachable from the console node.","Inspect the wrapped exception's message/class for IO vs SSL vs parse errors.","Restart or restore the unreachable node, then retry the delete.","Verify inter-node network/firewall allows the server HTTP port."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    roleService.deletePermission(role, resource, action);\n} catch (NacosRuntimeException e) {\n    if (e.getCode() == NacosException.SERVER_ERROR) {\n        // transport/IO failure; retry against a healthy node after backoff\n        retryWithBackoff(() -> roleService.deletePermission(role, resource, action));\n    } else {\n        throw e;\n    }\n}","preventionTips":["Keep cluster.conf accurate: remove dead nodes.","Ensure inter-node network/firewall permits the server HTTP port.","Retry transient 500s with bounded backoff; surface persistent ones."],"tags":["auth","permission","remote","network","io","cluster"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}