Static push to S3 is broken in 5.0.0
Static push to S3 creates zero length files
Expected Behavior
Files should be published to the S3 bucket
Current Behavior
The files are created but they have no content, all of them are zero length files.

Possible Solution
Known Workarounds
Steps to Reproduce (for bugs)
- Setup a vanilla dotCMS 5.0.0
- Install PLATFORM license
- Create an S3 bucket and an IAM user with full permissions on that bucket
- Configure this bucket as a dotCMS static push endpoint
- Attempt to push any content
- Check the files in the S3 buckets, the structure and the files are there but they are zero length files
Context
Your Environment
- dotCMS version used:
- Browser Name and version: Firefox 61.0.2
- Operating System and version: MacOS High Sierra 10.13.6
- Application Server and version: Embedded tomcat
- Java Brand and version: OpenJDK 1.8.171
- Database and version: default embedded H2DB
Client ticket: https://dotcms.zendesk.com/agent/tickets/96444
@oarrietadotcms @vianneychacon this is almost a non-issue. What is happening is that no language-id is specified in the endpoint config and the english page versions get written with content and then are overwritten by the 0 length spanish page versions. The "fix" is to use one of the language variables in your bucket name or bucket prefix to separate out the english from the spanish sites. From an R&D perspective, we can check to see if there is any language set and if not and the site has multiple languages, only publish the default language.
Make sure to check like this pseudo code
(aws_bucket_folder_prefix or aws_bucket_name) contains ( {languageIso} or {languageId} or {languageCountry})
FWIW we saw this config working in 4.x aws keys/secret aws_bucket_name=aws-s3-xxxxxx aws_bucket_folder_prefix=sandbox-{hostname}-{hostId} aws_bucket_region=us-east-1
Did they have multiple langauges in their installation?
Also have they changed their language fallback settings in any way?
Looking at some things and asking what is happening on AWS side. Give me a bit to get some answers
@wezell and @jtesser My config works well on dotCMS 4.x but don't work on version 5. When push to Aws s3, all static files are pushed correctly but only html files are empty content (zero byte).
@hcmuafnvt we are looking into it as I type. As a work around right now, you could add the {languageId} variable to your bucket name, e.g.
aws_bucket_name=aws-s3-{languageId}-xxxxxx
PR: https://github.com/dotCMS/core/pull/15191 https://github.com/dotCMS/enterprise-2.x/pull/633
Fixed, tested in the last release-5.0.2 code and now we are sending the page in all the language versions, also his contents. But we have a new issue here: #15310.
Waiting for this fix.
Note to doc: Maybe we need to add in the documentation as a best practice always try to use the "{hostname}-{languageIso}" parameters in order to configure the environment. @john-thomas-dotcms
With the fix, I'm not sure a change is needed to the doc. It's generally best practice to use a language variable in the bucket name if you actually have content in multiple languages, but I think that customers which do will use the language variables without being told.
But what may be just as likely a case is if customers have simply added a language without adding much or any content for it (or built on top of the demo site, which has multiple language defined without content in one of them) then the language variable doesn't really make sense. Where the cut-off is of what's "enough" multi-lingual content to make the language variable really needed is not really definable; so I think it's going to be a case-by-case decision that customers are going to have to think about and make their own decisions about.