aws s3 sync hangs on startup on a 7TB folder
I'm trying to sync around 7TB from a non EC2 instance to S3. So fare I have managed to sync a 500GB folder in something like 3hours. Which is quite good. When syncing a 500GB folder it takes approx 1 minutes for the uploads to start
However, I'm now trying to sync a 7TB folder and it just get stuck. It has been now over 1 hour and the debug logs are stuck here without any progress and not a single upload.
2018-06-01 18:05:05,983 - MainThread - botocore.args - DEBUG - The s3 config key is not a dictionary type, ignoring its value of: None 2018-06-01 18:05:05,987 - MainThread - botocore.endpoint - DEBUG - Setting s3 timeout as (60, 60) 2018-06-01 18:05:05,989 - MainThread - botocore.client - DEBUG - Registering retry handlers for service: s3 2018-06-01 18:05:05,989 - MainThread - botocore.client - DEBUG - Defaulting to S3 virtual host style addressing with path style addressing fallback. 2018-06-01 18:05:05,990 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Using a multipart threshold of 8388608 and a part size of 8388608 2018-06-01 18:05:05,990 - MainThread - botocore.hooks - DEBUG - Event choosing-s3-sync-strategy: calling handler <bound method SizeOnlySync.use_sync_strategy of <awscli.customizations.s3.syncstrategy.sizeonly.SizeOnlySync object at 0x7f5f42a9acd0>> 2018-06-01 18:05:05,990 - MainThread - botocore.hooks - DEBUG - Event choosing-s3-sync-strategy: calling handler <bound method ExactTimestampsSync.use_sync_strategy of <awscli.customizations.s3.syncstrategy.exacttimestamps.ExactTimestampsSync object at 0x7f5f42a9a790>> 2018-06-01 18:05:05,990 - MainThread - botocore.hooks - DEBUG - Event choosing-s3-sync-strategy: calling handler <bound method DeleteSync.use_sync_strategy of <awscli.customizations.s3.syncstrategy.delete.DeleteSync object at 0x7f5f42a9aa50>>
Is the cli having trouble listing all the files and dies? Is it somewhat running out memory ? How can I debug this?
Version: aws-cli/1.15.30
Hmm. Yeah I'm not too sure what may be causing this. The debug logs are helpful. I do not think the CLI is running out of memory because it would just error out and raise a fatal error for that. From the debug logs, the ListObjects has not been called yet. So that is telling me the slow down may be because of listing the files your in file system. Would it be possible to share how your local directory is structure that you are trying to sync? For example, is it deeply nested? Or is it primarily a flat structure? How many files do you have in this directory?
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
I am having the same issue trying to sync a local folder which contains 200,000 json files (1kb size in average). It is a flat folder, there are no sub folders. The cli hang there:
2025-11-14 16:43:29,487 - MainThread - botocore.configprovider - DEBUG - Looking for endpoint for s3 via: config_global
2025-11-14 16:43:29,487 - MainThread - botocore.configprovider - DEBUG - No configured endpoint found.
2025-11-14 16:43:29,488 - MainThread - botocore.endpoint - DEBUG - Setting s3 timeout as (60, 60)
2025-11-14 16:43:29,489 - MainThread - botocore.utils - DEBUG - Registering S3 region redirector handler
2025-11-14 16:43:29,489 - MainThread - botocore.utils - DEBUG - Registering S3Express Identity Resolver
2025-11-14 16:43:29,489 - MainThread - awscli.customizations.s3.factory - DEBUG - S3 CRT client optimized for system: False
2025-11-14 16:43:29,489 - MainThread - awscli.customizations.s3.factory - DEBUG - Auto resolved s3 transfer client to: classic
2025-11-14 16:43:29,489 - MainThread - awscli.customizations.s3.factory - DEBUG - Using a multipart threshold of 8388608 and a part size of 8388608
2025-11-14 16:43:29,490 - MainThread - botocore.hooks - DEBUG - Event choosing-s3-sync-strategy: calling handler <bound method BaseSync.use_sync_strategy of <awscli.customizations.s3.syncstrategy.sizeonly.SizeOnlySync object at 0x0000027139312F90>>
2025-11-14 16:43:29,490 - MainThread - botocore.hooks - DEBUG - Event choosing-s3-sync-strategy: calling handler <bound method BaseSync.use_sync_strategy of <awscli.customizations.s3.syncstrategy.exacttimestamps.ExactTimestampsSync object at 0x00000271393130E0>>
2025-11-14 16:43:29,490 - MainThread - botocore.hooks - DEBUG - Event choosing-s3-sync-strategy: calling handler <bound method BaseSync.use_sync_strategy of <awscli.customizations.s3.syncstrategy.delete.DeleteSync object at 0x0000027139313230>>
Here is the traceback when interrupting the cli; it looks like filegenerator.py is the issue :
Traceback (most recent call last):
File "awscli\customizations\s3\s3handler.py", line 168, in call
File "awscli\customizations\s3\fileinfobuilder.py", line 33, in call
File "awscli\customizations\s3\comparator.py", line 82, in call
File "awscli\customizations\s3\filegenerator.py", line 165, in call
File "awscli\customizations\s3\filegenerator.py", line 218, in list_files
File "awscli\customizations\s3\filegenerator.py", line 290, in should_ignore_file_with_decoding_warnings
File "awscli\customizations\s3\filegenerator.py", line 304, in should_ignore_file
File "awscli\customizations\s3\filegenerator.py", line 334, in triggers_warning
File "awscli\customizations\s3\filegenerator.py", line 69, in is_readable
File "<frozen codecs>", line 263, in __init__
KeyboardInterrupt
I tried the same command with a subset : it works when I keep only 3000 files in the folder but hang with a subset of 10,000 files.