{"record":{"id":"945ebe9f1a6c629f","repo":"apache/beam","slug":"stagingbucketname-must-end-with","errorCode":null,"errorMessage":"stagingBucketName must end with '/'","messagePattern":"stagingBucketName must end with '/'","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeReadSchemaTransformProvider.java","lineNumber":238,"sourceCode":"          getOauthToken(),\n          getPrivateKey(),\n          getPrivateKeyPassphrase());\n\n      String table = getTable();\n      boolean tablePresent = table != null && !table.isEmpty();\n      String query = getQuery();\n      boolean queryPresent = query != null && !query.isEmpty();\n\n      if (!tablePresent && !queryPresent) {\n        throw new IllegalArgumentException(\"Either table or query must be specified.\");\n      }\n\n      if (tablePresent && queryPresent) {\n        throw new IllegalArgumentException(\"table and query are mutually exclusive.\");\n      }\n\n      if (!getStagingBucketName().endsWith(\"/\")) {\n        throw new IllegalArgumentException(\"stagingBucketName must end with '/'\");\n      }\n\n      // Validate JSON schema early.\n      JsonUtils.beamSchemaFromJsonSchema(getSchema());\n    }\n\n    private static void requireNonEmpty(String value, String name) {\n      if (value == null || value.isEmpty()) {\n        throw new IllegalArgumentException(name + \" cannot be empty\");\n      }\n    }\n\n    @AutoValue.Builder\n    public abstract static class Builder {\n\n      public abstract Builder setServerName(String value);\n\n      public abstract Builder setUsername(@Nullable String value);","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeReadSchemaTransformProvider.java#L220-L256","documentation":"The Snowflake read schema transform requires a staging bucket name that ends with a trailing slash ('/'); validate() throws IllegalArgumentException('stagingBucketName must end with \\'/\\'') otherwise. The bucket is used for CSV data export/import staging with Snowflake.","triggerScenarios":"Configuring stagingBucketName as 'gs://my-bucket' or 'gs://my-bucket/prefix' without a trailing '/'.","commonSituations":"Copying a bucket URL from the cloud console (which omits the slash); building the path from variables where the prefix lacks a separator; GCS vs S3 path formats.","solutions":["Append '/' to the bucket name: setStagingBucketName(\"gs://my-bucket/\").","If using a prefix, include it before the slash: 'gs://my-bucket/stage/' (the trailing slash is still required).","Normalize the value in your config loader before constructing the configuration object.","Check that you didn't pass the storage integration name or bucket URI with query params."],"exampleFix":"// before\n.setStagingBucketName(\"gs://my-bucket\")\n// after\n.setStagingBucketName(\"gs://my-bucket/\")","handlingStrategy":"validation","validationCode":"if (bucket != null && !bucket.endsWith(\"/\")) {\n  bucket = bucket + \"/\"; // normalize before building configuration\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always normalize stage bucket URIs to end with '/'.","Store the bucket value already slash-terminated in config.","Remember prefixes need the trailing slash too: gs://bucket/prefix/."],"tags":["java","snowflake","validation","gcs"],"backgroundTag":"invalid-argument-value","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"}