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

mcli: Unable to prepare URL for copying. Unable to guess the type of copy operation. #4893

Open
paramazo opened this issue Apr 4, 2024 · 9 comments

Comments

@paramazo
Copy link

paramazo commented Apr 4, 2024

Expected behavior

The folder in a bucket should be moved into another bucket

Actual behavior

The folder was not moved, mc results with error:

mc mv --recursive <bucket1>/<folder> <bucket2>/<folder>
mcli: <ERROR> Unable to prepare URL for copying. Unable to guess the type of copy operation.

Other folders in the same folder structure was moved this way successful.

In an earlier version of mc, the error was

mcli: <ERROR> Unable to validate source

Steps to reproduce the behavior

Unknown why some folders cant be moved

mc --version

mcli version RELEASE.2024-03-30T15-29-52Z (commit-id=9f8147bf0e037730077a1b3baef25e53181099b0)
Runtime: go1.21.8 linux/amd64

minio version RELEASE.2023-03-20T20-16-18Z (commit-id=05444a0f6af8389b9bb85280fc31337c556d4300)
Runtime: go1.19.7 linux/amd64

System information

Debian 11.5 Bullseye

@paramazo
Copy link
Author

paramazo commented Apr 8, 2024

Tested mc mirror but it does not copy anything from the affected folder and does not result with Error and ends after 2 minutes. The folder i want to copy is 101GB big with 1.8 million files.

Other smaller folders in the same bucket works with mc mv and with mc mirror.

@paramazo
Copy link
Author

Tested to copy the folder from minio server to my local system with mc cp -r, same error. This folder can not be copied, mirrored or moved in any way. Other smaller folders work, so obviously it is a bug in MinIO with very big data. This is a gamebreaker and very critical and if this behaviour is not supported, we need to change our environment and switch to another solution.

@paramazo
Copy link
Author

paramazo commented Apr 11, 2024

The data in our minio are now in a minio folder structure and as we can not access the contents via mcli/awscli/winscp, we have a huge data loss? Can anyone help here? Where do we find support?

@ds-colligence
Copy link

From what I can understand, it seems like when the bucket has hyphens in it, it is failing. At least that seems to be the case for me.

@mmedic
Copy link

mmedic commented May 7, 2024

I can confirm the same issue with a bucket with hypens in it

@jiuker
Copy link
Contributor

jiuker commented May 14, 2024

@mmedic Could you share a script to let us to reproduce that?

@hypesystem
Copy link

hypesystem commented May 14, 2024

I was wracking my brain because I got this error, too. It turns out it appears when the source file does not exist

@mratibb
Copy link

mratibb commented May 15, 2024

I had the same issue, and apparently it was a certificate issue.
Either add 'insecure' option to your command, or add the certificate to the host/container you running the command on.

@Xun66
Copy link

Xun66 commented May 24, 2024

I had the same issue with two mc commands.

Command 1:

mc alias set myminio $MINIO_ENDPOINT $MINIO_ACCESS_KEY $MINIO_SECRET_KEY
mc cp --recursive myminio/<folder> <local>/<folder>
# mc: <ERROR> Unable to prepare URL for copying. Unable to guess the type of copy operation.

Looks like the MINIO_ACCESS_KEY and MINIO_SECRET_KEY were empty. Once I filled in the correct values, everything worked smoothly.

Command 2:

mc cp --recursive <local>/<folder> myminio/<folder>
# mc: <ERROR> Unable to prepare URL for copying. Unable to guess the type of copy operation.

Turns out, the issue was that <local>/<folder> didn't exist. In earlier versions of mc, this would've triggered an error message saying: mc: <ERROR> Unable to validate source <local>/<folder>: Object does not exist.

mc version

It looks like this change was introduced in PR #4710. From version mc version RELEASE.2023-10-14T01-57-03Z (commit-id=d158b9a478a6a5a74795f01097d069be82edfff6).

my test result:

$ docker run -it --rm minio/mc:RELEASE.2023-10-14T01-57-03Z cp -r /foo/ myio/bar 
mc: Configuration written to `/root/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/root/.mc/share`.
mc: Initialized share uploads `/root/.mc/share/uploads.json` file.
mc: Initialized share downloads `/root/.mc/share/downloads.json` file.
mc: <ERROR> Unable to prepare URL for copying. Unable to guess the type of copy operation. 
$ docker run -it --rm minio/mc:RELEASE.2023-10-04T06-52-56Z cp -r /foo/ myio/bar   
mc: Configuration written to `/root/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/root/.mc/share`.
mc: Initialized share uploads `/root/.mc/share/uploads.json` file.
mc: Initialized share downloads `/root/.mc/share/downloads.json` file.
mc: <ERROR> Unable to validate source `/foo/`: Object does not exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants