Static Push can not push to some regions
Static configuration as follows:
aws_access_key=<REDACTED>
aws_secret_access_key=<REDACTED>
aws_bucket_name=prod-ohio-static.<REDACTED>.dotcmscloud.com
aws_bucket_region=us-east-2
https://gist.github.com/chrismccracken/cde1973cf86af04d920d6096dd7420ba
Also, in this case the Static Published kept aggressively trying to republish even though it was never going to success. Error handling behavior is tough to get perfect, but in this case where we get a 400 from the AWS S3 API it should just fail.
I think the problem could be that we are creating a AmazonS3Client without specifying the Region and then the headBucket method says that:
... if the bucket is in a different region than the client is configured with
We can use this method: setRegion(Region region)
might be related to https://github.com/dotCMS/core/issues/12187
To solve this issue I had to tackle 2 problems:
-
Upgrade the aws sdk to version 1.11.66 which supports pushing to us-east-2 and at the same time we needed to ensure compatibility with elasticsearch-cloud-aws (which uses a minor aws sdk - 1.10.22). The fix required to repackage aws sdk 1.11.66 libraries.
-
Solve the error 400 Bad Request reported in this ticket. It was an intermittent error caused by aws stale reads. For further info please check these links: https://github.com/prestodb/presto/issues/7807 http://docs.aws.amazon.com/AmazonS3/latest/dev/Introduction.html#ConsistencyModel
Some improvements in our logic was required. Hopefully, it will improve the performance as well.
PR Core P8: https://github.com/dotCMS/core/pull/12320 PR Enterprise P8: https://github.com/dotCMS/enterprise-2.x/pull/502 PR dotcms-libs: https://github.com/dotCMS/dotcms-libs/pull/31
Important for testing: Different static push scenarios where content is pushed to:
- Several endpoints in different regions, including us-east-2
- Endpoints with non-existing/existing buckets
Also, please consider to push more than one host and multilingual content
PR Core (master): https://github.com/dotCMS/core/pull/12324 PR Enterprise (master): https://github.com/dotCMS/enterprise-2.x/pull/503
Passed QA. Successfully pushed content to different regions such as us-east-2 / us-west-2 / ca-central-1 / sa-east-1
A new change was required to solve this problem: https://github.com/elastic/elasticsearch-cloud-aws/issues/242
PR Core P8: https://github.com/dotCMS/core/pull/12446 PR Enterprise P8: https://github.com/dotCMS/enterprise-2.x/pull/522
It also fixes these issues: https://github.com/dotCMS/core/issues/12429 https://github.com/dotCMS/core/issues/12430
PR core (master): https://github.com/dotCMS/core/pull/12448 PR ee (master): https://github.com/dotCMS/enterprise-2.x/pull/523
Note to QA: Retest this after upgrade of Hazelcast
Passed QA. Successfully pushed after Hazelcast upgrade to different regions such as us-east-2 / us-west-2 / ca-central-1 / sa-east-1