{"record":{"id":"9eef7d2126859b9f","repo":"apache/shenyu","slug":"zookeeper-url-zookeeperurl-is-is-error","errorCode":null,"errorMessage":"zookeeper url:${zookeeperUrl} is is error.","messagePattern":"zookeeper url:(.+?) is is error\\.","errorType":"validation","errorClass":"ShenyuException","httpStatus":null,"severity":"error","filePath":"shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/reconciler/IngressReconciler.java","lineNumber":334,"sourceCode":"                List<V1EndpointSubset> subsets = v1Endpoints.getSubsets();\n                if (Objects.isNull(subsets) || CollectionUtils.isEmpty(subsets)) {\n                    LOG.info(\"Endpoints do not have subsets\");\n                } else {\n                    for (V1EndpointSubset subset : subsets) {\n                        List<V1EndpointAddress> addresses = subset.getAddresses();\n                        if (Objects.isNull(addresses) || addresses.isEmpty()) {\n                            continue;\n                        }\n                        for (V1EndpointAddress address : addresses) {\n                            zookeeperUrl = address.getIp();\n                        }\n                    }\n                }\n            }\n        }\n        if (!isCompleteHost(zookeeperUrl)) {\n            LOG.info(\"Please enter the correct zookeeperUrl address\");\n            throw new ShenyuException(\"zookeeper url:\" + zookeeperUrl + \" is is error.\");\n        }\n        zookeeperUrl = replaceZookeeperHost(zookeeperK8sUrl, zookeeperUrl);\n        return zookeeperUrl;\n    }\n\n    /**\n     * Check whether the IngressClass is shenyu, check the annotation first.\n     *\n     * @param v1Ingress v1Ingress\n     * @return boolean\n     */\n    private boolean checkIngressClass(final V1Ingress v1Ingress) {\n        if (Objects.nonNull(v1Ingress.getMetadata())) {\n            Map<String, String> annotations = v1Ingress.getMetadata().getAnnotations();\n            if (Objects.nonNull(annotations)\n                    && Objects.nonNull(annotations.get(IngressConstants.K8S_INGRESS_CLASS_ANNOTATION_KEY))) {\n                return IngressConstants.SHENYU_INGRESS_CLASS.equals(annotations.get(IngressConstants.K8S_INGRESS_CLASS_ANNOTATION_KEY));\n            } else {","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/reconciler/IngressReconciler.java#L316-L352","documentation":"IngressReconciler.getZookeeperUrl extracts and normalizes the ZooKeeper address from the ShenyuCluster custom resource. Before returning, it validates the host with isCompleteHost; if the URL does not have a complete host it throws ShenyuException('zookeeper url:... is is error.'). The awkward double 'is' is just the message text.","triggerScenarios":"A ShenyuCluster spec (zookeeperK8sUrl) whose zookeeper address fails the isCompleteHost check — missing host, missing port, or malformed address — passed through getZookeeperUrl via zookeeperUrl.","commonSituations":"Typo in the ShenyuCluster CR spec, using a k8s service short name where a full host:port is expected, copying a 'zk-0.zk-headless:2181' style URL where validation expects a fully qualified host.","solutions":["Fix the zookeeper url in the ShenyuCluster custom resource to a complete host:port, e.g. 'zookeeper-client:2181' or '10.0.0.5:2181'","Check the controller log line 'Please enter the correct zookeeperUrl address' and the echoed url value","Compare with the format other working ShenyuCluster resources use","kubectl edit the ShenyuCluster resource and correct the spec field"],"exampleFix":"// before (ShenyuCluster spec)\nzookeeperK8sUrl: zk:2181\n// after\nzookeeperK8sUrl: zookeeper-client.default.svc.cluster.local:2181","handlingStrategy":"validation","validationCode":"String zkUrl = cluster.getSpec().getZookeeperK8sUrl();\nboolean looksComplete = zkUrl != null && zkUrl.matches(\"^[a-zA-Z0-9.-]+(:\\\\d{1,5})$\");\nif (!looksComplete) throw new IllegalArgumentException(\"fix zookeeperK8sUrl in ShenyuCluster spec\");","typeGuard":null,"tryCatchPattern":"try {\n    reconciler.getZookeeperUrl(...);\n} catch (ShenyuException e) {\n    LOG.error(\"ShenyuCluster spec has invalid zookeeper url: {}\", e.getMessage());\n    // surface the error in the CR status\n}","preventionTips":["Use complete host:port values in the ShenyuCluster spec","Validate CR fields with a webhook before acceptance","Copy URL formats from working ShenyuCluster resources","Prefer fully qualified service DNS names in k8s"],"tags":["kubernetes","zookeeper","url-validation"],"backgroundTag":"invalid-url","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"}