{"record":{"id":"5aff38899da373b4","repo":"apache/beam","slug":"output-path-does-not-exist-or-is-not-writeable-s","errorCode":null,"errorMessage":"Output path does not exist or is not writeable: %s","messagePattern":"Output path does not exist or is not writeable: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/storage/GcsPathValidator.java","lineNumber":85,"sourceCode":"    GcsPath gcsPath = getGcsPath(path);\n    checkArgument(gcsPath.isAbsolute(), \"Must provide absolute paths for Dataflow\");\n    checkArgument(\n        !gcsPath.getObject().isEmpty(),\n        \"Missing object or bucket in path: '%s', did you mean: 'gs://some-bucket/%s'?\",\n        gcsPath,\n        gcsPath.getBucket());\n    checkArgument(\n        !gcsPath.getObject().contains(\"//\"),\n        \"Dataflow Service does not allow objects with consecutive slashes\");\n    return gcsPath.toResourceName();\n  }\n\n  private void verifyPathIsAccessible(String path, String errorMessage) {\n    GcsPath gcsPath = getGcsPath(path);\n    try {\n      gcpOptions.getGcsUtil().verifyBucketAccessible(gcsPath);\n    } catch (IOException e) {\n      throw new RuntimeException(String.format(errorMessage, path), e);\n    }\n  }\n\n  private GcsPath getGcsPath(String path) {\n    try {\n      return GcsPath.fromUri(path);\n    } catch (IllegalArgumentException e) {\n      throw new IllegalArgumentException(\n          String.format(\"Expected a valid 'gs://' path but was given '%s'\", path), e);\n    }\n  }\n}\n","sourceCodeStart":67,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/storage/GcsPathValidator.java#L67-L98","documentation":"GcsPathValidator.verifyPathIsAccessible checks that a GCS path's bucket exists and is accessible via GcsUtil.verifyBucketAccessible. When that check throws an IOException (bucket missing, no permission, or path not writeable), the validator wraps it in a RuntimeException using the supplied message template, e.g. 'Output path does not exist or is not writeable: %s'. It is thrown before a job runs, during output file prefix validation.","triggerScenarios":"Calling FileBasedSink/TextIO validate or pipeline validation with an output prefix whose bucket does not exist, whose bucket is in another project without access, or when GCS API calls fail (credentials, network).","commonSituations":"Typo in the gs:// output prefix or bucket name; bucket deleted between job submission; service account lacking storage.buckets.get; wrong project credentials on the Dataflow runner.","solutions":["Verify the bucket exists: gsutil ls gs://<bucket>/","Confirm credentials/project: the pipeline options' project must match the bucket's project or have access","Grant the running service account roles/storage.admin (or at least storage.buckets.get) on the bucket","Check the output prefix path format: it must be a valid gs:// URI, not a local path"],"exampleFix":"// before\n.apply(\"Write\", TextIO.write().to(\"my-bucket/output/data\"));\n// after\n.apply(\"Write\", TextIO.write().to(\"gs://my-bucket/output/data\"));","handlingStrategy":"validation","validationCode":"String path = options.getOutputFilePrefix();\nif (!path.startsWith(\"gs://\")) throw new IllegalArgumentException(\"output must be a gs:// path: \" + path);\nString bucket = GcsPath.fromUri(path).getBucket();\n// pre-check via gsutil or Storage client: bucket exists and credentials can access it","typeGuard":null,"tryCatchPattern":"try { validator.validateOutputFilePrefixSupported(prefix); }\ncatch (RuntimeException e) { LOG.error(\"Output prefix rejected: \" + e.getMessage(), e.getCause()); throw e; }","preventionTips":["Always use fully-qualified gs://bucket/prefix output paths","Run gsutil ls on the bucket before submitting the job","Grant the pipeline service account storage object/bucket access in the target project"],"tags":["gcs","storage","validation","java"],"backgroundTag":"resource-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}