aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.58k stars 4.14k forks source link

aws cli s3 client fails to download restored Glacier objects recursively #5268

Closed cfurst closed 3 years ago

cfurst commented 4 years ago

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug After requesting a file restore via the python sdk, confirming in the console that objects are temporarily restored, the aws cli throws errors saying the objects are being skipped because they are in Glacier when doing a sync or a recursive copy down onto local machine

SDK version number aws-cli/2.0.17 Python/3.7.7 Windows/10 botocore/2.0.0dev21

Platform/OS/Hardware/Device Windows 10 on a dell Lattitude

To Reproduce (observed behavior) place a lifecycle on a bucket that put objects in Glacier storage tier after a specific number of days. Use the boto3 python sdk to make a bulk file restore from glacier. This is assuming you have a number of files in a folder in s3. After the restore is complete, try to recursively copy the folder down, or try to do a sync of the folder to the local machine.

Expected behavior The restored files should be downloaded and not skipped

Logs/output

<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>cfurst-mybooklive-bkup</Name><Prefix>VAAS/</Prefix><KeyCount>20</KeyCount><MaxKeys>1000</MaxKeys><EncodingType>url</EncodingType><IsTruncated>false</IsTruncated><Contents><Key>VAAS/.DS_Store</Key><LastModified>2018-09-13T05:41:53.000Z</LastModified><ETag>&quot;d9c30ea93b0b11342e8f8958f42a18af&quot;</ETag><Size>8196</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/._.DS_Store</Key><LastModified>2018-09-13T05:41:53.000Z</LastModified><ETag>&quot;9d9f91a311e7b8c3df43c5c8c2b2ee7c&quot;</ETag><Size>4096</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/.classpath</Key><LastModified>2018-09-13T05:41:53.000Z</LastModified><ETag>&quot;b6a93daa804c3baca798cada05acf7fa&quot;</ETag><Size>761</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/.project</Key><LastModified>2018-09-13T05:41:53.000Z</LastModified><ETag>&quot;9c68a5854a84e9a687d5b92fc4c3d155&quot;</ETag><Size>533</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/.settings/org.eclipse.jdt.core.prefs</Key><LastModified>2018-09-13T05:41:54.000Z</LastModified><ETag>&quot;521aa41e3fa38901b9964f2aa61ceebf&quot;</ETag><Size>652</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/.settings/org.eclipse.m2e.core.prefs</Key><LastModified>2018-09-13T05:41:54.000Z</LastModified><ETag>&quot;b662ec9b2a9e308f5ae8e4b034ea7799&quot;</ETag><Size>86</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/pom.xml</Key><LastModified>2018-09-13T05:41:54.000Z</LastModified><ETag>&quot;61c8ace1151b74f8bce7b77474617dc0&quot;</ETag><Size>1068</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/src/.DS_Store</Key><LastModified>2018-09-13T05:41:54.000Z</LastModified><ETag>&quot;460962ab8103203e2c52fabe0bb1179d&quot;</ETag><Size>8196</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/src/._.DS_Store</Key><LastModified>2018-09-13T05:41:55.000Z</LastModified><ETag>&quot;5f09fcc542fd3307e7a244a736f684ff&quot;</ETag><Size>4096</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/src/com/.DS_Store</Key><LastModified>2018-09-13T05:41:55.000Z</LastModified><ETag>&quot;015a52bf1406480693a4278e08f5dfae&quot;</ETag><Size>8196</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/src/com/._.DS_Store</Key><LastModified>2018-09-13T05:41:55.000Z</LastModified><ETag>&quot;62f8e66176e343d748df4c8465bca555&quot;</ETag><Size>4096</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/src/com/seefurst/.DS_Store</Key><LastModified>2018-09-13T05:41:56.000Z</LastModified><ETag>&quot;aff52fb7336196c72e004e4811c084bf&quot;</ETag><Size>8196</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/src/com/seefurst/._.DS_Store</Key><LastModified>2018-09-13T05:41:56.000Z</LastModified><ETag>&quot;505668a9d3d5504541e6a6cfd620667c&quot;</ETag><Size>4096</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/src/com/seefurst/VAAS/.DS_Store</Key><LastModified>2018-09-13T05:41:57.000Z</LastModified><ETag>&quot;bb182f66f50bb34bfe025777be419a8f&quot;</ETag><Size>8196</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/src/com/seefurst/VAAS/._.DS_Store</Key><LastModified>2018-09-13T05:41:57.000Z</LastModified><ETag>&quot;7c8a7a9ff75cff5285c7285ea069565f&quot;</ETag><Size>4096</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/src/com/seefurst/VAAS/poc/VAASPoc.java</Key><LastModified>2018-09-13T05:41:58.000Z</LastModified><ETag>&quot;1e0cdbc9d5f3aab506610b4a00350fe1&quot;</ETag><Size>229</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/target/classes/META-INF/MANIFEST.MF</Key><LastModified>2018-09-13T05:42:00.000Z</LastModified><ETag>&quot;c005ede4777f16ec0462a35119b85d19&quot;</ETag><Size>106</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/target/classes/META-INF/maven/VAAS/VAAS/pom.properties</Key><LastModified>2018-09-13T05:42:00.000Z</LastModified><ETag>&quot;2044b02422cdae6065efe6ba575b70d5&quot;</ETag><Size>195</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/target/classes/META-INF/maven/VAAS/VAAS/pom.xml</Key><LastModified>2018-09-13T05:42:00.000Z</LastModified><ETag>&quot;61c8ace1151b74f8bce7b77474617dc0&quot;</ETag><Size>1068</Size><StorageClass>GLACIER</StorageClass></Contents><Contents><Key>VAAS/target/classes/com/seefurst/VAAS/poc/VAASPoc.class</Key><LastModified>2018-09-13T05:42:01.000Z</LastModified><ETag>&quot;7da4007cc8212e441a35ed60b31b05eb&quot;</ETag><Size>408</Size><StorageClass>GLACIER</StorageClass></Contents></ListBucketResult>'
2020-06-04 23:54:24,980 - MainThread - botocore.hooks - DEBUG - Event needs-retry.s3.ListObjectsV2: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x0000017CC437FB48>>
2020-06-04 23:54:24,980 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2020-06-04 23:54:24,996 - MainThread - botocore.hooks - DEBUG - Event needs-retry.s3.ListObjectsV2: calling handler <bound method S3RegionRedirector.redirect_from_error of <botocore.utils.S3RegionRedirector object at 0x0000017CC437F6C8>>
2020-06-04 23:54:24,996 - MainThread - botocore.utils - DEBUG - S3 request was previously redirected, not redirecting.
2020-06-04 23:54:24,996 - MainThread - botocore.hooks - DEBUG - Event after-call.s3.ListObjectsV2: calling handler <function decode_list_object_v2 at 0x0000017CC29CB1F8>
2020-06-04 23:54:24,996 - MainThread - botocore.hooks - DEBUG - Event after-call.s3.ListObjectsV2: calling handler <function enhance_error_msg at 0x0000017CC3D8B1F8>
2020-06-04 23:54:24,996 - MainThread - botocore.hooks - DEBUG - Event after-call.s3.ListObjectsV2: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x0000017CC437F508>>
2020-06-04 23:54:25,012 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/.DS_Store. Not performing download on object.
2020-06-04 23:54:25,012 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/._.DS_Store. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/.DS_Store. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,012 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/.classpath. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/._.DS_Store. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,012 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/.project. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/.classpath. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,012 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/.settings/org.eclipse.jdt.core.prefs. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/.project. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,012 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/.settings/org.eclipse.m2e.core.prefs. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/.settings/org.eclipse.jdt.core.prefs. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,027 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/pom.xml. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/.settings/org.eclipse.m2e.core.prefs. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,027 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/src/.DS_Store. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/pom.xml. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,027 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/src/._.DS_Store. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/src/.DS_Store. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,043 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/src/com/.DS_Store. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/src/._.DS_Store. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,043 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/src/com/._.DS_Store. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/src/com/.DS_Store. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,043 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/src/com/seefurst/.DS_Store. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/src/com/._.DS_Store. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,043 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/src/com/seefurst/._.DS_Store. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/src/com/seefurst/.DS_Store. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,043 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/src/com/seefurst/VAAS/.DS_Store. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/src/com/seefurst/._.DS_Store. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,043 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/src/com/seefurst/VAAS/._.DS_Store. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/src/com/seefurst/VAAS/.DS_Store. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,058 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/src/com/seefurst/VAAS/poc/VAASPoc.java. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/src/com/seefurst/VAAS/._.DS_Store. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,058 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/target/classes/META-INF/MANIFEST.MF. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/src/com/seefurst/VAAS/poc/VAASPoc.java. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,058 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/target/classes/META-INF/maven/VAAS/VAAS/pom.properties. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/target/classes/META-INF/MANIFEST.MF. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,074 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/target/classes/META-INF/maven/VAAS/VAAS/pom.xml. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/target/classes/META-INF/maven/VAAS/VAAS/pom.properties. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
2020-06-04 23:54:25,074 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Encountered glacier object s3://cfurst-mybooklive-bkup/VAAS/target/classes/com/seefurst/VAAS/poc/VAASPoc.class. Not performing download on object.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/target/classes/META-INF/maven/VAAS/VAAS/pom.xml. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
warning: Skipping file s3://cfurst-mybooklive-bkup/VAAS/target/classes/com/seefurst/VAAS/poc/VAASPoc.class. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.

2020-06-04 23:54:25,074 - Thread-1 - awscli.customizations.s3.results - DEBUG - Shutdown request received in result processing thread, shutting down result thread.

Additional context All the files above have a temporary restore in place.. that expires June 17th.

cfurst commented 4 years ago

This also happens when copying object from bucket to bucket which according to the docs is the way to move files out of the glacier tier.

cfurst commented 4 years ago

However when I copy individual objects down from s3 using the cli, they copy fine, whether they are Glacier objects or not.

cfurst commented 4 years ago

for example here is a head-object call from the cli on VAAS/pom.xml

{
    "AcceptRanges": "bytes",
    "Restore": "ongoing-request=\"false\", expiry-date=\"Thu, 18 Jun 2020 00:00:00 GMT\"",
    "LastModified": "2018-09-13T05:41:54+00:00",
    "ContentLength": 1068,
    "ETag": "\"61c8ace1151b74f8bce7b77474617dc0\"",
    "ContentType": "application/xml",
    "Metadata": {},
    "StorageClass": "GLACIER"
}

Notice the restore field says that it has been restored and should be accessable until the 18th of June GMT (June 17th 20:00:00 local time). These requests happened on the 4th.

KaibaLopez commented 4 years ago

Hi @cfurst , So, because glacier's restore nature this will take me a while to replicate, in the mean time though, can you try adding these options to your cli command calls? --ignore-glacier-warnings Or --force-glacier-transfer Let me know if those worked for you, it does seem weird to me that the single ones are working, but I won't know more until I test it.

Also, can you show me the command you're using on CLI? I'm assuming you're using aws s3 cp, but I don't think I saw it on your previous comments and it'd be better if I can know exactly what you are trying to do (no private info tho).

cfurst commented 4 years ago

Hey @KaibaLopez

Thanks for the tips, I'll give those a try! In the meantime here are some of the aws cli calls I made regarding the above:

Copy restored folder to local (this is in PowerShell): aws --debug s3 cp --recursive s3://cfurst-mybooklive-bkup/VAAS . Sync: aws --debug s3 sync s3://cfurst-mybooklive-bkup/VAAS . Bucket to bucket: aws s3 cp --recursive s3://cfurst-mybooklive-bkup/VASS s3://cfurst-mybooklive-restore This is a file I copied locally that was never restored: aws s3 cp "s3://cfurst-mybooklive-bkup/2013 gift cards - Thanksgiving/Amazon-Gift-Card-anne.pdf" . Head object on the above:

 aws s3api head-object --bucket cfurst-mybooklive-bkup --key "2013 gift cards - Thanksgiving/Amazon-Gift-Card-anne.pdf"
{
    "AcceptRanges": "bytes",
    "Restore": "ongoing-request=\"false\", expiry-date=\"Thu, 18 Jun 2020 00:00:00 GMT\"",
    "LastModified": "2018-09-13T03:59:35+00:00",
    "ContentLength": 216536,
    "ETag": "\"c8fe8d7897448d1dbeba8884c9f1e6cf\"",
    "ContentType": "application/pdf",
    "Metadata": {},
    "StorageClass": "GLACIER"
}

and here is the debug version of the copy without the auth stuff and other HEAD calls etc..

 PS C:\Users\Carl Yamamoto-Furst> aws --debug s3 cp "s3://cfurst-mybooklive-bkup/2013 gift cards - Thanksgiving/Amazon-Gift-Card-anne.pdf" .

...

2020-06-07 20:59:25,681 - ThreadPoolExecutor-0_0 - botocore.auth - DEBUG - CanonicalRequest:
GET
/2013%20gift%20cards%20-%20Thanksgiving/Amazon-Gift-Card-anne.pdf

host:cfurst-mybooklive-bkup.s3.amazonaws.com
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20200608T005925Z

host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2020-06-07 20:59:25,687 - ThreadPoolExecutor-0_0 - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20200608T005925Z
20200608/us-east-1/s3/aws4_request
302add85aeb6c3121f12e387a8099c18fda1956804be3467435399fbc1165d3f
2020-06-07 20:59:25,689 - ThreadPoolExecutor-0_0 - botocore.auth - DEBUG - Signature:
c8f763e11b098197356d025fd08da07c80ada03539daa64af7ae5d4a1fdb1a84
2020-06-07 20:59:25,690 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event request-created.s3.GetObject: calling handler <function signal_transferring at 0x0000015BF36E49D8>
2020-06-07 20:59:25,691 - ThreadPoolExecutor-0_0 - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=True, method=GET, url=https://cfurst-mybooklive-bkup.s3.amazonaws.com/2013%20gift%20cards%20-%20Thanksgiving/Amazon-Gift-Card-anne.pdf, headers={'User-Agent': b'aws-cli/2.0.17 Python/3.7.7 Windows/10 botocore/2.0.0dev21', 'X-Amz-Date': b'20200608T005925Z', 'X-Amz-Content-SHA256': b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': b'AWS4-HMAC-SHA256...'}>
2020-06-07 20:59:25,693 - ThreadPoolExecutor-0_0 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): cfurst-mybooklive-bkup.s3.amazonaws.com:443
2020-06-07 20:59:26,015 - ThreadPoolExecutor-0_0 - urllib3.connectionpool - DEBUG - https://cfurst-mybooklive-bkup.s3.amazonaws.com:443 "GET /2013%20gift%20cards%20-%20Thanksgiving/Amazon-Gift-Card-anne.pdf HTTP/1.1" 400 None
2020-06-07 20:59:26,017 - ThreadPoolExecutor-0_0 - botocore.parsers - DEBUG - Response headers: {'x-amz-request-id': '2439F8140BDCE931', 'x-amz-id-2': '2SJdkmz0bGXLXRsInpPOJJ83LCzPnZP+MRF+DeTkNNE2/wdtq6CzCV8PGSWp8VqI0pwWVYxqxV0=', 'Content-Type': 'application/xml', 'Transfer-Encoding': 'chunked', 'Date': 'Mon, 08 Jun 2020 00:59:25 GMT', 'Connection': 'close', 'Server': 'AmazonS3'}
2020-06-07 20:59:26,020 - ThreadPoolExecutor-0_0 - botocore.parsers - DEBUG - Response body:
b'<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header is malformed; the region \'us-east-1\' is wrong; expecting \'us-west-2\'</Message><Region>us-west-2</Region><RequestId>2439F8140BDCE931</RequestId><HostId>2SJdkmz0bGXLXRsInpPOJJ83LCzPnZP+MRF+DeTkNNE2/wdtq6CzCV8PGSWp8VqI0pwWVYxqxV0=</HostId></Error>'
2020-06-07 20:59:26,028 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event needs-retry.s3.GetObject: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x0000015BF4867948>>
2020-06-07 20:59:26,029 - ThreadPoolExecutor-0_0 - botocore.retries.standard - DEBUG - Not retrying request.
2020-06-07 20:59:26,033 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event needs-retry.s3.GetObject: calling handler <bound method S3RegionRedirector.redirect_from_error of <botocore.utils.S3RegionRedirector object at 0x0000015BF4867508>>
2020-06-07 20:59:26,035 - ThreadPoolExecutor-0_0 - botocore.utils - DEBUG - S3 client configured for region aws-global but the bucket cfurst-mybooklive-bkup is in region us-west-2; Please configure the proper region to avoid multiple unnecessary redirects and signing attempts.
2020-06-07 20:59:26,036 - ThreadPoolExecutor-0_0 - botocore.utils - DEBUG - Updating URI from https://s3.amazonaws.com/cfurst-mybooklive-bkup/2013%20gift%20cards%20-%20Thanksgiving/Amazon-Gift-Card-anne.pdf to https://s3.us-west-2.amazonaws.com/cfurst-mybooklive-bkup/2013%20gift%20cards%20-%20Thanksgiving/Amazon-Gift-Card-anne.pdf
2020-06-07 20:59:26,037 - ThreadPoolExecutor-0_0 - botocore.endpoint - DEBUG - Response received to retry, sleeping for 0 seconds
2020-06-07 20:59:26,039 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event request-created.s3.GetObject: calling handler <function signal_not_transferring at 0x0000015BF36E4948>
2020-06-07 20:59:26,040 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event request-created.s3.GetObject: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x0000015BF4815748>>
2020-06-07 20:59:26,041 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event choose-signer.s3.GetObject: calling handler <function set_operation_specific_signer at 0x0000015BF30EEAF8>
2020-06-07 20:59:26,046 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event before-sign.s3.GetObject: calling handler <bound method S3EndpointSetter.set_endpoint of <botocore.utils.S3EndpointSetter object at 0x0000015BF4867C48>>
2020-06-07 20:59:26,048 - ThreadPoolExecutor-0_0 - botocore.utils - DEBUG - Checking for DNS compatible bucket for: https://s3.us-west-2.amazonaws.com/cfurst-mybooklive-bkup/2013%20gift%20cards%20-%20Thanksgiving/Amazon-Gift-Card-anne.pdf
2020-06-07 20:59:26,049 - ThreadPoolExecutor-0_0 - botocore.utils - DEBUG - URI updated to: https://cfurst-mybooklive-bkup.s3.us-west-2.amazonaws.com/2013%20gift%20cards%20-%20Thanksgiving/Amazon-Gift-Card-anne.pdf
2020-06-07 20:59:26,051 - ThreadPoolExecutor-0_0 - botocore.auth - DEBUG - Calculating signature using v4 auth.
2020-06-07 20:59:26,052 - ThreadPoolExecutor-0_0 - botocore.auth - DEBUG - CanonicalRequest:
GET
/2013%20gift%20cards%20-%20Thanksgiving/Amazon-Gift-Card-anne.pdf

host:cfurst-mybooklive-bkup.s3.us-west-2.amazonaws.com
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20200608T005926Z

host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2020-06-07 20:59:26,053 - ThreadPoolExecutor-0_0 - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20200608T005926Z
20200608/us-west-2/s3/aws4_request
bc7cdc9ae5d176afc3fa8ffca7aebcd9b927f622128249e3481ae0a5db8beabb
2020-06-07 20:59:26,059 - ThreadPoolExecutor-0_0 - botocore.auth - DEBUG - Signature:
bbb3578b1035e914b2f2ffe6568dcdf4a3d514812e1b58ff418ec31546e3fe64
2020-06-07 20:59:26,060 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event request-created.s3.GetObject: calling handler <function signal_transferring at 0x0000015BF36E49D8>
2020-06-07 20:59:26,062 - ThreadPoolExecutor-0_0 - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=True, method=GET, url=https://cfurst-mybooklive-bkup.s3.us-west-2.amazonaws.com/2013%20gift%20cards%20-%20Thanksgiving/Amazon-Gift-Card-anne.pdf, headers={'User-Agent': b'aws-cli/2.0.17 Python/3.7.7 Windows/10 botocore/2.0.0dev21', 'X-Amz-Date': b'20200608T005926Z', 'X-Amz-Content-SHA256': b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': b'AWS4-HMAC-SHA256 ...'}>
2020-06-07 20:59:26,064 - ThreadPoolExecutor-0_0 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): cfurst-mybooklive-bkup.s3.us-west-2.amazonaws.com:443
2020-06-07 20:59:26,496 - ThreadPoolExecutor-0_0 - urllib3.connectionpool - DEBUG - https://cfurst-mybooklive-bkup.s3.us-west-2.amazonaws.com:443 "GET /2013%20gift%20cards%20-%20Thanksgiving/Amazon-Gift-Card-anne.pdf HTTP/1.1" 200 216536
2020-06-07 20:59:26,497 - ThreadPoolExecutor-0_0 - botocore.parsers - DEBUG - Response headers: {'x-amz-id-2': '/UEe3yUXXjJps1aVxfTEtkFLpf6dJ2E+6s9Coufq1WWqSlOX+5UDld8Q20/MDDVOpisfe1HNf9g=', 'x-amz-request-id': 'FFF7EFF0DC213E4D', 'Date': 'Mon, 08 Jun 2020 00:59:26 GMT', 'Last-Modified': 'Thu, 13 Sep 2018 03:59:35 GMT', 'x-amz-restore': 'ongoing-request="false", expiry-date="Thu, 18 Jun 2020 00:00:00 GMT"', 'ETag': '"c8fe8d7897448d1dbeba8884c9f1e6cf"', 'x-amz-storage-class': 'GLACIER', 'Accept-Ranges': 'bytes', 'Content-Type': 'application/pdf', 'Content-Length': '216536', 'Server': 'AmazonS3'}
2020-06-07 20:59:26,498 - ThreadPoolExecutor-0_0 - botocore.parsers - DEBUG - Response body:
<botocore.response.StreamingBody object at 0x0000015BF4B47308>
2020-06-07 20:59:26,504 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event needs-retry.s3.GetObject: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x0000015BF4867948>>
2020-06-07 20:59:26,505 - ThreadPoolExecutor-0_0 - botocore.retries.standard - DEBUG - Not retrying request.
2020-06-07 20:59:26,506 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event needs-retry.s3.GetObject: calling handler <bound method S3RegionRedirector.redirect_from_error of <botocore.utils.S3RegionRedirector object at 0x0000015BF4867508>>
2020-06-07 20:59:26,507 - ThreadPoolExecutor-0_0 - botocore.utils - DEBUG - S3 request was previously redirected, not redirecting.
2020-06-07 20:59:26,508 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event after-call.s3.GetObject: calling handler <function enhance_error_msg at 0x0000015BF44BB288>
2020-06-07 20:59:26,510 - ThreadPoolExecutor-0_0 - botocore.hooks - DEBUG - Event after-call.s3.GetObject: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x0000015BF4867348>>
2020-06-07 20:59:26,761 - ThreadPoolExecutor-0_0 - s3transfer.tasks - DEBUG - IOWriteTask(transfer_id=0, {'offset': 0}) about to wait for the following futures []
2020-06-07 20:59:26,762 - ThreadPoolExecutor-0_0 - s3transfer.tasks - DEBUG - IOWriteTask(transfer_id=0, {'offset': 0}) done waiting for dependent futures
2020-06-07 20:59:26,765 - ThreadPoolExecutor-0_0 - s3transfer.tasks - DEBUG - Executing task IOWriteTask(transfer_id=0, {'offset': 0}) with kwargs {'fileobj': <s3transfer.utils.DeferredOpenFile object at 0x0000015BF4AC8808>, 'offset': 0}
2020-06-07 20:59:26,768 - ThreadPoolExecutor-0_0 - s3transfer.tasks - DEBUG - IORenameFileTask(transfer_id=0, {'final_filename': 'C:\\Users\\Carl Yamamoto-Furst\\Amazon-Gift-Card-anne.pdf'}) about to wait for the following futures []
2020-06-07 20:59:26,769 - ThreadPoolExecutor-0_0 - s3transfer.tasks - DEBUG - IORenameFileTask(transfer_id=0, {'final_filename': 'C:\\Users\\Carl Yamamoto-Furst\\Amazon-Gift-Card-anne.pdf'}) done waiting for dependent futures
2020-06-07 20:59:26,771 - ThreadPoolExecutor-0_0 - s3transfer.tasks - DEBUG - Executing task IORenameFileTask(transfer_id=0, {'final_filename': 'C:\\Users\\Carl Yamamoto-Furst\\Amazon-Gift-Card-anne.pdf'}) with kwargs {'fileobj': <s3transfer.utils.DeferredOpenFile object at 0x0000015BF4AC8808>, 'final_filename': 'C:\\Users\\Carl Yamamoto-Furst\\Amazon-Gift-Card-anne.pdf', 'osutil': <s3transfer.utils.OSUtils object at 0x0000015BF4AC2488>}
2020-06-07 20:59:26,863 - ThreadPoolExecutor-0_0 - s3transfer.utils - DEBUG - Releasing acquire 0/None
download: s3://cfurst-mybooklive-bkup/2013 gift cards - Thanksgiving/Amazon-Gift-Card-anne.pdf to .\Amazon-Gift-Card-anne.pdf
2020-06-07 20:59:26,868 - Thread-1 - awscli.customizations.s3.results - DEBUG - Shutdown request received in result processing thread, shutting down result thread.
PS C:\Users\Carl Yamamoto-Furst>
cfurst commented 4 years ago

Upon further examination it looks like the Thanksgiving file I downloaded seems to have been restored. I don't recall restoring it, but that makes the case where downloading a single file can be done even though it's in Glacier false. Let me see if I can reproduce with something the console says is still in Glacier and not restored.

Sorry for the confusion.

cfurst commented 4 years ago

OK confimed that the single file case was false:

PS C:\Users\Carl Yamamoto-Furst> aws s3 cp "s3://cfurst-mybooklive-bkup/Downloads/PallasadesStatePark.pdf.pdf" .
warning: Skipping file s3://cfurst-mybooklive-bkup/Downloads/PallasadesStatePark.pdf.pdf. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 download help for additional parameter options to ignore or force these transfers.

This file was reported in the console as not being restored and yep, it can't be downloaded. So we can ignore that case for now and focus on recursive copying of restored files.

Again, apologies for the confusion.

KaibaLopez commented 4 years ago

Hi @cfurst , I've dug around a bit, and I've got some bad news. This seems to be a service limitation, which means that it is not something we can fix directly from the CLI... I'll keep it as a Feature request and escalate this, but yea, keep in mind this will probably take a while. And I guess the best workaround I can think of for now is trying single downloads. Sorry I couldn't be more helpful and thanks for bringing this up to us.

cfurst commented 4 years ago

Hi @KaibaLopez ! I apologize for the late replay I tried to use --force-glacier-transfer and it worked! Thanks for the tip, but I'm curious, can you tell me what that does? Does that force the transfer of a Glacier object whether or not the restore is in place? Do you pay more for that kind of transfer?

kdaily commented 3 years ago

Hi @cfurst, this closed issue should give you the context regarding what the parameter does, as it looks like the same thing prompted the addition of the --force-glacier-transfer parameter:

https://github.com/aws/aws-cli/issues/1699

I do not believe that there is any difference in cost once an object is restored from Glacier.