{"record":{"id":"5e264322e2e00090","repo":"SonarSource/sonarqube","slug":"address-in-property-s-is-not-a-valid-address-s","errorCode":null,"errorMessage":"Address in property %s is not a valid address: %s","messagePattern":"Address in property (.+?) is not a valid address: (.+?)","errorType":"validation","errorClass":"MessageException","httpStatus":null,"severity":"error","filePath":"server/sonar-main/src/main/java/org/sonar/application/config/ClusterSettings.java","lineNumber":149,"sourceCode":"      .map(String::trim)\n      .map(ClusterSettings::parseHost)\n      .collect(toSet());\n  }\n\n  private Set<AddressAndPort> parseAndCheckHosts(Property property, String value) {\n    Set<AddressAndPort> res = parseHosts(value);\n    checkValidHosts(property, res);\n    return res;\n  }\n\n  private void checkValidHosts(Property property, Set<AddressAndPort> addressAndPorts) {\n    List<String> invalidHosts = addressAndPorts.stream()\n      .map(AddressAndPort::getHost)\n      .filter(t -> !network.toInetAddress(t).isPresent())\n      .sorted()\n      .toList();\n    if (!invalidHosts.isEmpty()) {\n      throw new MessageException(format(\"Address in property %s is not a valid address: %s\",\n        property.getKey(), String.join(\", \", invalidHosts)));\n    }\n  }\n\n  private static AddressAndPort parseHost(String value) {\n    HostAndPort hostAndPort = HostAndPort.fromString(value);\n    return new AddressAndPort(hostAndPort.getHost(), hostAndPort.hasPort() ? hostAndPort.getPort() : null);\n  }\n\n  private AddressAndPort parseAndCheckHost(Property property, String value) {\n    AddressAndPort addressAndPort = parseHost(value);\n    checkValidHosts(property, singleton(addressAndPort));\n    return addressAndPort;\n  }\n\n  public static NodeType toNodeType(Props props) {\n    String nodeTypeValue = requireValue(props, CLUSTER_NODE_TYPE);\n    if (!NodeType.isValid(nodeTypeValue)) {","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-main/src/main/java/org/sonar/application/config/ClusterSettings.java#L131-L167","documentation":"ClusterSettings.parseAndCheckHosts/parseAndCheckHost validate every host value of a cluster host property by resolving it through the Network.toInetAddress. When one or more hosts cannot be resolved to an IP address, all unresolvable hosts are collected, sorted, and reported in a single MessageException naming the property key and the offending host list.","triggerScenarios":"checkValidHosts is called after parsing values of properties such as sonar.cluster.hosts, sonar.cluster.search.hosts, or sonar.cluster.es.hosts; it throws when network.toInetAddress(host) returns empty for any host in the comma-separated list.","commonSituations":"Typo in a hostname in sonar.properties; DNS not resolvable inside a container or Kubernetes pod; using an IP literal format the resolver rejects; referencing a node that was decommissioned.","solutions":["Fix or remove the unresolvable hostnames listed in the message under the given property key in conf/sonar.properties.","Verify DNS resolution inside the node: run a lookup (e.g. getent hosts <host>) from the same container/host SonarQube runs on.","If hosts should be plain IPs, use valid IPv4/IPv6 literals; if Kubernetes, confirm the service/host DNS names match the namespace."],"exampleFix":"// before (conf/sonar.properties)\nsonar.cluster.hosts=node1.internal,node2.internal,note3.internal\n\n// after (typo fixed)\nsonar.cluster.hosts=node1.internal,node2.internal,node3.internal","handlingStrategy":"validation","validationCode":"// shell: resolve every host of the property before startup\nfor h in $(grep '^sonar\\.cluster\\.hosts' conf/sonar.properties | cut -d= -f2 | tr ',' ' '); do\n  getent hosts \"$h\" >/dev/null || echo \"UNRESOLVABLE: $h\"\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve all cluster hostnames from inside the actual container/pod before rollout","Prefer stable DNS service names (Kubernetes headless services) over ad-hoc names","Keep DNS/CoreDNS healthy in the cluster network"],"tags":["network","dns","cluster","configuration"],"backgroundTag":"invalid-url-format","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}