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 摘要。