OCI SDK Warning: Upload Stream Size Is 0 Bytes — Potential Data Corruption
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 243
- Forks
- 171
- Avg merge
- 30m
- Merged PRs (30d)
- 4
Description
log
{"timestamp":"2025-07-16T15:00:12.267984423Z","@version":"1","message":"Stream size to upload is 0 bytes, this could potentially lead to data corruption. If this is not intended, please make sure all the OCI SDK dependencies point to the same version","logger":"c.o.b.h.c.jersey.JerseyHttpRequest","thread":"upload-worker-5","level":"WARN","level_value":30000,"commitId":"8c5c308","spanId":"6ce63656-ed29-4c81-a9e2-aa7f7ed0fe77","traceId":"6449a622-b0bc-4ba0-b5cd-938d3cc49109","dmsId":"14a92955-e974-43be-9eaf-97f17161807e","caller_class_name":"com.oracle.bmc.http.client.jersey.JerseyHttpRequest","caller_method_name":"logAvailable","caller_file_name":"JerseyHttpRequest.java","caller_line_number":101}
This is my caller method
private StoreResponse singlePartUpload(InputStream inputStream, String ociObjectPath, StoreRequest request) throws IOException {
// Prepare the PutObjectRequest
PutObjectRequest putObjectRequest = PutObjectRequest.builder()
.namespaceName(namespace)
.bucketName(bucketName)
.objectName(ociObjectPath)
.putObjectBody(inputStream)
.opcMeta(request.getMetadata())
.contentType(request.getContentType())
.contentLength(request.getContentLength())
.build();
// Upload the file to Object Storage
PutObjectResponse putObjectResponse = objectStorageClient.putObject(putObjectRequest);
if (putObjectResponse == null || StringUtils.isBlank(putObjectResponse.getETag())) {
throw new StorageException(OBJECT_STORAGE_ETAG_NOT_FOUND);
} else {
return StoreResponse.builder()
.objectPath(ociObjectPath)
.eTag(putObjectResponse.getETag())
.versionId(putObjectResponse.getOpcContentMd5()) // Not actual versionId, placeholder
.build();
}
}
Can someone help me here.
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided singlePartUpload method and the warning location in JerseyHttpRequest.java:101. Reproduce the upload while checking the InputStream and content length, then inspect the OCI SDK dependency versions. Done means identifying the cause of the zero-byte warning and recording a verified remediation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100