OCI SDK Warning: Upload Stream Size Is 0 Bytes — Potential Data Corruption

未關閉
#702 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
java
領域
cloud

研究方向

從提供的 singlePartUpload 方法和 JerseyHttpRequest.java:101 中的警告位置開始。在檢查 InputStream 和內容長度的同時重現上傳,然後檢查 OCI SDK 相依性的版本。確定零位元組警告的原因並記錄經過驗證的修正方案後,即視為完成。

由索引模型根據 Issue 內容生成。

描述

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

主要語言
Java
星號
243
分支
171
平均合併
5 分鐘
30 天內合併 PR
4

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

oracle/oci-java-sdk 的其他 Issue

查看 oracle/oci-java-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。