OCI Object Storage: Multipart Upload Not Resuming from Last Part with Python SDK 2.12.0
I've looked through the documentation and I'm still confused about I'm refactoring my project and Does anyone know how to Hey everyone, I'm running into an issue that's driving me crazy... I'm currently implementing a multipart upload to OCI Object Storage using the Python SDK version 2.12.0. While attempting to resume an upload after a network interruption, I'm working with an scenario where the upload does not continue from the last completed part. Instead, it seems to restart the entire upload process, leading to unnecessary data transfer and increased time for the upload to complete. Here's the relevant code snippet that I'm using to create and manage the multipart upload: ```python import oci config = oci.config.from_file('~/.oci/config') object_storage_client = oci.object_storage.ObjectStorageClient(config) bucket_name = 'my_bucket' object_name = 'my_large_file.dat' # Initialize multipart upload create_multipart_upload_details = oci.object_storage.models.CreateMultipartUploadDetails() create_multipart_upload_details.object_name = object_name create_multipart_upload_response = object_storage_client.create_multipart_upload(bucket_name, create_multipart_upload_details) upload_id = create_multipart_upload_response.data.id part_number = 1 parts = [] try: with open('my_large_file.dat', 'rb') as f: while True: data = f.read(5 * 1024 * 1024) # 5 MB chunks if not data: break upload_part_response = object_storage_client.upload_part(bucket_name, object_name, upload_id, part_number, data) parts.append(oci.object_storage.models.CompleteMultipartUploadPartDetails( part_number=part_number, etag=upload_part_response.data.etag, )) part_number += 1 except Exception as e: print(f"behavior during upload: {e}") # Complete multipart upload if part_number > 1: object_storage_client.commit_multipart_upload(bucket_name, object_name, upload_id, oci.object_storage.models.CommitMultipartUploadDetails(parts=parts)) ``` The scenario arises when I try to resume the upload. I'm storing the `upload_id` and the `part_number` in a persistent location. However, when the upload is resumed, it seems to ignore the previous state of the upload. The behavior message I receive is often `InvalidPart`, which indicates that it want to find the part numbers that were previously uploaded. Has anyone faced a similar scenario or can provide guidance on how to properly implement resuming multipart uploads in OCI Object Storage? Any insights on what I'm doing wrong or any best practices for managing multipart uploads would be greatly appreciated. For context: I'm using Python on Windows. Has anyone else encountered this? My development environment is macOS. For context: I'm using Python on Ubuntu 22.04. Any examples would be super helpful. I'm coming from a different tech stack and learning Python. Any examples would be super helpful.