{"record":{"id":"27f8bd6d6300de2e","repo":"apache/beam","slug":"allow-list-file-does-not-exist","errorCode":null,"errorMessage":"Allow list file  does not exist","messagePattern":"Allow list 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":91,"sourceCode":"  void setUseConfigDependenciesForManaged(boolean useConfigDependenciesForManaged);\n\n  /**\n   * Loads the allow list from {@link #getJavaClassLookupAllowlistFile}, defaulting to an empty\n   * {@link JavaClassLookupTransformProvider.AllowList}.\n   */\n  class JavaClassLookupAllowListFactory implements DefaultValueFactory<AllowList> {\n\n    @Override\n    public AllowList create(PipelineOptions options) {\n      String allowListFile =\n          options.as(ExpansionServiceOptions.class).getJavaClassLookupAllowlistFile();\n      if (allowListFile != null) {\n        if (allowListFile.equals(\"*\")) {\n          return AllowList.everything();\n        }\n        File allowListFileObj = new File(allowListFile);\n        if (!allowListFileObj.exists()) {\n          throw new IllegalArgumentException(\n              \"Allow list file \" + allowListFile + \" does not exist\");\n        }\n        try (InputStream stream = new FileInputStream(allowListFileObj)) {\n          return AllowList.parseFromYamlStream(stream);\n        } catch (FileNotFoundException e) {\n          throw new RuntimeException(\n              \"Could not parse the provided allowlist file \" + allowListFile, e);\n        } catch (IOException e) {\n          throw new RuntimeException(\n              \"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","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/expansion-service/src/main/java/org/apache/beam/sdk/expansion/service/ExpansionServiceOptions.java#L73-L109","documentation":"Thrown by AllowList.create when the configured allowlist file path is neither the wildcard '*' nor an existing file on disk. The service validates file existence up front with File.exists() so it can fail with a clear message instead of a FileNotFoundException later.","triggerScenarios":"Starting ExpansionService with an allowlist path (via --allowListFile or equivalent option) that points to a non-existent file or a typo'd relative path.","commonSituations":"Running the service from a different working directory than assumed, so a relative path no longer resolves; file deleted or renamed; container image missing the mounted config file.","solutions":["Verify the path exists: run 'ls -l <path>' and correct any typo or relative-path issue (use an absolute path).","Create the allowlist file if it was never written, e.g. with an 'allowlist:' YAML mapping.","If everything should be allowed, pass '*' instead of a file path."],"exampleFix":"// before\n--allowListFile=./configs/allowlist.yml   # file not present\n// after\n--allowListFile=/opt/expansion/allowlist.yml  # absolute path to an existing file","handlingStrategy":"validation","validationCode":"String allowListFile = options.as(ExpansionServiceOptions.class).getAllowListFile();\nif (allowListFile != null && !allowListFile.equals(\"*\") && !new File(allowListFile).exists()) {\n  throw new IllegalStateException(\"Allowlist file does not exist: \" + allowListFile);\n}","typeGuard":null,"tryCatchPattern":"try {\n  startExpansionService(options);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"Allow list file\") && e.getMessage().contains(\"does not exist\")) { /* fix path or create file */ }\n  throw e;\n}","preventionTips":["Use absolute paths for allowlist files in service startup scripts.","Add an existence assertion to the startup script before launching the JVM.","Use '*' only when you truly intend to allow everything."],"tags":["java","file","config","path"],"backgroundTag":"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"}