core icon indicating copy to clipboard operation
core copied to clipboard

[Push Publishing] Cannot bundle Sites if default language has been changed in the system

Open joseorsini opened this issue 8 years ago • 8 comments

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:xxxx would be more suitable for this scenario.

Known Workarounds

Update all Sites' languages via SQL queries.

Steps to Reproduce (for bugs)

  1. Set up two instances of 4.1.x+ for Push Publishing
  2. Clone demo site on Server A.
  3. 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.
  4. 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:

screen shot 2017-12-05 at 8 20 55 am

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.

joseorsini avatar Dec 05 '17 14:12 joseorsini

PR ee: https://github.com/dotCMS/enterprise-2.x/pull/568

dsilvam avatar Dec 11 '17 17:12 dsilvam

Waiting on https://github.com/dotCMS/core/issues/13419 to retest

shaydotcms avatar Jan 17 '18 19:01 shaydotcms

Waiting for new ticket https://github.com/dotCMS/core/issues/13552

shaydotcms avatar Feb 02 '18 18:02 shaydotcms

Waiting for ticket https://github.com/dotCMS/core/issues/13820

shaydotcms avatar Mar 08 '18 20:03 shaydotcms

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

shaydotcms avatar Mar 19 '18 20:03 shaydotcms

Failed QA. Receiver server is throwing NPE error: https://gist.github.com/shaydotcms/5531c526f56ff56b916031186fd5bef6 image

shaydotcms avatar Mar 26 '18 21:03 shaydotcms

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

shaydotcms avatar Apr 03 '18 19:04 shaydotcms

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

shaydotcms avatar Apr 09 '18 18:04 shaydotcms