{"record":{"id":"92d83082631156fb","repo":"apache/beam","slug":"config-file-does-not-exist","errorCode":null,"errorMessage":"Config file  does not exist","messagePattern":"Config file  does not exist","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/expansion-service/src/main/java/org/apache/beam/sdk/expansion/service/ExpansionServiceOptions.java","lineNumber":119,"sourceCode":"              \"Could not parse the provided allowlist file \" + allowListFile, e);\n        }\n      }\n\n      // By default produces an empty allow-list.\n      return AllowList.nothing();\n    }\n  }\n\n  /** Loads the ExpansionService config. */\n  class ExpansionServiceConfigFactory implements DefaultValueFactory<ExpansionServiceConfig> {\n\n    @Override\n    public ExpansionServiceConfig create(PipelineOptions options) {\n      String configFile = options.as(ExpansionServiceOptions.class).getExpansionServiceConfigFile();\n      if (configFile != null) {\n        File configFileObj = new File(configFile);\n        if (!configFileObj.exists()) {\n          throw new IllegalArgumentException(\"Config file \" + configFile + \" does not exist\");\n        }\n        try (InputStream stream = new FileInputStream(configFileObj)) {\n          return ExpansionServiceConfig.parseFromYamlStream(stream);\n        } catch (FileNotFoundException e) {\n          throw new RuntimeException(\n              \"Could not parse the provided Expansion Service config file\" + configFile, e);\n        } catch (IOException e) {\n          throw new RuntimeException(\n              \"Could not parse the provided Expansion Service config file\" + configFile, e);\n        }\n      }\n\n      // By default produces null.\n      return ExpansionServiceConfig.empty();\n    }\n  }\n}\n","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/expansion-service/src/main/java/org/apache/beam/sdk/expansion/service/ExpansionServiceOptions.java#L101-L137","documentation":"Thrown by the ExpansionServiceConfig provider's create() when the expansion service config file option is set but the file does not exist on disk. Like the allowlist check, this validates existence eagerly with a descriptive IllegalArgumentException.","triggerScenarios":"Starting the service with --expansionServiceConfigFile (or equivalent) pointing to a missing file or a mistyped path.","commonSituations":"Typo in the flag value; running from a different working directory so relative paths break; config file forgotten when replicating a deployment; Kubernetes volume mount missing so path is absent.","solutions":["Verify the path with 'ls -l <path>' and correct it (prefer absolute paths).","Create the config YAML with at least an allowlist key if it does not exist yet.","If no config file is needed, unset the option so the service uses the default empty config."],"exampleFix":"// before\n--expansionServiceConfigFile=config.yaml   # relative, wrong cwd\n// after\n--expansionServiceConfigFile=/etc/expansion-service/config.yaml","handlingStrategy":"validation","validationCode":"String cfgPath = options.as(ExpansionServiceOptions.class).getExpansionServiceConfigFile();\nif (cfgPath != null && !new File(cfgPath).exists()) {\n  throw new IllegalStateException(\"Expansion service config file does not exist: \" + cfgPath);\n}","typeGuard":null,"tryCatchPattern":"try {\n  startExpansionService(options);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"Config file\") && e.getMessage().contains(\"does not exist\")) { /* fix path or create config */ }\n  throw e;\n}","preventionTips":["Use absolute paths for the config file flag.","Verify volume mounts in containers before service start.","Add a pre-start check in the launch script: test -f \"$CONFIG_FILE\"."],"tags":["java","file","config","path"],"backgroundTag":"config-file-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}