{"record":{"id":"dd7e376897461a36","repo":"quarkusio/quarkus","slug":"unable-to-discover-spring-cloud-config-server-url","errorCode":null,"errorMessage":"Unable to discover Spring Cloud Config Server URL for service '${serviceId}'","messagePattern":"Unable to discover Spring Cloud Config Server URL for service '(.+?)'","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/eureka/DiscoveryService.java","lineNumber":55,"sourceCode":"        log.debug(\"Attempting to discover Spring Cloud Config Server URL for service '\" + serviceId\n                + \"' using the following URLs: \" + serviceUrlMap.values());\n        for (Map.Entry<String, String> entry : serviceUrlMap.entrySet()) {\n            try {\n                return getHomeUrl(entry.getValue(), serviceId);\n            } catch (Exception e) {\n                log.debug(\"Timed out while waiting for Spring Cloud Config Server URL for service '\" + serviceId + \"'\", e);\n            }\n        }\n\n        log.debug(\"Fallback Attempting to discover Spring Cloud Config Server URL for service '\" + serviceId\n                + \"' using the default URL: \" + defaultServiceUrl);\n        try {\n            return getHomeUrl(defaultServiceUrl, serviceId);\n        } catch (Exception e) {\n            log.debug(\"Timed out while waiting for Spring Cloud Config Server URL for service '\" + serviceId + \"'\", e);\n        }\n\n        throw new RuntimeException(\"Unable to discover Spring Cloud Config Server URL for service '\" + serviceId + \"'\");\n    }\n\n    private void validate(SpringCloudConfigClientConfig.DiscoveryConfig discoveryConfig) {\n        if (discoveryConfig.eurekaConfig().isEmpty()) {\n            throw new IllegalArgumentException(\"No Eureka configuration has been provided\");\n        }\n        if (discoveryConfig.eurekaConfig().get().serviceUrl().isEmpty()) {\n            throw new IllegalArgumentException(\"No service URLs have been configured for service\");\n        }\n        if (discoveryConfig.serviceId().isEmpty()) {\n            throw new IllegalArgumentException(\"No service ID has been configured for service\");\n        }\n    }\n\n    private String getHomeUrl(String defaultServiceUrl, String serviceId) {\n        JsonObject instance = eurekaClient.fetchInstances(defaultServiceUrl, serviceId);\n        return instance.getString(\"homePageUrl\");\n    }","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/eureka/DiscoveryService.java#L37-L73","documentation":"DiscoveryService tries to resolve the Spring Cloud Config Server URL via Eureka service discovery. When the lookup (with retries) times out or fails internally, discover() wraps the failure in this RuntimeException. It means Eureka did not yield a usable Config Server URL within the allowed time.","triggerScenarios":"quarkus.spring-cloud-config.enabled=true with discovery enabled, but getHomeUrl(defaultServiceUrl, serviceId) throws/times out: Eureka unreachable, wrong Eureka service URL, Config Server not registered under the configured serviceId, or network timeouts.","commonSituations":"Eureka server down or wrong quarkus.spring-cloud-config.discovery.eureka.service-url; Config Server registered under a different application name than the configured serviceId (default 'spring-cloud-config-server'); Docker/K8s DNS or firewall blocking the Eureka port.","solutions":["Verify quarkus.spring-cloud-config.discovery.eureka.service-url points to a reachable Eureka server (e.g. http://localhost:8761/eureka)","Check quarkus.spring-cloud-config.discovery.service-id matches the name under which the Config Server is registered in Eureka","Confirm the Config Server instance is UP in Eureka (Eureka dashboard /apps/<serviceId>)","Check network/DNS from the client to Eureka; look at the debug log line 'Timed out while waiting for Spring Cloud Config Server URL' for the root cause","If discovery is not needed, disable it and configure quarkus.spring-cloud-config.url directly"],"exampleFix":"// before\nquarkus.spring-cloud-config.discovery.enabled=true\nquarkus.spring-cloud-config.discovery.service-id=config-server\n// after (matches registration name and reachable Eureka)\nquarkus.spring-cloud-config.discovery.enabled=true\nquarkus.spring-cloud-config.discovery.service-id=spring-cloud-config-server\nquarkus.spring-cloud-config.discovery.eureka.service-url=http://eureka:8761/eureka","handlingStrategy":"fallback","validationCode":"// application.properties pre-check\n// quarkus.spring-cloud-config.discovery.enabled=true requires:\n//   quarkus.spring-cloud-config.discovery.eureka.service-url=<reachable eureka url>\n//   quarkus.spring-cloud-config.discovery.service-id=<registered app id>\n// curl $EUREKA_URL/eureka/apps/<SERVICE_ID> must return 200 before startup","typeGuard":null,"tryCatchPattern":"try {\n    String url = discoveryService.discover(serviceId);\n} catch (RuntimeException e) {\n    log.warn(\"Config Server discovery failed, falling back to direct URL\", e);\n    return configUrl; // e.g. quarkus.spring-cloud-config.url\n}","preventionTips":["Smoke-test the Eureka URL with curl /eureka/apps before deploying","Pin discovery.service-id to the exact registered application name","Enable debug logging for the spring-cloud-config-client to see timeouts early","Prefer direct quarkus.spring-cloud-config.url when the Config Server address is static"],"tags":["spring-cloud-config","eureka","service-discovery","configuration"],"backgroundTag":"service-discovery-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}