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
Metadata (UID/GID) not set properly for multipart downloads from S3 to Unix file system #7424
Comments
I managed to replicate this Setup
Verify metadata present on s3,
Download with multipart streams: S3 metadata mising :-(
Download without multithread streams - works!
I think this is a bug in the local filesystem. In fact it will manifest with any backend which supports the So to fix this this will need a change of the The only backend which supports It also needs to be in the integration tests!
|
Before this change multipart downloads to the local disk with --metadata failed to have their metadata set properly. This was because the OpenWriterAt interface doesn't receive metadata when creating the object. This patch fixes the problem by using the recently introduced Object.SetMetadata method to set the metadata on the object after the download has completed (when using --metadata). If the backend we are copying to is using OpenWriterAt but the Object doesn't support SetMetadata then it will write an ERROR level log but complete successfully. This should not happen at the moment as only the local backend supports metadata and OpenWriterAt but it may in the future. It also adds a test to check metadata is preserved when doing multipart transfers. Fixes #7424
@ppapadopoulos I've finally found some time to fix this! I think this should work properly now - any testing much appreciated - thank you. v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata on branch fix-7424-metadata |
Heads up @rclone/support - the "Support Contract" label was applied to this issue. |
My initial testing looks good -
*1. Source on my system (I changed both the group id and the permissions
on the rclone executable*
*ls -lR
/.rcs3/rcs3/rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64*
/.rcs3/rcs3/rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64:
total 66760
-rw-r--r-- 1 root root 2638692 May 9 10:20 README.html
-rw-r--r-- 1 root root 2259587 May 9 10:20 README.txt
-rw-r--r-- 1 root root 50015 May 9 10:29 git-log.txt
-rwxr-x--- 1 root 1698224 60965016 May 9 10:32 rclone
-rw-r--r-- 1 root root 2434432 May 9 10:20 rclone.1
*2/Restored back to my system (permissions, timestamps, and group id
restored)*
*ls -lR
/tmp/tstrestore5/rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/*
/tmp/tstrestore5/rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/:
total 66760
-rw-r--r-- 1 root root 2638692 May 9 10:20 README.html
-rw-r--r-- 1 root root 2259587 May 9 10:20 README.txt
-rw-r--r-- 1 root root 50015 May 9 10:29 git-log.txt
-rwxr-x--- 1 root 1698224 60965016 May 9 10:32 rclone
-rw-r--r-- 1 root root 2434432 May 9 10:20 rclone.1
3. Log file for upload
*cat /tmp/tstupload5.log*
2024/05/10 17:26:16 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/README.html:
*Multi-thread Copied* (new)
2024/05/10 17:26:16 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/README.txt:
Multi-thread Copied (new)
2024/05/10 17:26:16 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/git-log.txt:
Copied (new)
2024/05/10 17:26:17 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/rclone.1:
Multi-thread Copied (new)
2024/05/10 17:26:21 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/rclone:
Multi-thread Copied (new)
2024/05/10 17:26:21 INFO :
Transferred: 65.181 MiB / 65.181 MiB, 100%, 13.030 MiB/s, ETA 0s
Transferred: 5 / 5, 100%
Elapsed time: 5.3s
*4. log file for download*
*cat /tmp/tstdownload5.log *
2024/05/10 17:28:00 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/README.html:
Multi-thread Copied (new)
2024/05/10 17:28:00 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/README.txt:
Multi-thread Copied (new)
2024/05/10 17:28:00 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/git-log.txt:
Copied (new)
2024/05/10 17:28:01 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/rclone.1:
Multi-thread Copied (new)
2024/05/10 17:28:04 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/rclone:
Multi-thread Copied (new)
2024/05/10 17:28:04 INFO :
Transferred: 65.181 MiB / 65.181 MiB, 100%, 16.038 MiB/s, ETA 0s
Transferred: 5 / 5, 100%
Elapsed time: 4.4s
*5. rclone command used for upload*
TSTRCLONE=/.rcs3/rcs3/rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/rclone
--config /.rcs3/rcs3/POC/config/rclone.conf --s3-shared-credentials-file
/.rcs3/rcs3/POC/config/credentials --metadata --links --transfers 2
--checkers 32
*$TSTRCLONE --multi-thread-cutoff=1M --log-file /tmp/tstupload5.log
--log-level INFO --include 'rclone-v1.67.0*/**' copy /.rcs3/rcs3
s3-backup:tstupload5*
*6. rclone command used for download*
*$TSTRCLONE --multi-thread-cutoff=1M --log-file /tmp/tstdownload5.log
--log-level INFO copy s3-backup:tstupload5 /tmp/tstrestore5*
*I will verify with a large, multi-gigabyte file, too where the built-in
cutoffs will be used.*
On Fri, May 10, 2024 at 9:48 AM Philip Michael Papadopoulos <
***@***.***> wrote:
… Thanks, Nick!
Testing today!
-Phil
On Thu, May 9, 2024 at 4:39 AM Nick Craig-Wood ***@***.***>
wrote:
> @ppapadopoulos
> <https://urldefense.com/v3/__https://github.com/ppapadopoulos__;!!CzAuKJ42GuquVTTmVmPViYEvSg!L3Nf1SlgMT1ExXqOZnOuwKXY2Jxo_Dx2fCc6vYdc8IIULZSU9UW8DCRc7cXRqHxcxRosiuzpGrL5u8G4tHNj8c9A$>
> I've finally found some time to fix this!
>
> I think this should work properly now - any testing much appreciated -
> thank you.
>
> v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata
> <https://urldefense.com/v3/__https://beta.rclone.org/branch/fix-7424-metadata/v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata/__;!!CzAuKJ42GuquVTTmVmPViYEvSg!L3Nf1SlgMT1ExXqOZnOuwKXY2Jxo_Dx2fCc6vYdc8IIULZSU9UW8DCRc7cXRqHxcxRosiuzpGrL5u8G4tDC5q6X4$>
> on branch fix-7424-metadata
> <https://urldefense.com/v3/__https://github.com/rclone/rclone/tree/fix-7424-metadata__;!!CzAuKJ42GuquVTTmVmPViYEvSg!L3Nf1SlgMT1ExXqOZnOuwKXY2Jxo_Dx2fCc6vYdc8IIULZSU9UW8DCRc7cXRqHxcxRosiuzpGrL5u8G4tI0pdL3H$>
>
> —
> Reply to this email directly, view it on GitHub
> <https://urldefense.com/v3/__https://github.com/rclone/rclone/issues/7424*issuecomment-2102498814__;Iw!!CzAuKJ42GuquVTTmVmPViYEvSg!L3Nf1SlgMT1ExXqOZnOuwKXY2Jxo_Dx2fCc6vYdc8IIULZSU9UW8DCRc7cXRqHxcxRosiuzpGrL5u8G4tJ8JWQly$>,
> or unsubscribe
> <https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAZ2STMTZASI2U7ZHHCO5Z3ZBNN7LAVCNFSM6AAAAAA7NF3IUCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBSGQ4TQOBRGQ__;!!CzAuKJ42GuquVTTmVmPViYEvSg!L3Nf1SlgMT1ExXqOZnOuwKXY2Jxo_Dx2fCc6vYdc8IIULZSU9UW8DCRc7cXRqHxcxRosiuzpGrL5u8G4tMUt0bUQ$>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
Philip Papadopoulos, Ph.D
Director, Research Cyber Infrastructure Center
University of California, Irvine
E-mail: ***@***.***
Phone: (949) 824-5343
Calendar (UCI Only): https://bit.ly/3btXoJa
--
Philip Papadopoulos, Ph.D
Director, Research Cyber Infrastructure Center
University of California, Irvine
E-mail: ***@***.***
Phone: (949) 824-5343
Calendar (UCI Only): https://bit.ly/3btXoJa
|
Confirmed with large multi-gigabyte files.
Source directory
ls -l sratest/
total 60260904
-rw------- 1 1698224 1698224 30371640658 Oct 19 2022 SRR14777101.fastq
-rw------- 1 1698224 1698224 31335513288 Oct 19 2022 SRR14777102.fastq
Restored directory
ls -l srarestore/sratest
total 60260904
-rw------- 1 1698224 1698224 30371640658 Oct 19 2022 SRR14777101.fastq
-rw------- 1 1698224 1698224 31335513288 Oct 19 2022 SRR14777102.fastq
Rclone run as the root user, so user and group properly restored
permissions are different than the default umask, so permissions are
restored properly, too.
Thanks!
Phil
On Fri, May 10, 2024 at 10:44 AM Philip Michael Papadopoulos <
***@***.***> wrote:
… My initial testing looks good -
*1. Source on my system (I changed both the group id and the permissions
on the rclone executable*
*ls -lR
/.rcs3/rcs3/rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64*
/.rcs3/rcs3/rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64:
total 66760
-rw-r--r-- 1 root root 2638692 May 9 10:20 README.html
-rw-r--r-- 1 root root 2259587 May 9 10:20 README.txt
-rw-r--r-- 1 root root 50015 May 9 10:29 git-log.txt
-rwxr-x--- 1 root 1698224 60965016 May 9 10:32 rclone
-rw-r--r-- 1 root root 2434432 May 9 10:20 rclone.1
*2/Restored back to my system (permissions, timestamps, and group id
restored)*
*ls -lR
/tmp/tstrestore5/rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/*
/tmp/tstrestore5/rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/:
total 66760
-rw-r--r-- 1 root root 2638692 May 9 10:20 README.html
-rw-r--r-- 1 root root 2259587 May 9 10:20 README.txt
-rw-r--r-- 1 root root 50015 May 9 10:29 git-log.txt
-rwxr-x--- 1 root 1698224 60965016 May 9 10:32 rclone
-rw-r--r-- 1 root root 2434432 May 9 10:20 rclone.1
3. Log file for upload
*cat /tmp/tstupload5.log*
2024/05/10 17:26:16 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/README.html:
*Multi-thread Copied* (new)
2024/05/10 17:26:16 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/README.txt:
Multi-thread Copied (new)
2024/05/10 17:26:16 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/git-log.txt:
Copied (new)
2024/05/10 17:26:17 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/rclone.1:
Multi-thread Copied (new)
2024/05/10 17:26:21 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/rclone:
Multi-thread Copied (new)
2024/05/10 17:26:21 INFO :
Transferred: 65.181 MiB / 65.181 MiB, 100%, 13.030 MiB/s, ETA 0s
Transferred: 5 / 5, 100%
Elapsed time: 5.3s
*4. log file for download*
*cat /tmp/tstdownload5.log *
2024/05/10 17:28:00 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/README.html:
Multi-thread Copied (new)
2024/05/10 17:28:00 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/README.txt:
Multi-thread Copied (new)
2024/05/10 17:28:00 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/git-log.txt:
Copied (new)
2024/05/10 17:28:01 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/rclone.1:
Multi-thread Copied (new)
2024/05/10 17:28:04 INFO :
rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/rclone:
Multi-thread Copied (new)
2024/05/10 17:28:04 INFO :
Transferred: 65.181 MiB / 65.181 MiB, 100%, 16.038 MiB/s, ETA 0s
Transferred: 5 / 5, 100%
Elapsed time: 4.4s
*5. rclone command used for upload*
TSTRCLONE=/.rcs3/rcs3/rclone-v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata-linux-amd64/rclone
--config /.rcs3/rcs3/POC/config/rclone.conf --s3-shared-credentials-file
/.rcs3/rcs3/POC/config/credentials --metadata --links --transfers 2
--checkers 32
*$TSTRCLONE --multi-thread-cutoff=1M --log-file /tmp/tstupload5.log
--log-level INFO --include 'rclone-v1.67.0*/**' copy /.rcs3/rcs3
s3-backup:tstupload5*
*6. rclone command used for download*
*$TSTRCLONE --multi-thread-cutoff=1M --log-file /tmp/tstdownload5.log
--log-level INFO copy s3-backup:tstupload5 /tmp/tstrestore5*
*I will verify with a large, multi-gigabyte file, too where the built-in
cutoffs will be used.*
On Fri, May 10, 2024 at 9:48 AM Philip Michael Papadopoulos <
***@***.***> wrote:
> Thanks, Nick!
> Testing today!
> -Phil
>
>
> On Thu, May 9, 2024 at 4:39 AM Nick Craig-Wood ***@***.***>
> wrote:
>
>> @ppapadopoulos
>> <https://urldefense.com/v3/__https://github.com/ppapadopoulos__;!!CzAuKJ42GuquVTTmVmPViYEvSg!L3Nf1SlgMT1ExXqOZnOuwKXY2Jxo_Dx2fCc6vYdc8IIULZSU9UW8DCRc7cXRqHxcxRosiuzpGrL5u8G4tHNj8c9A$>
>> I've finally found some time to fix this!
>>
>> I think this should work properly now - any testing much appreciated -
>> thank you.
>>
>> v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata
>> <https://urldefense.com/v3/__https://beta.rclone.org/branch/fix-7424-metadata/v1.67.0-beta.7927.c3eb9ca13.fix-7424-metadata/__;!!CzAuKJ42GuquVTTmVmPViYEvSg!L3Nf1SlgMT1ExXqOZnOuwKXY2Jxo_Dx2fCc6vYdc8IIULZSU9UW8DCRc7cXRqHxcxRosiuzpGrL5u8G4tDC5q6X4$>
>> on branch fix-7424-metadata
>> <https://urldefense.com/v3/__https://github.com/rclone/rclone/tree/fix-7424-metadata__;!!CzAuKJ42GuquVTTmVmPViYEvSg!L3Nf1SlgMT1ExXqOZnOuwKXY2Jxo_Dx2fCc6vYdc8IIULZSU9UW8DCRc7cXRqHxcxRosiuzpGrL5u8G4tI0pdL3H$>
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <https://urldefense.com/v3/__https://github.com/rclone/rclone/issues/7424*issuecomment-2102498814__;Iw!!CzAuKJ42GuquVTTmVmPViYEvSg!L3Nf1SlgMT1ExXqOZnOuwKXY2Jxo_Dx2fCc6vYdc8IIULZSU9UW8DCRc7cXRqHxcxRosiuzpGrL5u8G4tJ8JWQly$>,
>> or unsubscribe
>> <https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAZ2STMTZASI2U7ZHHCO5Z3ZBNN7LAVCNFSM6AAAAAA7NF3IUCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBSGQ4TQOBRGQ__;!!CzAuKJ42GuquVTTmVmPViYEvSg!L3Nf1SlgMT1ExXqOZnOuwKXY2Jxo_Dx2fCc6vYdc8IIULZSU9UW8DCRc7cXRqHxcxRosiuzpGrL5u8G4tMUt0bUQ$>
>> .
>> You are receiving this because you were mentioned.Message ID:
>> ***@***.***>
>>
>
>
> --
> Philip Papadopoulos, Ph.D
> Director, Research Cyber Infrastructure Center
> University of California, Irvine
> E-mail: ***@***.***
> Phone: (949) 824-5343
> Calendar (UCI Only): https://bit.ly/3btXoJa
>
>
--
Philip Papadopoulos, Ph.D
Director, Research Cyber Infrastructure Center
University of California, Irvine
E-mail: ***@***.***
Phone: (949) 824-5343
Calendar (UCI Only): https://bit.ly/3btXoJa
--
Philip Papadopoulos, Ph.D
Director, Research Cyber Infrastructure Center
University of California, Irvine
E-mail: ***@***.***
Phone: (949) 824-5343
Calendar (UCI Only): https://bit.ly/3btXoJa
|
Thank you for testing @ppapadopoulos I've merged this to master now which means it will be in the latest beta in 15-30 minutes and released in v1.67 If you need anything else please drop us an email :-) |
The associated forum post URL from
https://forum.rclone.org
https://forum.rclone.org/t/uid-gid-not-restored-for-objects-stored-in-glacier/42885/3
What is the problem you are having with rclone?
When downloading large files (larger than --multi-thread-cutoff), date,permissions are set properly, but UID/GID is NOT set properly.
Setting the --multi-thread-cutoff to be larger than the file size (forcing single thread), results in proper metadata
What is your rclone version (output from
rclone version
)Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
Rocky Linux 8.8
Which cloud storage system are you using? (e.g. Google Drive)
Amazon S3
The command you were trying to run (e.g.
rclone copy /tmp remote:tmp
)rclone copy
A log from the command with the
-vv
flag (e.g. output fromrclone -vv copy /tmp remote:tmp
)Steps Reproduce
Details:
How to use GitHub
The text was updated successfully, but these errors were encountered: