quarkusio/quarkus · error · RuntimeException
Unable to discover Spring Cloud Config Server URL for servic
Error message
Unable to discover Spring Cloud Config Server URL for service '${serviceId}' What it means
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.
Source
Thrown at extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/eureka/DiscoveryService.java:55
log.debug("Attempting to discover Spring Cloud Config Server URL for service '" + serviceId
+ "' using the following URLs: " + serviceUrlMap.values());
for (Map.Entry<String, String> entry : serviceUrlMap.entrySet()) {
try {
return getHomeUrl(entry.getValue(), serviceId);
} catch (Exception e) {
log.debug("Timed out while waiting for Spring Cloud Config Server URL for service '" + serviceId + "'", e);
}
}
log.debug("Fallback Attempting to discover Spring Cloud Config Server URL for service '" + serviceId
+ "' using the default URL: " + defaultServiceUrl);
try {
return getHomeUrl(defaultServiceUrl, serviceId);
} catch (Exception e) {
log.debug("Timed out while waiting for Spring Cloud Config Server URL for service '" + serviceId + "'", e);
}
throw new RuntimeException("Unable to discover Spring Cloud Config Server URL for service '" + serviceId + "'");
}
private void validate(SpringCloudConfigClientConfig.DiscoveryConfig discoveryConfig) {
if (discoveryConfig.eurekaConfig().isEmpty()) {
throw new IllegalArgumentException("No Eureka configuration has been provided");
}
if (discoveryConfig.eurekaConfig().get().serviceUrl().isEmpty()) {
throw new IllegalArgumentException("No service URLs have been configured for service");
}
if (discoveryConfig.serviceId().isEmpty()) {
throw new IllegalArgumentException("No service ID has been configured for service");
}
}
private String getHomeUrl(String defaultServiceUrl, String serviceId) {
JsonObject instance = eurekaClient.fetchInstances(defaultServiceUrl, serviceId);
return instance.getString("homePageUrl");
}View on GitHub (pinned to e1c734241f)
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
Example fix
// before quarkus.spring-cloud-config.discovery.enabled=true quarkus.spring-cloud-config.discovery.service-id=config-server // after (matches registration name and reachable Eureka) quarkus.spring-cloud-config.discovery.enabled=true quarkus.spring-cloud-config.discovery.service-id=spring-cloud-config-server quarkus.spring-cloud-config.discovery.eureka.service-url=http://eureka:8761/eureka
Defensive patterns
Strategy: fallback
Validate before calling
// application.properties pre-check // quarkus.spring-cloud-config.discovery.enabled=true requires: // quarkus.spring-cloud-config.discovery.eureka.service-url=<reachable eureka url> // quarkus.spring-cloud-config.discovery.service-id=<registered app id> // curl $EUREKA_URL/eureka/apps/<SERVICE_ID> must return 200 before startup
Try / catch
try {
String url = discoveryService.discover(serviceId);
} catch (RuntimeException e) {
log.warn("Config Server discovery failed, falling back to direct URL", e);
return configUrl; // e.g. quarkus.spring-cloud-config.url
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Eureka configuration is required
- No Eureka configuration has been provided
- No service URLs have been configured for service
- No service ID has been configured for service
- No service definition for serviceName ${serviceName} found.
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/dd7e376897461a36.
Report an issue: GitHub.