{"record":{"id":"44ae5c4e34b8a1b5","repo":"alibaba/Sentinel","slug":"empty-rule-config-path-please-set-the-file-path-i","errorCode":null,"errorMessage":"Empty rule config path, please set the file path in the env: SENTINEL_RLS_RULE_FILE_PATH","messagePattern":"Empty rule config path, please set the file path in the env: SENTINEL_RLS_RULE_FILE_PATH","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sentinel-cluster/sentinel-cluster-server-envoy-rls/src/main/java/com/alibaba/csp/sentinel/cluster/server/envoy/rls/datasource/EnvoyRlsRuleDataSourceService.java","lineNumber":58,"sourceCode":"    private ReadableDataSource<String, List<EnvoyRlsRule>> ds;\n\n    public EnvoyRlsRuleDataSourceService() {\n        this.yaml = createYamlParser();\n    }\n\n    private Yaml createYamlParser() {\n        Representer representer = new Representer();\n        representer.getPropertyUtils().setSkipMissingProperties(true);\n        return new Yaml(representer);\n    }\n\n    public synchronized void init() throws Exception {\n        if (ds != null) {\n            return;\n        }\n        String configPath = getRuleConfigPath();\n        if (StringUtil.isBlank(configPath)) {\n            throw new IllegalStateException(\"Empty rule config path, please set the file path in the env: \"\n                + SentinelEnvoyRlsConstants.RULE_FILE_PATH_ENV_KEY);\n        }\n\n        this.ds = new FileRefreshableDataSource<>(configPath, s -> Arrays.asList(yaml.loadAs(s, EnvoyRlsRule.class)));\n        EnvoyRlsRuleManager.register2Property(ds.getProperty());\n    }\n\n    public synchronized void onShutdown() {\n        if (ds != null) {\n            try {\n                ds.close();\n            } catch (Exception e) {\n                e.printStackTrace();\n            }\n        }\n    }\n\n    private String getRuleConfigPath() {","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/alibaba/Sentinel/blob/a3f40ba8e900c8489bd520274739f17235a7721c/sentinel-cluster/sentinel-cluster-server-envoy-rls/src/main/java/com/alibaba/csp/sentinel/cluster/server/envoy/rls/datasource/EnvoyRlsRuleDataSourceService.java#L40-L76","documentation":"EnvoyRlsRuleDataSourceService.init() (Sentinel's Envoy Rate Limit Service) reads the rule file path from the environment; if SENTINEL_RLS_RULE_FILE_PATH is blank it throws IllegalStateException telling you to set it. The service then builds a FileRefreshableDataSource on that YAML file, so without a path the RLS server cannot load any rate-limit descriptors.","triggerScenarios":"Starting the envoy-rls standalone service without the SENTINEL_RLS_RULE_FILE_PATH env var, or with it set to empty/whitespace; running the docker image without mounting/env-passing the variable.","commonSituations":"Deploying the sentinel-cluster-server-envoy-rls image behind Envoy's rate_limit filter and forgetting the env var; CI runs that don't export the variable; value present but blank string.","solutions":["Set the env var to an absolute path of a readable YAML file: SENTINEL_RLS_RULE_FILE_PATH=/etc/envoy/rls/config.yaml","In docker: docker run -e SENTINEL_RLS_RULE_FILE_PATH=/app/rls.yaml -v $(pwd)/rls.yaml:/app/rls.yaml ...","Verify the file exists and the process has read permission on it","Validate the YAML matches the EnvoyRlsRule schema (domain + descriptors) so the next failure doesn't occur"],"exampleFix":"# before\ndocker run sentinel-envoy-rls\n\n# after\ndocker run -e SENTINEL_RLS_RULE_FILE_PATH=/etc/sentinel/rls.yaml \\\n  -v $PWD/rls.yaml:/etc/sentinel/rls.yaml sentinel-envoy-rls","handlingStrategy":"validation","validationCode":"String p = System.getenv(\"SENTINEL_RLS_RULE_FILE_PATH\");\nif (p == null || p.trim().isEmpty() || !new java.io.File(p).canRead()) {\n    throw new IllegalStateException(\"Configure SENTINEL_RLS_RULE_FILE_PATH to a readable YAML file before start\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set SENTINEL_RLS_RULE_FILE_PATH explicitly in docker/k8s deployment specs and smoke-test with `docker run ... env`","Add a readiness check that verifies the rule file is present and readable before Envoy routes traffic"],"tags":["envoy","rls","configuration","environment","datasource"],"backgroundTag":null,"analyzedSha":"a3f40ba8e900c8489bd520274739f17235a7721c","analyzedAt":"2026-08-14T11:10:30.678Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}