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

s3_sync etag calculation is wrong because use hardcoded chunk_size #272

Closed
GiuseppeChiesa-TomTom opened this issue Oct 21, 2020 · 0 comments · Fixed by #273
Closed

s3_sync etag calculation is wrong because use hardcoded chunk_size #272

GiuseppeChiesa-TomTom opened this issue Oct 21, 2020 · 0 comments · Fixed by #273

Comments

@GiuseppeChiesa-TomTom
Copy link
Contributor

SUMMARY

The s3_sync module reports wrong etags compared to the one calculated from AWS S3 on server side.
The etag algorithm is based on the chunk_size used during multipart upload. The s3_sync module uses the boto3 defaults for the S3 Transfer, but the function that calculates the local etags does not use those defaults (it uses an hardcoded value instead)

ISSUE TYPE
  • Bug Report
COMPONENT NAME

plugins/modules/s3_sync.py

ANSIBLE VERSION
ansible 2.10.2
  config file = None
  configured module search path = ['/Users/chiesa/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/chiesa/.local/pipx/venvs/ansible/lib/python3.8/site-packages/ansible
  executable location = /Users/chiesa/.local/bin/ansible
  python version = 3.8.2 (default, May  1 2020, 13:24:17) [Clang 11.0.3 (clang-1103.0.32.59)]
CONFIGURATION

no changes

OS / ENVIRONMENT

Mac OS 10.15.7

STEPS TO REPRODUCE

Upload some folder with s3_sync module and compare the local_etag calculated by the module with the S3 remote tags (calculated with the chunk_size used by boto3 - underlying library to tranfer the file)

EXPECTED RESULTS

The local_etags of the file just uploaded should match the etags on S3

ACTUAL RESULTS

The local_etags of the files just uploaded are mismatching S3 etags due to the wrong chunk_size hardcoded in the module:

DEFAULT_CHUNK_SIZE = 5 * 1024 * 1024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant