Skip to content

Conversation

@kikemolina3
Copy link
Contributor

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

When I tried to perform non-read operations (create_bucket, delete_object, put_object...) over IBM COS (and with iam_api_key auth.), I got this error:

> python3
Python 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] on linux                                                                                                                                                       ok  1m 4s  lithops3.10 py 
Type "help", "copyright", "credits" or "license" for more information.
>>> from lithops import Storage
>>> Storage(backend="ibm_cos")
<lithops.storage.storage.Storage object at 0x7f902efa0040>
>>> Storage(backend="ibm_cos").create_bucket("todelete")
Traceback (most recent call last):
  File "/home/manri-urv/urv/lithops/lithops/storage/backends/ibm_cos/ibm_cos.py", line 137, in create_bucket
    self.cos_client.head_bucket(Bucket=bucket_name)
  File "/home/manri-urv/.local/lib/python3.10/site-packages/ibm_botocore/client.py", line 401, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/home/manri-urv/.local/lib/python3.10/site-packages/ibm_botocore/client.py", line 734, in _make_api_call
    raise error_class(parsed_response, operation_name)
ibm_botocore.exceptions.ClientError: An error occurred (404) when calling the HeadBucket operation: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/manri-urv/urv/lithops/lithops/storage/storage.py", line 98, in create_bucket
    return self.storage_handler.create_bucket(bucket)
  File "/home/manri-urv/urv/lithops/lithops/storage/backends/ibm_cos/ibm_cos.py", line 142, in create_bucket
    self.cos_client.create_bucket(Bucket=bucket_name)
  File "/home/manri-urv/.local/lib/python3.10/site-packages/ibm_botocore/client.py", line 401, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/home/manri-urv/.local/lib/python3.10/site-packages/ibm_botocore/client.py", line 734, in _make_api_call
    raise error_class(parsed_response, operation_name)
ibm_botocore.exceptions.ClientError: An error occurred (InvalidArgument) when calling the CreateBucket operation: Invalid Argument

Basically, it was due to IBM COS client miss the ibm_service_instance_id info.

This PR will fix this issue.

Co-authored-by: German Telmo Eizaguirre Suarez [email protected]

@JosepSampe
Copy link
Member

Thanks!

@JosepSampe JosepSampe merged commit 4679275 into lithops-cloud:master Oct 2, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants