quarkusio/quarkus · critical · RuntimeException

Unable to obtain configuration from Spring Cloud Config Serv

Error message

Unable to obtain configuration from Spring Cloud Config Server at ${config.url()}

What it means

SpringCloudConfigClientConfigSourceFactory.getConfigSources() contacts the Spring Cloud Config Server during static init to fetch configuration. If any step (DNS, connect, HTTP, parsing) fails, it either throws a RuntimeException wrapping the cause when quarkus.spring-cloud-config.fail-fast=true, or logs the error and returns an empty source list. The message includes the configured server URL for diagnosis.

Source

Thrown at extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/SpringCloudConfigClientConfigSourceFactory.java:84

            Collections.reverse(propertySources);

            for (int i = 0, propertySourcesSize = propertySources.size(); i < propertySourcesSize; i++) {
                int ordinal = config.ordinal() + i;
                PropertySource propertySource = propertySources.get(i);
                if (log.isDebugEnabled()) {
                    log.debug("Adding PropertySource named '" + propertySource.getName() + "', with and ordinal of '" + ordinal
                            + "' that contains the following keys: " + join(",", propertySource.getSource().keySet()));
                }
                sources.add(new MapBackedConfigSource(propertySource.getName(), propertySource.getSource(), ordinal) {
                });
            }

            return sources;

        } catch (Exception e) {
            final String errorMessage = "Unable to obtain configuration from Spring Cloud Config Server at " + config.url();
            if (config.failFast()) {
                throw new RuntimeException(errorMessage, e);
            } else {
                log.error(errorMessage, e);
                return emptyList();
            }
        } finally {
            client.close();
        }
    }

    private static String determineProfiles(ConfigSourceContext context, SpringCloudConfigClientConfig config) {
        if (config.profiles().isPresent()) {
            return join(",", config.profiles().get());
        }
        // The profile list starts with the profile overrides, but setting the property is done backwards
        List<String> profiles = new ArrayList<>(context.getProfiles());
        Collections.reverse(profiles);
        return join(",", profiles);
    }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Verify the Config Server is reachable at the configured URL (curl it from the same network)
  2. Set quarkus.spring-cloud-config.fail-fast=false if config should be optional and the app can start without it
  3. Add credentials/proxy settings if the server requires them; fix DNS or connection-wait using quarkus.http or startup ordering (e.g. wait-for services)

Example fix

// before
quarkus.spring-cloud-config.fail-fast=true
quarkus.spring-cloud-config.url=http://wrong-host:8888

// after
quarkus.spring-cloud-config.fail-fast=true
quarkus.spring-cloud-config.url=http://config-server:8888
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight check before startup (script/CI)
curl -fsS "$CONFIG_URL/<app>/<profile>" > /dev/null || echo "Config Server unreachable"

Try / catch

try {
    quarkus.run();
} catch (RuntimeException e) {
    if (e.getMessage().startsWith("Unable to obtain configuration from Spring Cloud Config Server")) {
        log.error("Config Server unreachable; check url/network/credentials", e);
    }
}

Prevention

When it happens

Trigger: Config Server unreachable (wrong host/port, network down, DNS failure), server returning non-200 (e.g. 401/404), TLS errors, or response parsing problems while loading config at application startup with fail-fast enabled.

Common situations: Container started before the Config Server was ready; wrong quarkus.spring-cloud-config.url; missing credentials when the server requires auth; corporate proxy blocking the request.

Related errors


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