AWS S3 addon compatibility with Google Cloud Storage

Hi,

I was trying to setup the S3 addon on GCP Storage, that should be working thanks to Cloud Storage interoperability

I’ve set cuba.amazonS3.endpointUrl to https://storage.googleapis.com and I’ve created access and secret key as in Managing HMAC keys for service accounts.

However, when trying to upload a file I obtain:

com.haulmont.cuba.core.global.FileStorageException: I/O error: Could not save file <filename>.

In debug mode I see that the inner exception is:

software.amazon.awssdk.services.s3.model.S3Exception: Invalid argument. (Service: S3, Status Code: 400, Request ID: null)

Any suggestions to better debug the issue is greatly appreciated, thanks!

It looks like that Google Storage interoperability isn’t really interoperable with multi-part uploading.

At this point the best way is to write an addon leveraging the GCS SDK instead of the S3 SDK?

Thanks.

Hi,
You have two options:

  1. you may write new addon that leverages the GCS SDK. Use AWS addon as an example.
  2. extend the AmazonS3FileStorage and override its saveFile method. The overriden saveFile should not use multipart requests