[Push Publishing] Cannot bundle Sites if default language has been changed in the system
By default, all sites are created under the default language and they are not handled as Multilingual contents. This means that, if the Default Language config is updated on the system, lookup of Sites will fail by the time they're bundled and pushed to other environments.
Expected Behavior
Lookup of Sites should not depend entirely on the default language.
Current Behavior
A mismatch of the default language in system and the ones these Site have set once they were created will cause bundles' generating to fail, and Push task won't work across environments.
Possible Solution
- Find a proper way on HostBundler for looking up Sites regardless of default language in system. Perhaps using ContentletAPI.search() method and using
+identifier:xxxxwould be more suitable for this scenario.
Known Workarounds
Update all Sites' languages via SQL queries.
Steps to Reproduce (for bugs)
- Set up two instances of 4.1.x+ for Push Publishing
- Clone demo site on Server A.
- On both servers, update the Language Configuration via plugins https://dotcms.com/docs/latest/system-language-properties and restart the servers. Set Español - España (included on starter) as the default language.
- Once servers are up and running, add demo and cloned site to a bundle and push them. Exception is thrown.
[01/12/17 20:29:37:399 UTC] ERROR publishing.PublisherAPIImpl: com.dotcms.enterprise.publishing.remote.bundler.HostBundler : generate()Content error on host SYSTEM_HOST: Unable to pull content
com.dotcms.publishing.DotBundleException: com.dotcms.enterprise.publishing.remote.bundler.HostBundler : generate()Content error on host SYSTEM_HOST: Unable to pull content
at com.dotcms.enterprise.publishing.remote.bundler.HostBundler.generate(SourceFile:164) ~[ee-4.1.1.jar:?]
at com.dotcms.publishing.PublisherAPIImpl.publish(PublisherAPIImpl.java:75) [dotcms_4.1.1_999999.jar:?]
at com.dotcms.publishing.PublisherAPIImpl.publish(PublisherAPIImpl.java:16) [dotcms_4.1.1_999999.jar:?]
at com.dotcms.publisher.business.PublisherQueueJob.execute(PublisherQueueJob.java:181) [dotcms_4.1.1_999999.jar:?]
at org.quartz.core.JobRunShell.run(JobRunShell.java:223) [dot.quartz-all-1.8.6_2.jar:?]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) [dot.quartz-all-1.8.6_2.jar:?]
Caused by: com.dotcms.publishing.DotBundleException: Content error on host SYSTEM_HOST
at com.dotcms.enterprise.publishing.remote.bundler.HostBundler.generate(SourceFile:142) ~[ee-4.1.1.jar:?]
... 5 more
Caused by: com.dotmarketing.portlets.contentlet.business.DotContentletStateException: Can't find contentlet: SYSTEM_HOST lang:9 live:false
at com.dotcms.content.elasticsearch.business.ESContentletAPIImpl.findContentletByIdentifier(ESContentletAPIImpl.java:283) ~[dotcms_4.1.1_999999.jar:?]
at com.dotmarketing.portlets.contentlet.business.ContentletAPIInterceptor.findContentletByIdentifier(ContentletAPIInterceptor.java:712) ~[dotcms_4.1.1_999999.jar:?]
at com.dotcms.enterprise.publishing.remote.bundler.HostBundler.generate(SourceFile:125) ~[ee-4.1.1.jar:?]
... 5 more
Caused by: com.dotmarketing.portlets.contentlet.business.DotContentletStateException: No contenlet found for given identifier
at com.dotcms.content.elasticsearch.business.ESContentletAPIImpl.findContentletByIdentifier(ESContentletAPIImpl.java:272) ~[dotcms_4.1.1_999999.jar:?]
at com.dotmarketing.portlets.contentlet.business.ContentletAPIInterceptor.findContentletByIdentifier(ContentletAPIInterceptor.java:712) ~[dotcms_4.1.1_999999.jar:?]
at com.dotcms.enterprise.publishing.remote.bundler.HostBundler.generate(SourceFile:125) ~[ee-4.1.1.jar:?]
... 5 more
Context
Reproduced by customer: https://dotcms.zendesk.com/agent/tickets/94852 Unlike other contents in the system, Host Content Type does not allow having multilingual Sites, and the Language Dropdown is not available here:
Your Environment
- dotCMS version used: 4.1.1+
- Browser Name and version: Any Browser.
- Operating System and version: Any OS.
- Application Server and version: Any App Server.
- Java Brand and version: Any supported Java 8 version.
- Database and version: Any DB.
- Application module (if apply): N/A.
PR ee: https://github.com/dotCMS/enterprise-2.x/pull/568
Waiting on https://github.com/dotCMS/core/issues/13419 to retest
Waiting for new ticket https://github.com/dotCMS/core/issues/13552
Waiting for ticket https://github.com/dotCMS/core/issues/13820
Fix needs work. I followed steps to reproduce and I was unable to push bundle after changing default language. Error: https://gist.github.com/shaydotcms/a188ac796d1ff37d2b59582006207f85
Failed QA. Receiver server is throwing NPE error: https://gist.github.com/shaydotcms/5531c526f56ff56b916031186fd5bef6

Push publish failed with this error https://gist.github.com/shaydotcms/21a1dc765f80956477833bf77627c653
Tested on master branch / Mac OS 10.10 / Postgres 9.6.6 / Chrome v64 / Tomcat 8 / Java 8.6
Passed QA No errors showing this time
Tested on master branch / Mac OS 10.10 / Postgres 9.6.6 / Chrome v64 / Tomcat 8 / Java 8.6