{"record":{"id":"e2f56ba7e5509a04","repo":"apache/beam","slug":"config-file-configfile-does-not-exist","errorCode":null,"errorMessage":"Config file + configFile + does not exist","messagePattern":"Config file \\+ configFile \\+ does not exist","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/transform-service/src/main/java/org/apache/beam/sdk/transformservice/TransformServiceOptions.java","lineNumber":57,"sourceCode":"\n  void setTransformServiceConfigFile(String configFile);\n\n  @Description(\"Transform service configuration.\")\n  @Default.InstanceFactory(TransformServiceConfigFactory.class)\n  TransformServiceConfig getTransformServiceConfig();\n\n  void setTransformServiceConfig(TransformServiceConfig configFile);\n\n  /** Loads the TransformService config. */\n  class TransformServiceConfigFactory implements DefaultValueFactory<TransformServiceConfig> {\n\n    @Override\n    public TransformServiceConfig create(PipelineOptions options) {\n      String configFile = options.as(TransformServiceOptions.class).getTransformServiceConfigFile();\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 TransformServiceConfig.parseFromYamlStream(stream);\n        } catch (FileNotFoundException e) {\n          throw new RuntimeException(\n              \"Could not parse the provided Transform Service config file \" + configFile, e);\n        } catch (IOException e) {\n          throw new RuntimeException(\n              \"Could not parse the provided Transform Service config file \" + configFile, e);\n        }\n      }\n\n      return TransformServiceConfig.empty();\n    }\n  }\n}\n","sourceCodeStart":39,"sourceCodeEnd":74,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/transform-service/src/main/java/org/apache/beam/sdk/transformservice/TransformServiceOptions.java#L39-L74","documentation":"TransformServiceConfigFactory.create loads the Transform service configuration from the file given via TransformServiceOptions. If the configured config file path does not exist on the filesystem, this guard throws — the option points to a missing file, so the service config cannot be constructed and pipeline submission fails at options-processing time.","triggerScenarios":"Setting --transformServiceConfigFile (or the equivalent PipelineOptions setter) to a path that does not exist, including wrong relative path (relative to the process CWD, not the pipeline code directory).","commonSituations":"Typo in the path; running the job from a different working directory than expected; file deleted or not mounted on a Dataflow/cluster worker; wrong container image.","solutions":["Verify the path exists with an absolute path instead of a relative one.","When launching on a runner with separate workers, ensure the config file is staged/accessible on the worker (or embed config content via another mechanism).","Check the option value passed on the command line for typos."],"exampleFix":"// before\n--transformServiceConfigFile=./configs/tsvc.yaml\n// after (absolute, verified path)\n--transformServiceConfigFile=/etc/beam/tsvc.yaml","handlingStrategy":"validation","validationCode":"import java.io.File;\nstatic void requireConfigFile(String path) {\n  File f = new File(path);\n  if (!f.isFile() || !f.canRead()) {\n    throw new IllegalArgumentException(\"Transform service config not found/readable: \" + f.getAbsolutePath());\n  }\n}","typeGuard":"boolean configFileExists(String path) {\n  File f = new File(path);\n  return f.isFile() && f.canRead();\n}","tryCatchPattern":"try {\n  config = TransformServiceConfig.from(options);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"does not exist\")) {\n    throw new IllegalStateException(\n        \"Set --transformServiceConfigFile to an existing file; got: \"\n        + options.as(TransformServiceOptions.class).getTransformServiceConfigFile(), e);\n  }\n  throw e;\n}","preventionTips":["Use absolute paths for the config file option.","Stage the config onto workers (or a mounted volume) when running on remote runners like Dataflow.","Validate the path in a startup check before building PipelineOptions."],"tags":["java","configuration","file-io","pipeline-options"],"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"}