Help needed: S3 (minio) copy failing

What is the problem you are having with rclone?

Copying files to minio backend isn't working.

I can copy (upload) files via the minio inbuilt web file manager and also via other s3 programs (an app on my android phone uploads files)

Other operations like ls, mkdir, copy (download), delete all work fine. The resulting folders (buckets) work ok and I can upload/download fine. As a result; I can workaround by recreating all the folders but looking a direct solution as not practical to recreate all the buckets.

What is your rclone version (output from rclone version)

rclone v1.55.0
- os/type: linux
- os/arch: amd64
- go/version: go1.16.2
- go/linking: static
- go/tags: cmount

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Windows 10 x64

Which cloud storage system are you using? (eg Google Drive)

s3 (Minio) self hosted.

The command you were trying to run

rclone copy --progress testfile minio:Minio

The rclone config contents with secrets removed.

type = s3
provider = Minio
env_auth = false
access_key_id = (removed)
secret_access_key = (removed)
endpoint = https://minio.(removed).com:9090
acl = private
chunk_size = 48M
upload_concurrency = 4

A log from the command with the -vv flag

2021/04/06 18:08:39 DEBUG : Using config file from "/home/kelly/.config/rclone/rclone.conf"
2021/04/06 18:08:39 DEBUG : rclone: Version "v1.55.0" starting with parameters ["rclone" "copy" "-vv" "testfile" "minio:Minio"]
2021/04/06 18:08:39 DEBUG : Creating backend with remote "testfile"
2021/04/06 18:08:39 DEBUG : fs cache: adding new entry for parent of "testfile", "/tmp"
2021/04/06 18:08:39 DEBUG : Creating backend with remote "minio:Minio"
2021/04/06 18:08:39 DEBUG : testfile: Need to transfer - File not found at Destination
2021/04/06 18:08:39 ERROR : testfile: Failed to copy: InvalidBucketName: The specified bucket is not valid.
        status code: 400, request id: 16733CF612F93994, host id:
2021/04/06 18:08:39 ERROR : Attempt 1/3 failed with 1 errors and: InvalidBucketName: The specified bucket is not valid.
        status code: 400, request id: 16733CF612F93994, host id:
2021/04/06 18:08:39 DEBUG : testfile: Need to transfer - File not found at Destination
2021/04/06 18:08:39 ERROR : testfile: Failed to copy: InvalidBucketName: The specified bucket is not valid.
        status code: 400, request id: 16733CF614AA6754, host id:
2021/04/06 18:08:39 ERROR : Attempt 2/3 failed with 1 errors and: InvalidBucketName: The specified bucket is not valid.
        status code: 400, request id: 16733CF614AA6754, host id:
2021/04/06 18:08:39 DEBUG : testfile: Need to transfer - File not found at Destination
2021/04/06 18:08:39 ERROR : testfile: Failed to copy: InvalidBucketName: The specified bucket is not valid.
        status code: 400, request id: 16733CF615A64574, host id:
2021/04/06 18:08:39 ERROR : Attempt 3/3 failed with 1 errors and: InvalidBucketName: The specified bucket is not valid.
        status code: 400, request id: 16733CF615A64574, host id:
2021/04/06 18:08:39 INFO  :
Transferred:             0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         0.2s

2021/04/06 18:08:39 DEBUG : 5 go routines active
2021/04/06 18:08:39 Failed to copy: InvalidBucketName: The specified bucket is not valid.
        status code: 400, request id: 16733CF615A64574, host id:

hello and welcome to the forum,

what is the about of rclone lsd minio: -vv

2021/04/06 23:39:04 DEBUG : Using config file from "/home/kelly/.config/rclone/rclone.conf"
2021/04/06 23:39:04 DEBUG : rclone: Version "v1.55.0" starting with parameters ["rclone" "lsd" "-vv" "minio:"]
2021/04/06 23:39:04 DEBUG : Creating backend with remote "minio:"
          -1 2021-03-27 13:01:04        -1 Data_Program
          -1 2021-03-27 13:01:04        -1 Data_User
          -1 2021-02-14 17:40:48        -1 Minio
          -1 2021-03-27 13:01:04        -1 System
          -1 2021-03-27 13:01:04        -1 ZA_Computer_Setup
          -1 2021-03-27 13:01:04        -1 ZZ_Logs
2021/04/06 23:39:04 DEBUG : 4 go routines active

i see that you are trying to copy a file, are you able to copy a folder?
might try rclone copyto

what is the output of rclone lsd minio:Minio -vv

Can you try this with

rclone copy -vv testfile minio:Minio --dump bodies --retries 1

One thing that could be wrong is this

Depending on how you set minio up you might need to remove the minio. from the endpoint and add force_path_style = false - is it set up with a DNS wildcard?

Hi Jojo, Nick,

Some interesting findings from your various suggestions.

i see that you are trying to copy a file, are you able to copy a folder? might try `rclone copyto`

This actually does work! To wit, the below successfully copies 'testfile' to the Minio folder.

mkdir test_folder
touch test_folder/testfile
rclone copyto test_folder minio:Minio

The corresponding rclone copy test_folder/testfile minio:Minio fails as per OP.

what is the output of `rclone lsd minio:Minio -vv`

The output is as follows:

2021/04/07 08:09:52 DEBUG : Using config file from "/home/kelly/.config/rclone/rclone.conf"
2021/04/07 08:09:52 DEBUG : rclone: Version "v1.55.0" starting with parameters ["rclone" "lsd" "minio:Minio" "-vv"]
2021/04/07 08:09:52 DEBUG : Creating backend with remote "minio:Minio"
           0 2021-04-07 08:09:52        -1 Config
           0 2021-04-07 08:09:52        -1 Evernote
           0 2021-04-07 08:09:52        -1 PDF
           0 2021-04-07 08:09:52        -1 PDF_Not_Found
((various folders elided))
           0 2021-04-07 08:09:52        -1 Work_iPad
2021/04/07 08:09:52 DEBUG : 4 go routines active

To Nick's queries:

``
Can you try this with

rclone copy -vv testfile minio:Minio --dump bodies --retries 1
``

I get similar (but more verbose) error messages:

2021/04/07 08:12:08 DEBUG : Using config file from "/home/kelly/.config/rclone/rclone.conf"
2021/04/07 08:12:08 DEBUG : rclone: Version "v1.55.0" starting with parameters ["rclone" "copy" "-vv" "testfile" "minio:Minio" "--dump" "bodies" "--retries" "1"]
2021/04/07 08:12:08 DEBUG : Creating backend with remote "testfile"
2021/04/07 08:12:08 DEBUG : fs cache: adding new entry for parent of "testfile", "/tmp"
2021/04/07 08:12:08 DEBUG : Creating backend with remote "minio:Minio"
2021/04/07 08:12:08 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2021/04/07 08:12:08 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/04/07 08:12:08 DEBUG : HTTP REQUEST (req 0xc00077db00)
2021/04/07 08:12:08 DEBUG : HEAD /Minio/testfile HTTP/1.1
Host: minio.(removed)online.com:9090
User-Agent: rclone/v1.55.0
Authorization: XXXX
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20210407T001208Z

2021/04/07 08:12:08 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/04/07 08:12:08 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/04/07 08:12:08 DEBUG : HTTP RESPONSE (req 0xc00077db00)
2021/04/07 08:12:08 DEBUG : HTTP/1.1 404 Not Found
Accept-Ranges: bytes
Content-Security-Policy: block-all-mixed-content
Date: Wed, 07 Apr 2021 00:12:10 GMT
Server: MinIO
Vary: Origin
X-Amz-Request-Id: 16736AFDF43C3D2C
X-Xss-Protection: 1; mode=block
Content-Length: 0

2021/04/07 08:12:08 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/04/07 08:12:08 DEBUG : testfile: Need to transfer - File not found at Destination
2021/04/07 08:12:08 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/04/07 08:12:08 DEBUG : HTTP REQUEST (req 0xc000526a00)
2021/04/07 08:12:08 DEBUG : PUT /Minio HTTP/1.1
Host: minio.(removed)online.com:9090
User-Agent: rclone/v1.55.0
Content-Length: 0
Authorization: XXXX
X-Amz-Acl: bucket-owner-full-control
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20210407T001208Z
Accept-Encoding: gzip

2021/04/07 08:12:08 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/04/07 08:12:08 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/04/07 08:12:08 DEBUG : HTTP RESPONSE (req 0xc000526a00)
2021/04/07 08:12:08 DEBUG : HTTP/1.1 400 Bad Request
Content-Length: 286
Accept-Ranges: bytes
Content-Security-Policy: block-all-mixed-content
Content-Type: application/xml
Date: Wed, 07 Apr 2021 00:12:10 GMT
Server: MinIO
Vary: Origin
X-Amz-Request-Id: 16736AFDF539F200
X-Xss-Protection: 1; mode=block

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidBucketName</Code><Message>The specified bucket is not valid.</Message><BucketName>Minio</BucketName><Resource>/Minio</Resource><RequestId>16736AFDF539F200</RequestId><HostId>fc524fe6-4c8f-41b4-9f7a-d1696315cb73</HostId></Error>
2021/04/07 08:12:08 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/04/07 08:12:08 ERROR : testfile: Failed to copy: InvalidBucketName: The specified bucket is not valid.
	status code: 400, request id: 16736AFDF539F200, host id: 
2021/04/07 08:12:08 ERROR : Attempt 1/1 failed with 1 errors and: InvalidBucketName: The specified bucket is not valid.
	status code: 400, request id: 16736AFDF539F200, host id: 
2021/04/07 08:12:08 INFO  : 
Transferred:   	         0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         0.1s

2021/04/07 08:12:08 DEBUG : 5 go routines active
2021/04/07 08:12:08 Failed to copy: InvalidBucketName: The specified bucket is not valid.
	status code: 400, request id: 16736AFDF539F200, host id: 

On the setup of Minio

Depending on how you set minio up you might need to remove the `minio.` from the endpoint and add `force_path_style = false`

This is how I set up minio

MINIO_ACCESS_KEY=(removed) \
MINIO_SECRET_KEY=(removed) \
     nohup minio server $MINIO_FOLDER \
           --address ":9090" \
     > $MINIO_LOG_FOLDER/Minio_$TIMESTAMP.log 2>&1 &

Doing the removal of minio server address and adding the 'force_path_style' in the config file ; I still can connect with the server (see below on setup) but the error on copying files still occurs.

is it set up with a DNS wildcard?

Don't think there is any DNS wildcards involved, the minio.(removed).com is a CNAME to the apex (removed).com which is in turn has an A record to the gateway which port forwards to the minio server machine. But don't have any connectivity issues at all.

There is a wildcard TLS certificate that minio server uses - but I don't think that is related.

I think for some reason it doesn't like the bucket name "Minio"

If you look at the AWS docs it says

Rules for bucket naming

The following rules apply for naming S3 buckets:

  • Bucket names must be between 3 and 63 characters long.
  • Bucket names can consist only of lowercase letters, numbers, dots (.), and hyphens (-).

So I think you need to use a different bucket name. "minio" maybe or "testbucket"

rclone copy -vv testfile minio:testbucket --dump bodies --retries 1

Hi Nick,

Looks like you zoomed in onto it - when having lowercase buckets then the problem goes away.

Looks like this is one of those corner areas where non compliant bucket names are treated in the dreaded 'undefined' behaviour - sometimes works; sometimes doesn't with no rhyme or reason.

Anyway; the copyto with intermediate folder allows a workaround so close this out.

Cheers Nick / Jojo.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.