mrAceT / nextcloud-S3-local-S3-migration

Script for migrating Nextcloud primary storage from S3 to local to S3 storage
GNU General Public License v3.0
67 stars 11 forks source link

Incorrect usage of bucket_endpoint with use_path_style_endpoint #15

Closed maretodoric closed 2 weeks ago

maretodoric commented 2 months ago

Hello,

I'm not using AWS as S3 storage, instead I'm using contabo S3 implementation which requires use_path_style_endpoint = true.

When starting the migration, i get the following error:

Error executing "GetObject" on "https://eu2.contabostorage.com/urn%3Aoid%3A219040"; AWS HTTP error: Client error: `GET https://eu2.contabostorage.com/urn%3Aoid%3A219040` resulted in a `404 Not Found` response:
<?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchBucket</Code><Message></Message><BucketName>oid:219040</BucketN (truncated...)

Looking at the URL that was accessed, it's not using path style, as URL should be https://eu2.contabostorage.com/<bucket name>/urn%3Aoid%3A219040

By changing the 'bucket_endpoint' to 'false' on line 176, migration appears to have started as it now calls for correct URL. Not sure why this was needed, though.

mrAceT commented 2 months ago

The way data is stored is called "AWS S3". Amazon is the developer of this standard. Contabo apparently seems to use that standard in a slightly different way.. ?

Good that you have found the solution. Do you have this setting in your config also?

Give me the variable and I'll update the script.

mrAceT commented 2 months ago

I am assuming that it was "normally set" in your config.php

I have altered both scripts, can you confirm correct operation?

maretodoric commented 2 months ago

Well, at the time of writing the original post, I've made this change to 'false' in s3tolocal.php script and it worked. I haven't really touched the nextcloud config itself (and it was not configured there either way)

mrAceT commented 2 weeks ago

I'll assume it is all working correctly & close this