{"record":{"id":"1290467ef8b3702b","repo":"apache/shenyu","slug":"e-getmessage-polarisdatachangedinit","errorCode":null,"errorMessage":"e.getMessage()","messagePattern":"e\\.getMessage\\(\\)","errorType":"exception","errorClass":"ShenyuException","httpStatus":null,"severity":"error","filePath":"shenyu-admin-listener/shenyu-admin-listener-polaris/src/main/java/org/apache/shenyu/admin/listener/polaris/PolarisDataChangedInit.java","lineNumber":68,"sourceCode":"        this.configFileService = configFileService;\n    }\n\n    @Override\n    protected boolean notExist() {\n        return Stream.of(PolarisPathConstants.PLUGIN_DATA_FILE_NAME, PolarisPathConstants.AUTH_DATA_ID_FILE_NAME,\n                PolarisPathConstants.META_DATA_FILE_NAME, PolarisPathConstants.PROXY_SELECTOR_FILE_NAME).allMatch(\n                this::dataIdNotExist);\n    }\n\n    private boolean dataIdNotExist(final String pluginDataId) {\n        try {\n            return !configFileService.getConfigFile(\n                    polarisProperties.getNamespace(),\n                    polarisProperties.getFileGroup(),\n                    pluginDataId).hasContent();\n        } catch (PolarisException e) {\n            LOG.error(\"Get data from polaris error.\", e);\n            throw new ShenyuException(e.getMessage());\n        }\n    }\n}\n","sourceCodeStart":50,"sourceCodeEnd":72,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-admin-listener/shenyu-admin-listener-polaris/src/main/java/org/apache/shenyu/admin/listener/polaris/PolarisDataChangedInit.java#L50-L72","documentation":"PolarisDataChangedInit wraps any PolarisException raised while checking whether a plugin config file exists in Polaris (via configFileService.getConfigFile) into a ShenyuException whose message is only the Polaris exception's message. The original stack trace is logged but lost in the rethrown exception. This aborts the initialization that decides whether plugin data must be uploaded to Polaris.","triggerScenarios":"Calling dataIdNotExist (during Polaris data-sync init) when the Polaris cluster is unreachable, the namespace/fileGroup is wrong, authentication fails, or the config-file API errors.","commonSituations":"Misconfigured polaris namespace or file_group in shenyu.admin properties; Polaris server down or network/firewall blocking the port; wrong Polaris address or token after migrating environments.","solutions":["Verify shenyu.admin.polaris properties (address, namespace, file-group) point to a reachable Polaris server","Check connectivity to the Polis cluster (curl/telnet the polaris address and port) and fix network/firewall issues","Inspect the LOG.error output ('Get data from polaris error.') for the real root cause since the rethrown message is truncated","Fix Polaris authentication/token if the wrapped message indicates auth failure"],"exampleFix":"// before\n} catch (PolarisException e) {\n    LOG.error(\"Get data from polaris error.\", e);\n    throw new ShenyuException(e.getMessage());\n}\n// after\n} catch (PolarisException e) {\n    LOG.error(\"Get data from polaris error.\", e);\n    throw new ShenyuException(\"Get data from polaris error: \" + e.getMessage(), e);\n}","handlingStrategy":"try-catch","validationCode":"// before init, verify polaris reachability and config\nif (polarisProperties.getNamespace() == null || polarisProperties.getFileGroup() == null) {\n    throw new IllegalStateException(\"polaris namespace/fileGroup must be configured\");\n}\n// optionally ping the config API endpoint before enabling polaris sync","typeGuard":null,"tryCatchPattern":"try {\n    init.checkDataIdExists(...);\n} catch (ShenyuException e) {\n    LOG.error(\"Polaris init failed, check cluster reachability/config: {}\", e.getMessage(), e);\n    // fall back or retry with backoff\n}","preventionTips":["Validate polaris address/namespace/file-group in startup config checks","Monitor Polaris cluster health before deploying admin changes","Keep the full cause chain when wrapping Polaris exceptions"],"tags":["polaris","config-sync","configuration","network"],"backgroundTag":"api-error-response","analyzedSha":"567142e07261b3e615ae8850b30f4421f455cc5d","analyzedAt":"2026-09-12T10:08:21.293Z","contentChangedAt":"2026-09-12T10:08:21.293Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}