quarkusio/quarkus · error · IllegalArgumentException

No service ID has been configured for service

Error message

No service ID has been configured for service

What it means

DiscoveryService.validate() requires a serviceId to look up in Eureka. This IllegalArgumentException is thrown when the eureka config is valid but quarkus.spring-cloud-config.discovery.service-id is empty, leaving discovery without a registry name to query.

Source

Thrown at extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/eureka/DiscoveryService.java:66

                + "' 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

  1. Set quarkus.spring-cloud-config.discovery.service-id to the Config Server's registered application name (default 'spring-cloud-config-server')
  2. Confirm the value is not blank after env-var/profile resolution
  3. Cross-check the name against the Config Server's spring.application.name registration

Example fix

# before
quarkus.spring-cloud-config.discovery.service-id=
# after
quarkus.spring-cloud-config.discovery.service-id=spring-cloud-config-server
Defensive patterns

Strategy: validation

Validate before calling

var d = config.discoveryConfig();
if (d.isPresent() && d.get().serviceId().isEmpty()) {
    throw new IllegalStateException("Set quarkus.spring-cloud-config.discovery.service-id");
}

Try / catch

try {
    discoveryService.discover(serviceId);
} catch (IllegalArgumentException e) {
    log.error("service-id missing: " + e.getMessage());
}

Prevention

When it happens

Trigger: discover() -> validate() with discovery enabled, eureka service-url set, but quarkus.spring-cloud-config.discovery.service-id unset or blank.

Common situations: User assumes the default serviceId is always set; serviceId blanked by an env override; serviceId removed during config refactoring.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/7d60a3448a65ae53. Report an issue: GitHub.