CodexBloom - Programming Q&A Platform

OCI Object Storage Upload scenarios with 'FileNotFound' scenarios Despite Correct Path

👀 Views: 65 đŸ’Ŧ Answers: 1 📅 Created: 2025-08-27
oci object-storage python Python

I've searched everywhere and can't find a clear answer. I'm testing a new approach and Could someone explain I've searched everywhere and can't find a clear answer. I'm trying to upload a file to OCI Object Storage using the SDK for Python (version 3.1.0), but I'm working with a `FileNotFound` behavior. The specific behavior message I'm receiving is `OciClientError: (404, 'FileNotFound')`. I have verified that the file exists at the specified path, and I'm using the following code snippet to perform the upload: ```python import oci config = oci.config.from_file() # Load configuration from ~/.oci/config object_storage_client = oci.object_storage.ObjectStorageClient(config) namespace_name = object_storage_client.get_namespace().data bucket_name = 'my_bucket' file_path = '/path/to/my/file.txt' object_name = 'file.txt' with open(file_path, 'rb') as file: response = object_storage_client.put_object(namespace_name, bucket_name, object_name, file) ``` I double-checked the file path and the file is indeed at `/path/to/my/file.txt`. I also confirmed that the bucket `my_bucket` exists and I have sufficient permissions set for the Object Storage service. I've tried printing the absolute path of the file before the upload and it is correct. Additionally, I've tested the API with another, smaller file and it uploaded successfully. Is there a limitation on file sizes or a specific format that I might be missing? Any insights or troubleshooting tips would be greatly appreciated! For context: I'm using Python on Windows. Any ideas what could be causing this? My development environment is Ubuntu 20.04. Any pointers in the right direction? This is happening in both development and production on Ubuntu 22.04. I appreciate any insights!