{"record":{"id":"0448fc818176b686","repo":"SonarSource/sonarqube","slug":"configuration-error-property-definition-named-s","errorCode":null,"errorMessage":"Configuration error: property definition named '%s' found in multiple extensions.","messagePattern":"Configuration error: property definition named '(.+?)' found in multiple extensions\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"server/sonar-process/src/main/java/org/sonar/process/ProcessProperties.java","lineNumber":281,"sourceCode":"    }\n  }\n\n  private Properties defaults() {\n    Properties defaults = new Properties();\n    defaults.putAll(Arrays.stream(Property.values())\n      .filter(Property::hasDefaultValue)\n      .collect(Collectors.toMap(Property::getKey, Property::getDefaultValue)));\n    defaults.putAll(loadDefaultsFromExtensions());\n    return defaults;\n  }\n\n  private Map<String, String> loadDefaultsFromExtensions() {\n    Map<String, String> propertyDefaults = new HashMap<>();\n    Set<CoreExtension> extensions = serviceLoaderWrapper.load();\n    for (CoreExtension ext : extensions) {\n      for (Map.Entry<String, String> property : ext.getExtensionProperties().entrySet()) {\n        if (propertyDefaults.put(property.getKey(), property.getValue()) != null) {\n          throw new IllegalStateException(format(\"Configuration error: property definition named '%s' found in multiple extensions.\",\n            property.getKey()));\n        }\n      }\n    }\n\n    return propertyDefaults;\n  }\n\n  private static void fixPortIfZero(Props props, String addressPropertyKey, String portPropertyKey) {\n    String port = props.value(portPropertyKey);\n    if (\"0\".equals(port)) {\n      String address = props.nonNullValue(addressPropertyKey);\n      int allocatedPort = NetworkUtilsImpl.INSTANCE.getNextAvailablePort(address)\n        .orElseThrow(() -> new IllegalStateException(\"Cannot resolve address [\" + address + \"] set by property [\" + addressPropertyKey + \"]\"));\n      props.set(portPropertyKey, String.valueOf(allocatedPort));\n    }\n  }\n","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-process/src/main/java/org/sonar/process/ProcessProperties.java#L263-L299","documentation":"loadDefaultsFromExtensions collects default property values contributed by CoreExtension plugins via the service loader. If two extensions define the same property key, the configuration is ambiguous, so an IllegalStateException is thrown to fail fast at startup.","triggerScenarios":"Installing two core extensions (plugins) whose getExtensionProperties() maps contain the same property key; the defaults() call during process bootstrap then detects the conflict.","commonSituations":"Deploying duplicate or overlapping plugin jars in the extensions directory; two forks of the same plugin both installed; a plugin update bundling properties another plugin already defines.","solutions":["List the extensions directory and remove the duplicate/conflicting plugin jar.","Identify which property key conflicts from the message and uninstall or upgrade one of the extensions defining it.","If the conflict is intentional, merge the property definitions into a single extension or rename the key."],"exampleFix":"// before\nextensions/  my-plugin-1.0.jar  my-plugin-1.1.jar  // both define sonar.my.prop\n// after\nextensions/  my-plugin-1.1.jar  // only one version installed","handlingStrategy":"validation","validationCode":"Map<String, String> seen = new HashMap<>();\nfor (CoreExtension ext : serviceLoaderWrapper.load()) {\n  for (String key : ext.getExtensionProperties().keySet()) {\n    if (seen.containsKey(key)) throw new IllegalStateException(\"Duplicate property \" + key + \" in \" + seen.get(key) + \" and \" + ext);\n    seen.put(key, ext.getClass().getName());\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  props.completeDefaultsFromExtensions();\n} catch (IllegalStateException e) {\n  logger.error(\"Extension property conflict: {}\", e.getMessage());\n  System.exit(1);\n}","preventionTips":["Install exactly one jar per plugin; never keep multiple versions in the extensions directory.","Namespace extension property keys with the plugin prefix to avoid collisions.","Run a startup dry-run in CI with the same extension set as production."],"tags":["configuration","plugins","duplicate-property"],"backgroundTag":"conflicting-config-options","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}