Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Cloud Storage's S3 compatibility mode doesn't function properly for multipart uploads [Update: Google fixed in June 2023] #14074

Closed
CorruptMonkey opened this issue Feb 7, 2019 · 22 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: object storage needs info stale Ticket or PR with no recent activity

Comments

@CorruptMonkey
Copy link

Steps to reproduce

  1. Configure external storage for Google Cloud Storage as you would for Amazon s3
  2. Try to upload to GCS.

Expected behaviour

The file should upload

Actual behaviour

Directories can be created fine, and show up on the bucket, however files will not upload to it and result in an error in the browser.

An exception occurred while initiating a multipart upload: Error executing "CreateMultipartUpload" on "https://mystorage.storage.googleapis.com/polly.jpeg?uploads"; AWS HTTP error: Client error: `POST https://mystorage.storage.googleapis.com/polly.jpeg?uploads` resulted in a `400 Bad Request` response: <?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidArgument</Code><Message>Invalid argument.</Message><Details>PO (truncated...) InvalidArgument (client): Invalid argument. - <?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidArgument</Code><Message>Invalid argument.</Message><Details>POST object expects Content-Type multipart/form-data</Details></Error>

Server configuration

Operating system: Ubuntu 18.04.1 LTS

Web server: nginx

Database: MariaDB

PHP version: 7.2

Nextcloud version: 15.0.3

Updated from an older Nextcloud/ownCloud or fresh install:
Updated from 15.0.2

Where did you install Nextcloud from:
Download from nextcloud website

Signing status:

Signing status
No errors have been found.

List of activated apps:

Activated apps Accessibility 1.1.0, Activity 2.8.2, Announcement center 3.4.1, AppOrder 0.6.0, Calendar 1.6.4, Collaborative tags 1.5.0, Comments 1.5.0, Contacts 3.0.3, Deck 0.5.2, Deleted files 1.5.0, DropIt 0.1.3, External storage support 1.6.0, External user support 0.5.0, Federation 1.5.0, File sharing 1.7.0, Files From Mail 0.2.0, Files Right Click 0.11.0, Gallery 18.2.0, Log Reader 2.0.0, Mail 0.11.0, Monitoring 1.5.0, Music 0.9.3, News 13.0.3, Nextcloud announcements 1.4.0, Notifications 2.3.0, Notifications for calendar event updates 0.3.2, Password policy 1.5.0, PDF viewer 1.4.0, Quota warning 1.4.0, Radio 0.6.4, Share by mail 1.5.0, Support 1.0.0, Text editor 2.7.0, Theming 1.6.0, Update notification 1.5.0, Usage survey 1.3.0, Versions 1.8.0, Video player 1.4.0

Are you using external storage, if yes which one: Amazon s3

Are you using encryption: yes on s3 bucket

Are you using an external user-backend, if yes which one: IMAP

Client configuration

Browser: Firefox

Operating system: Ubuntu 18.04 LTS

Logs

An exception occurred while initiating a multipart upload: Error executing "CreateMultipartUpload" on "https://mystorage.storage.googleapis.com/polly.jpeg?uploads"; AWS HTTP error: Client error: `POST https://mystorage.storage.googleapis.com/polly.jpeg?uploads` resulted in a `400 Bad Request` response: <?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidArgument</Code><Message>Invalid argument.</Message><Details>PO (truncated...) InvalidArgument (client): Invalid argument. - <?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidArgument</Code><Message>Invalid argument.</Message><Details>POST object expects Content-Type multipart/form-data</Details></Error>

@CorruptMonkey CorruptMonkey added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Feb 7, 2019
@lubo
Copy link

lubo commented Apr 26, 2019

Same problem here with primary storage.

@lubo

This comment has been minimized.

@goloxxly

This comment has been minimized.

@thisboyiscrazy
Copy link

It seems to be related to the fact that GCP does not handle Multipart uploads

@vdwijngaert
Copy link

vdwijngaert commented Jul 11, 2019

Is there a workaround to this problem?

Edit: this is a "workaround" for the multipart uploader always being used, but it does NOT implement support for large files.

In lib/private/Files/ObjectStore/S3ObjectTrait.php

function writeObject($urn, $stream) {
                // Prevent multipart upload from always being used, 
                // to "fix" uploading files to Google Cloud Storage.
                $this->getConnection()->upload($this->bucket, $urn, $stream, 'private', [
                        'mup_threshold' => S3_UPLOAD_PART_SIZE,
                        'part_size' => S3_UPLOAD_PART_SIZE
                ]);
                return;
                // rest of code goes here

@Cinerar
Copy link

Cinerar commented Nov 19, 2019

i believe this patch could help #288 (comment)

@mseravalli

This comment has been minimized.

@solracsf
Copy link
Member

For those reaching this post, here is the reason why GGS is not compatble, at this time, with Nextcloud.
Read https://dzone.com/articles/extending-an-amazon-s3-integration-to-google-cloud "Differences in Uploads".

@solracsf solracsf changed the title External Storage: Error uploading to Google Cloud Storage Google Cloud Storage is not compatible with Nextcloud Apr 30, 2021
@despens
Copy link

despens commented Jul 1, 2021

It would be great if nextcloud could support GCS storage natively as primary storage. At the moment, a minio service has to serve as an S3 proxy, which introduces quite some overhead for large files, which have to be buffered two times: in the regular nextcloud upload, and the local minio instance.

@szaimen
Copy link
Contributor

szaimen commented Aug 8, 2021

As Nextcloud doesn't officially support Google Cloud Storage, I don't think that implementing this is feasible.

But cc @nextcloud/server-triage on this.

@despens
Copy link

despens commented Sep 3, 2021

I'm guessing that if #27034 is implemented, this issue might solve itself.

@szaimen szaimen added 2. developing Work in progress and removed needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Sep 3, 2021
@szaimen

This comment was marked as spam.

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 2. developing Work in progress labels Jan 9, 2023
@despens

This comment was marked as resolved.

@szaimen

This comment was marked as resolved.

@gersur
Copy link

gersur commented Apr 7, 2023

Use Google Cloud storage via GCS Fuse
#6256 (comment)

@szaimen szaimen removed the bug label May 29, 2023
@solracsf
Copy link
Member

solracsf commented Jun 2, 2023

#27034 is merged on v27 (not yet published).
Feel free to try it once out and report back.

@joshtrichards
Copy link
Member

joshtrichards commented Jun 10, 2023

Unfortunately, there will still be other issues because GCS simply isn't fully S3 compliant:

#38166 (comment)

Specifically:

https://cloud.google.com/storage/docs/release-notes#October_12_2021

Might be worth voting on the Google tracker that you're a GCS user that is impacted by that issue too since it breaks S3 compatibility:

https://issuetracker.google.com/issues/229020040

@joshtrichards joshtrichards changed the title Google Cloud Storage is not compatible with Nextcloud Google Cloud Storage's S3 compatibility mode doesn't function properly for multipart uploads Sep 15, 2023
@joshtrichards
Copy link
Member

#38166 (comment)

Looks like Google improved their S3 compatibility for Multipart Uploads.

Please report back how it's functions for you: @CorruptMonkey @despens @lubo etc

@despens
Copy link

despens commented Sep 18, 2023

Thanks @joshtrichards for alerting to this change. Unfortunately I am unable to test since I moved to a completely different storage provider. I hope others will be able to help.

@xvybihal
Copy link

@joshtrichards I was just dealing with connecting GCS to Nextcloud and based on my short testing, it is still broken. I was able to work with small files (KBs or few MBs) just fine, but 2 GB iso file just failed by GCS erroring into 500:

Aws\S3\Exception\S3MultipartUploadException: An exception occurred while initiating a multipart upload: Error executing "CreateMultipartUpload" on "https://BUCKET.storage.googleapis.com/rhel-baseos-9.1-x86_64-boot.iso?uploads"; AWS HTTP error: Server error: `POST https://BUCKET.storage.googleapis.com/rhel-baseos-9.1-x86_64-boot.iso?uploads` resulted in a `500 Internal Server Error` response:
<?xml version='1.0' encoding='UTF-8'?><Error><Code>InternalError</Code><Message>We encountered an internal error. Please (truncated...)
 InternalError (server): We encountered an internal error. Please try again. - <?xml version='1.0' encoding='UTF-8'?><Error><Code>InternalError</Code><Message>We encountered an internal error. Please try again.</Message><Details>AN+NOG/vxzJGl8Qu70mzzsXFMLz8A9PJCg+zKY8xVI84ZtbWpsSncqESIHncVvEGdoc9oTdRCmKEKzWNcNmr0Z5+TW3uv8l1hkhUBYdQcRpCiLZsVdLBiiT8yD2dA6Ach+fOA8d3DxH4</Details></Error> at <<closure>>

 0. /srv/http/drive.acme.cz/nextcloud/3rdparty/aws/aws-sdk-php/src/Multipart/AbstractUploadManager.php line 156
    Aws\Multipart\AbstractUploadManager->transformException()

@joshtrichards
Copy link
Member

@xvybihal That's a 500 error from GCS. Not really much we can do about that... other than retry and hope their end recovers.

It happening occasionally is somewhat expected with a cloud based storage platform, which is why most S3 implementations retry more than once.

As far as I can tell at the moment we run the AWS S3 SDK in standard mode so we retry at least 3 times.

@joshtrichards joshtrichards changed the title Google Cloud Storage's S3 compatibility mode doesn't function properly for multipart uploads Google Cloud Storage's S3 compatibility mode doesn't function properly for multipart uploads [Update: Google fixed in June 2023] Oct 17, 2023
@nextcloud-command
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@nextcloud-command nextcloud-command added the stale Ticket or PR with no recent activity label Dec 18, 2023
@nextcloud-command nextcloud-command closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: object storage needs info stale Ticket or PR with no recent activity
Projects
None yet
Development

No branches or pull requests