{"record":{"id":"efed47ffb127c273","repo":"apache/flink","slug":"bulk-copy-not-enabled-set-s3-bulk-copy-enabled-tr","errorCode":null,"errorMessage":"Bulk copy not enabled. Set s3.bulk-copy.enabled=true","messagePattern":"Bulk copy not enabled\\. Set s3\\.bulk-copy\\.enabled=true","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/NativeS3FileSystem.java","lineNumber":527,"sourceCode":"        return StringUtils.generateRandomAlphanumericString(\n                ThreadLocalRandom.current(), entropyLength);\n    }\n\n    @Override\n    public boolean canCopyPaths(Path source, Path destination) {\n        return bulkCopyHelper != null\n                && NativeS3BulkCopyHelper.isSupportedS3Scheme(source)\n                && NativeS3BulkCopyHelper.isSupportedLocalScheme(destination);\n    }\n\n    @Override\n    public void copyFiles(\n            List<CopyRequest> requests,\n            org.apache.flink.core.fs.ICloseableRegistry closeableRegistry)\n            throws IOException {\n        checkNotClosed();\n        if (bulkCopyHelper == null) {\n            throw new UnsupportedOperationException(\n                    \"Bulk copy not enabled. Set s3.bulk-copy.enabled=true\");\n        }\n        bulkCopyHelper.copyFiles(requests, closeableRegistry);\n    }\n\n    @Override\n    public RecoverableWriter createRecoverableWriter() throws IOException {\n        checkNotClosed();\n        if (s3AccessHelper == null) {\n            throw new UnsupportedOperationException(\"Recoverable writer not available\");\n        }\n        return NativeS3RecoverableWriter.writer(\n                s3AccessHelper, localTmpDir, s3uploadPartSize, maxConcurrentUploadsPerStream);\n    }\n\n    @Override\n    public CompletableFuture<Void> closeAsync() {\n        if (!closed.compareAndSet(false, true)) {","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/NativeS3FileSystem.java#L509-L545","documentation":"NativeS3FileSystem.copyFiles requires the bulk-copy helper, which is only constructed when s3.bulk-copy.enabled=true in the filesystem factory configuration. When the flag is off, bulkCopyHelper is null and any copyFiles call throws UnsupportedOperationException pointing at the missing option.","triggerScenarios":"Calling PathsCopyingFileSystem.copyFiles (e.g. via Flink's staging/recovery path for RocksDB incremental checkpoints or savepoints stored on S3) on an S3 filesystem created without s3.bulk-copy.enabled=true.","commonSituations":"Enabling a feature that relies on bulk copy (local recovery, download of state from S3) without turning on the new bulk-copy optimization; upgrading Flink where the flag defaults to false.","solutions":["Set s3.bulk-copy.enabled: true in flink-conf and restart/re-create the filesystem.","Verify the option key with NativeS3FileSystemFactory (BULK_COPY_ENABLED) so spelling matches your Flink version.","Alternatively avoid the copyFiles path (e.g. disable local recovery) if bulk copy is not desired."],"exampleFix":"# before\n# no bulk copy config\n\n# after\nfs.s3.bulk-copy.enabled: true\n# (confirm exact key prefix: s3.bulk-copy.enabled for your version)","handlingStrategy":"validation","validationCode":"// check capability before relying on bulk copy\nif (!(s3Fs instanceof PathsCopyingFileSystem)\n        || !((PathsCopyingFileSystem) s3Fs).supportsCopyFiles(source, destination)) {\n    throw new UnsupportedOperationException(\"Bulk copy unavailable; set s3.bulk-copy.enabled=true\");\n}","typeGuard":"static boolean bulkCopyAvailable(FileSystem fs) {\n    return fs instanceof PathsCopyingFileSystem\n            && ((PathsCopyingFileSystem) fs).supportsCopyFiles(\n                    new Path(\"s3://probe/obj\"), new Path(\"file:///tmp/probe\"));\n}","tryCatchPattern":"try {\n    ((PathsCopyingFileSystem) fs).copyFiles(requests, registry);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().contains(\"s3.bulk-copy.enabled\")) {\n        // enable the flag in config, recreate the filesystem, then retry\n    } else {\n        throw e;\n    }\n}","preventionTips":["Set s3.bulk-copy.enabled=true whenever a feature documents bulk-copy dependency (e.g. S3 state download).","Prefer the filesystem's supportsCopyFiles capability check over catching exceptions.","Keep S3 plugin jars in sync with the Flink version so new options are recognized."],"tags":["s3","bulk-copy","configuration","feature-flag"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}