copy object rewind gives error unable to validate source
I needed to roll-back an object foo.
I tried to call cp with --rewind which resulted in an error.
From documentation of the flag I would suspect that something like this should be possible
--rewind value roll back object(s) to current version at specified time
Expected behavior
mc cp --rewind 1s s3/mlad-test/foo s3/mlad-test-2/
shall rollback to version of foo older than 1s
Interestingly enough, it works in combination with --recursive when setting the SOURCE as bucket
$ mc cp --rewind 1s --recursive s3/mlad-test/ s3/mlad-test-2/
`s3/mlad-test/foo` -> `s3/mlad-test-2/foo`
Actual behavior
$ mc cp --rewind 1s s3/mlad-test/foo s3/mlad-test-2/
mc: <ERROR> Unable to validate source `s3/mlad-test/foo`.
Steps to reproduce the behavior
mc mb s3/mlad-test
mc mb s3/mlad-test-2
touch foo
mc cp foo s3/mlad-test
mc version enable s3/mlad-test
mc cp foo s3/mlad-test/foo
mc ls --versions s3/mlad-test/foo
mc --version
mc version RELEASE.2022-05-09T04-08-26Z
System information
I am using docker version of the the mc command. The endpoint is Amazon AWS.
Please provide outputs for the each of the command that you ran, and also provide --debug output for the mc cp command.
$ mc cp --rewind 1s --debug s3/mlad-test/foo s3/mlad-test-2/
mc: <DEBUG> GET /mlad-test/?location= HTTP/1.1
Host: s3.amazonaws.com
User-Agent: MinIO (linux; amd64) minio-go/v7.0.26 mc/RELEASE.2022-05-09T04-08-26Z
Authorization: AWS4-HMAC-SHA256 Credential=**REDACTED**/20220517/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20220517T145446Z
Accept-Encoding: gzip
mc: <DEBUG> HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: application/xml
Date: Tue, 17 May 2022 14:54:47 GMT
Server: AmazonS3
X-Amz-Id-2: fEbI10aHP1/NlSoMKnD8/9o/ZxCNjTD1ufpSCJXbeQ5kZKTP47w5AWEZnmDtajVH30vRRU0ZDfM=
X-Amz-Request-Id: HRBPT48R753E7K36
mc: <DEBUG> Response Time: 177.666172ms
mc: <DEBUG> GET /mlad-test/?delimiter=%2F&encoding-type=url&prefix=foo%2F&versions= HTTP/1.1
Host: s3.amazonaws.com
User-Agent: MinIO (linux; amd64) minio-go/v7.0.26 mc/RELEASE.2022-05-09T04-08-26Z
Authorization: AWS4-HMAC-SHA256 Credential=**REDACTED**/20220517/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20220517T145446Z
Accept-Encoding: gzip
mc: <DEBUG> HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: application/xml
Date: Tue, 17 May 2022 14:54:47 GMT
Server: AmazonS3
X-Amz-Id-2: z1cG0OtmUrt9gvGWuO1BT9ORipaMoLilHla9c/X+XvBxsAzYmSws3JDdex9qTST6e2rjL/lMksM=
X-Amz-Request-Id: HRBR16NBE9FQS373
mc: <DEBUG> Response Time: 79.307575ms
mc: <ERROR> Unable to validate source `s3/mlad-test/foo`.
$ mc mb s3/mlad-test
Bucket created successfully `s3/mlad-test`.
$ mc mb s3/mlad-test-2
Bucket created successfully `s3/mlad-test-2`.
$ touch foo
$ mc cp foo s3/mlad-test
`/aws/foo` -> `s3/mlad-test/foo`
Total: 0 B, Transferred: 0 B, Speed: 0 B/s
$ mc version enable s3/mlad-test
s3/mlad-test versioning is enabled
$ mc cp foo s3/mlad-test/foo
`/aws/foo` -> `s3/mlad-test/foo`
Total: 0 B, Transferred: 0 B, Speed: 0 B/s
$ mc ls --versions s3/mlad-test/foo
[2022-05-17 14:58:15 UTC] 0B STANDARD EuiGTX2qrwzXBMHY.94ihD6IlRAQ.UYm v13 PUT foo
[2022-05-17 14:58:13 UTC] 0B STANDARD cNIXm4wmyQz1zH9Q_H.DXj71tcDQF9V1 v12 PUT foo
[2022-05-17 12:09:05 UTC] 0B STANDARD iU5lEHPleldxS1SPDy_AZgbIObcW8bSl v11 PUT foo
[2022-05-17 12:09:02 UTC] 0B STANDARD KHUxT3BZch5SI.ZHm1qcGZLf5kdKX7YL v10 PUT foo
[2022-05-17 12:02:22 UTC] 0B STANDARD AvoY5Edikj7FOFGVnhZEBN9W5ez1U1Iq v9 PUT foo
[2022-05-17 12:01:33 UTC] 0B PWXBFfnDacs.MwFyfYmIZNJkzlkHIYZc v8 DEL foo
[2022-05-17 11:59:00 UTC] 0B STANDARD 2bkgqiaB_BDeZPf1I_xEl0T0h97Wg7oV v7 PUT foo
[2022-05-17 11:57:51 UTC] 0B STANDARD 1fDtga1xUuQ_DdtFU3HgoTRn8OdaWfLs v6 PUT foo
[2022-05-17 11:57:44 UTC] 0B STANDARD QINJ3myynHtdoXfVWCQn6MDFhI1ZxUGX v5 PUT foo
[2022-05-17 11:20:47 UTC] 0B STANDARD 0T.kKi5shaGrxr_2STSUVmza0dNqi1vx v4 PUT foo
[2022-05-17 11:12:02 UTC] 0B STANDARD CeU7mGOmCFDDO5S48rsXYc3KQNH3CNGY v3 PUT foo
[2022-05-17 10:52:46 UTC] 0B STANDARD ESRqtPzo6.vrg8wVGQMwdb245ltKtZah v2 PUT foo
[2022-05-17 10:52:44 UTC] 0B STANDARD null v1 PUT foo
@harshavardhana do you need more information?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.