core icon indicating copy to clipboard operation
core copied to clipboard

Static Push can not push to some regions

Open chrismccracken opened this issue 9 years ago • 11 comments

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

chrismccracken avatar Aug 07 '17 16:08 chrismccracken

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.

chrismccracken avatar Aug 07 '17 16:08 chrismccracken

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)

oarrietadotcms avatar Aug 07 '17 17:08 oarrietadotcms

might be related to https://github.com/dotCMS/core/issues/12187

brentgriffin avatar Aug 08 '17 15:08 brentgriffin

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

nollymar avatar Aug 11 '17 05:08 nollymar

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

nollymar avatar Aug 11 '17 16:08 nollymar

PR Core (master): https://github.com/dotCMS/core/pull/12324 PR Enterprise (master): https://github.com/dotCMS/enterprise-2.x/pull/503

dsilvam avatar Aug 11 '17 18:08 dsilvam

Passed QA. Successfully pushed content to different regions such as us-east-2 / us-west-2 / ca-central-1 / sa-east-1

shaydotcms avatar Aug 21 '17 13:08 shaydotcms

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

nollymar avatar Aug 28 '17 23:08 nollymar

PR core (master): https://github.com/dotCMS/core/pull/12448 PR ee (master): https://github.com/dotCMS/enterprise-2.x/pull/523

dsilvam avatar Aug 29 '17 18:08 dsilvam

Note to QA: Retest this after upgrade of Hazelcast

dsilvam avatar Sep 12 '17 15:09 dsilvam

Passed QA. Successfully pushed after Hazelcast upgrade to different regions such as us-east-2 / us-west-2 / ca-central-1 / sa-east-1

shaydotcms avatar Sep 19 '17 14:09 shaydotcms