{"record":{"id":"16b423d4b121159b","repo":"SonarSource/sonarqube","slug":"invalid-value-for-property-s-s-only-s-are","errorCode":null,"errorMessage":"Invalid value for property %s: [%s], only [%s] are allowed","messagePattern":"Invalid value for property (.+?): \\[(.+?)\\], only \\[(.+?)\\] are allowed","errorType":"validation","errorClass":"MessageException","httpStatus":null,"severity":"error","filePath":"server/sonar-main/src/main/java/org/sonar/application/config/ClusterSettings.java","lineNumber":168,"sourceCode":"        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)) {\n      throw new MessageException(format(\"Invalid value for property %s: [%s], only [%s] are allowed\", CLUSTER_NODE_TYPE.getKey(), nodeTypeValue,\n        Arrays.stream(NodeType.values()).map(NodeType::getValue).collect(joining(\", \"))));\n    }\n    return NodeType.parse(nodeTypeValue);\n  }\n\n  private static String requireValue(Props props, Property property) {\n    String key = property.getKey();\n    String value = props.value(key);\n    String trimmedValue = value == null ? null : value.trim();\n    if (trimmedValue == null || trimmedValue.isEmpty()) {\n      throw new MessageException(format(\"Property %s is mandatory\", key));\n    }\n    return trimmedValue;\n  }\n\n  private static void ensureNoSearchNodeForbiddenSettings(Props props) {\n    List<String> violations = FORBIDDEN_SEARCH_NODE_SETTINGS.stream()\n      .filter(setting -> props.value(setting.getKey()) != null)","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-main/src/main/java/org/sonar/application/config/ClusterSettings.java#L150-L186","documentation":"ClusterSettings.toNodeType reads the mandatory property sonar.cluster.node.type and validates it against the NodeType enum. If the value is not one of the allowed node types (application, search), a MessageException listing the valid values is thrown so the operator knows exactly which values are accepted.","triggerScenarios":"toNodeType is called by nodeType() and shouldStartHazelcast() (both invoked from accept during cluster configuration parsing) whenever props value for CLUSTER_NODE_TYPE fails NodeType.isValid, e.g. sonar.cluster.node.type=worker or mixed case/typo values.","commonSituations":"Setting sonar.cluster.node.type to a made-up role (worker, app, es) or to a value from older SonarQube versions; whitespace/case mistakes are caught here too since NodeType.isValid is case-sensitive on the canonical values.","solutions":["Set sonar.cluster.node.type to exactly 'application' or 'search' in conf/sonar.properties.","Check the error message itself: it lists the currently allowed values joined by commas; use one verbatim.","If you intended a web/ce node, use type 'application'; if an Elasticsearch-only node, use 'search'."],"exampleFix":"// before (conf/sonar.properties)\nsonar.cluster.node.type=worker\n\n// after\nsonar.cluster.node.type=application","handlingStrategy":"validation","validationCode":"// shell: only the canonical values are allowed\ncase \"$SONAR_CLUSTER_NODE_TYPE\" in\n  application|search) ;;\n  *) echo \"sonar.cluster.node.type must be 'application' or 'search'\"; exit 1 ;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use 'application' or 'search' verbatim, lowercase","Copy values from official docs for your exact SonarQube version","Never invent node roles; roles are fixed by the NodeType enum"],"tags":["configuration","cluster","enum","sonarqube"],"backgroundTag":"invalid-enum-value","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"}