For the 'Host' content type, the user can add a relationship field to create a relationship to another content type (just like a regular content type). However, push publish fails with a NullPointerException when pushing a host that includes a relationship field pointing to another content.
Steps to Reproduce
Create a new content type and add a new relationship field to the 'Host' content type pointing to the new content type.
Add a new content for the content type create in the previous step.
Create a new site and relate it with the new content created in the previous step and save the site.
Add the site created in the previous step to a PP bundle
Push publish the bundle with the site.
The push publish fails in the target instance because a NullPointerException with this stack trace for the error:
[29/05/24 15:57:01:071 CST] ERROR handler.ContentHandler: An error occurred when processing Contentlet in '/Users/dsolis/dev/workspace/dotcms/external/assets/bundles/training2-01HZ35KNADKHZ6J68CR21P63F0/live/training.dotcm.scom/1/content.8e644270-6d0a-46b8-b516-7ea4dbaf018e.host.xml' with ID '32753785bfdb53c9f9272dcc532f0388': 'null'
java.lang.NullPointerException: null
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handleContents(ContentHandler.java:544) ~[classes/:?]
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handle(ContentHandler.java:220) ~[classes/:?]
at com.dotcms.enterprise.publishing.remote.handler.HostHandler.handle(HostHandler.java:87) ~[classes/:?]
at com.dotcms.publisher.receiver.BundlePublisher.process(BundlePublisher.java:222) ~[classes/:?]
at com.dotcms.rest.PushPublisherJob.processBundle(PushPublisherJob.java:40) ~[classes/:?]
at com.dotcms.rest.PushPublisherJob.run(PushPublisherJob.java:65) ~[classes/:?]
at com.dotmarketing.quartz.DotJob.execute(DotJob.java:42) ~[classes/:?]
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:?]
[29/05/24 15:57:01:073 CST] ERROR receiver.BundlePublisher: Error publishing bundle with ID 'training2-01HZ35KNADKHZ6J68CR21P63F0.tar.gz': An error occurred when processing Contentlet in '/Users/dsolis/dev/workspace/dotcms/external/assets/bundles/training2-01HZ35KNADKHZ6J68CR21P63F0/live/training.dotcm.scom/1/content.8e644270-6d0a-46b8-b516-7ea4dbaf018e.host.xml' with ID '32753785bfdb53c9f9272dcc532f0388': 'null'
com.dotcms.publishing.DotPublishingException: An error occurred when processing Contentlet in '/Users/dsolis/dev/workspace/dotcms/external/assets/bundles/training2-01HZ35KNADKHZ6J68CR21P63F0/live/training.dotcm.scom/1/content.8e644270-6d0a-46b8-b516-7ea4dbaf018e.host.xml' with ID '32753785bfdb53c9f9272dcc532f0388': 'null'
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handleContents(ContentHandler.java:575) ~[classes/:?]
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handle(ContentHandler.java:220) ~[classes/:?]
at com.dotcms.enterprise.publishing.remote.handler.HostHandler.handle(HostHandler.java:87) ~[classes/:?]
at com.dotcms.publisher.receiver.BundlePublisher.process(BundlePublisher.java:222) ~[classes/:?]
at com.dotcms.rest.PushPublisherJob.processBundle(PushPublisherJob.java:40) ~[classes/:?]
at com.dotcms.rest.PushPublisherJob.run(PushPublisherJob.java:65) ~[classes/:?]
at com.dotmarketing.quartz.DotJob.execute(DotJob.java:42) ~[classes/:?]
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: java.lang.NullPointerException
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handleContents(ContentHandler.java:544) ~[classes/:?]
... 8 more
[29/05/24 15:57:01:075 CST] ERROR Failed to publish because an error occurred: : Error publishing bundle with ID 'training2-01HZ35KNADKHZ6J68CR21P63F0.tar.gz': com.dotcms.publishing.DotPublishingException: An error occurred when processing Contentlet in '/Users/dsolis/dev/workspace/dotcms/external/assets/bundles/training2-01HZ35KNADKHZ6J68CR21P63F0/live/training.dotcm.scom/1/content.8e644270-6d0a-46b8-b516-7ea4dbaf018e.host.xml' with ID '32753785bfdb53c9f9272dcc532f0388': 'null'
Acceptance Criteria
Push publishing a site with a relationship field should work without problems in the same way that push publishing content with other related content works by including the related content as dependencies.
dotCMS Version
24.05.20
Proposed Objective
Core Features
Proposed Priority
Priority 3 - Average
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
Parent Issue
No response
Problem Statement
For the 'Host' content type, the user can add a relationship field to create a relationship to another content type (just like a regular content type). However, push publish fails with a
NullPointerException
when pushing a host that includes a relationship field pointing to another content.Steps to Reproduce
NullPointerException
with this stack trace for the error:Acceptance Criteria
Push publishing a site with a relationship field should work without problems in the same way that push publishing content with other related content works by including the related content as dependencies.
dotCMS Version
24.05.20
Proposed Objective
Core Features
Proposed Priority
Priority 3 - Average
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
No response
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
No response
Sub-Tasks & Estimates
No response