alibaba/Sentinel · critical · IllegalStateException
Could not locate PropertySource and the fail fast property i
Error message
Could not locate PropertySource and the fail fast property is set, failing
What it means
Thrown by SentinelRuleLocator.locate() when fetching the remote environment from the Spring Cloud Config server failed (HTTP error, network error, or label not found) AND the client's fail-fast property is enabled. With fail-fast=true the locator rethrows the captured error wrapped in this IllegalStateException instead of just logging a warning and returning null.
Source
Thrown at sentinel-extension/sentinel-datasource-spring-cloud-config/src/main/java/com/alibaba/csp/sentinel/datasource/spring/cloud/config/SentinelRuleLocator.java:133
.getSource();
composite.addPropertySource(
new MapPropertySource(source.getName(), map));
}
}
SentinelRuleStorage.setRulesSource(composite);
return composite;
}
}
} catch (HttpServerErrorException e) {
error = e;
if (MediaType.APPLICATION_JSON.includes(e.getResponseHeaders().getContentType())) {
errorBody = e.getResponseBodyAsString();
}
} catch (Exception e) {
error = e;
}
if (properties.isFailFast()) {
throw new IllegalStateException(
"Could not locate PropertySource and the fail fast property is set, failing",
error);
}
RecordLog.warn("Could not locate PropertySource: " + (errorBody == null
? error == null ? "label not found" : error.getMessage()
: errorBody));
return null;
}
public org.springframework.core.env.PropertySource<?> refresh() {
return locate(environment);
}
private void log(Environment result) {
RecordLog.info("Located environment: name={}, profiles={}, label={}, version={}, state={}",
result.getName(),View on GitHub (pinned to a3f40ba8e9)
Solutions
- Check the wrapped cause in the stack trace — it distinguishes connect-refused (wrong URI/server down) from HTTP 404/5xx (label/profile or backend problem).
- Fix the Config Server connection: verify spring.cloud.config.uri, the label/branch, and profiles; open the same /env endpoint in curl to confirm.
- If startup should tolerate config-server unavailability, set fail-fast to false (sentinel-rule-source-spring-cloud-config.fail-fast=false or the corresponding property) so the locator logs a warning and continues.
- If startup MUST fail on missing config (a valid choice), keep fail-fast=true and fix the server side — do not mask it.
Example fix
# before (bootstrap.yml) sentinel-rule-source-spring-cloud-config: fail-fast: true # startup aborts when config server is unreachable # after sentinel-rule-source-spring-cloud-config: fail-fast: false # log warning and continue without remote rules
Defensive patterns
Strategy: try-catch
Validate before calling
// before startup, probe the config server endpoint
// curl -fsS "$CONFIG_URI/{label}/{app}-{profile}.yml" or in code:
RestTemplate t = new RestTemplate();
t.getForObject(configUri + "/" + label + "/" + app + "-" + profile + ".yml", String.class); // throws early with clear cause Try / catch
try {
PropertySource<?> ps = ruleLocator.locate(environment);
} catch (IllegalStateException e) {
if (e.getMessage() != null && e.getMessage().contains("fail fast")) {
log.error("Config Server unreachable/label missing; wrapped cause: {}",
e.getCause() == null ? "none" : e.getCause().getMessage());
}
throw e; // or degrade gracefully if fail-fast was not intentional
} Prevention
- Keep fail-fast=true only when startup must abort without remote config; otherwise set it false.
- Monitor Config Server health and the correctness of label/branch/profile values.
- Read the wrapped cause — it distinguishes connectivity from label-not-found.
When it happens
Trigger: sentinel-rule-source-spring-cloud-config client configured with failFast=true, and the Config Server is down/unreachable, returns 5xx, or the requested label/branch/profile does not exist on the server.
Common situations: Config Server not deployed or behind a broken LB; wrong config.uri / label (branch name) in bootstrap.yml; Config Server backends (git repo) unavailable; network/DNS issues in the container. Because fail-fast is set, application startup aborts with this exception.
Related errors
- Invalid Value for Read Timeout set.
- You must set either 'password' or 'authorization'
- Bad argument: ruleKey=[%s]
- File can't be null or a directory
- charset can't be null
AI-assisted analysis of alibaba/Sentinel@a3f40ba8e9 (2026-08-14).
Data as JSON: /api/errors/d792bd69c72e9517.
Report an issue: GitHub.