[PUBLISHING-74] Handle NullPointerException when publishing an already deleted node Created: 27/Jan/20  Updated: 09/Nov/23

Status: Open
Project: Publishing
Component/s: None
Affects Version/s: 1.1.3
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Jonathan Ayala Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relation
is related to PUBLISHING-314 Missing stack trace - difficulties tr... Open
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Team: Nucleus

 Description   

Steps to reproduce the issue:

  1. Create a pages tree with a root node and 3 children
  2. Publish them
  3. Modify one of the children nodes and schedule the whole tree publication
  4. In the meantime delete and publish deletion of any of the other children
  5. When the scheduled time in step 3 comes, an error will be thrown:
ERROR nfo.magnolia.publishing.command.PublicationCommand: Failed to activate node with UUID : 38a38848-9e9e-4c17-ac82-8587c3bf2c7e
ERROR nfo.magnolia.publishing.command.PublicationCommand: 38a38848-9e9e-4c17-ac82-8587c3bf2c7e
ERROR info.magnolia.module.scheduler.CommandJob         : Cannot execute command {0}-{1}.
java.lang.NullPointerException: null
	at info.magnolia.publishing.command.PublicationCommand.lambda$static$0(PublicationCommand.java:84) ~[magnolia-publishing-core-1.1.3.jar:?]
	at java.util.TimSort.countRunAndMakeAscending(TimSort.java:360) ~[?:1.8.0_121]
	at java.util.TimSort.sort(TimSort.java:220) ~[?:1.8.0_121]
	at java.util.Arrays.sort(Arrays.java:1512) ~[?:1.8.0_121]
	at java.util.ArrayList.sort(ArrayList.java:1454) ~[?:1.8.0_121]
	at info.magnolia.publishing.command.PublicationCommand.collectFromVersionMap(PublicationCommand.java:237) ~[magnolia-publishing-core-1.1.3.jar:?]
	at info.magnolia.publishing.command.PublicationCommand.collect(PublicationCommand.java:172) ~[magnolia-publishing-core-1.1.3.jar:?]
	at info.magnolia.publishing.command.PublicationCommand.execute(PublicationCommand.java:153) ~[magnolia-publishing-core-1.1.3.jar:?]
	at info.magnolia.personalization.command.PersonalizationPublicationCommand.execute(PersonalizationPublicationCommand.java:46) ~[magnolia-personalization-integration-1.8.jar:?]
	at info.magnolia.commands.MgnlCommand.executeSynchronized(MgnlCommand.java:80) ~[magnolia-core-6.1.4.jar:?]
	at info.magnolia.commands.MgnlCommand.execute(MgnlCommand.java:69) ~[magnolia-core-6.1.4.jar:?]
	at info.magnolia.module.scheduler.CommandJob.execute(CommandJob.java:110) [magnolia-module-scheduler-2.3.2.jar:?]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.3.1.jar:?]
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.1.jar:?]
2020-01-27 09:48:00,297 INFO  orkflow.jbpm.workitem.handler.AsyncWorkItemHandler: WorkItem [asyncCommand] was aborted. 

The scheduled publication is not carried out.

This exception should be handled and notified accordingly in the AdminCentral with a descriptive message of what have happened.

 



 Comments   
Comment by Jonathan Ayala [ 28/Jan/20 ]

Steps to reproduce the issue provided in SUPPORT-10802

  1. Create a pages tree with a root node and 3 children
  2. Publish the root node recursively with a scheduled publication
  3. In the meantime delete and publish deletion of any of the 3 children
  4. When the scheduled time in step 2 comes, an error will be thrown:
ERROR info.magnolia.publishing.command.PublicationCommand 20.01.2020 17:02:00 -- Failed to activate node with UUID : 3a236f78-2221-474c-a9bd-6436e0b27fc1
ERROR info.magnolia.publishing.command.PublicationCommand 20.01.2020 17:02:00 -- 3a236f78-2221-474c-a9bd-6436e0b27fc1
ERROR info.magnolia.module.scheduler.CommandJob 20.01.2020 17:02:00 -- Cannot execute command {0}-{1}.
java.util.ConcurrentModificationException: null
	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1042) ~[?:?]
	at java.util.ArrayList$Itr.next(ArrayList.java:996) ~[?:?]
	at info.magnolia.publishing.command.PublicationCommand.collectFromVersionMap(PublicationCommand.java:223) ~[magnolia-publishing-core-1.1.3.jar:?]
	at info.magnolia.publishing.command.PublicationCommand.collect(PublicationCommand.java:172) ~[magnolia-publishing-core-1.1.3.jar:?]
	at info.magnolia.publishing.command.PublicationCommand.execute(PublicationCommand.java:153) ~[magnolia-publishing-core-1.1.3.jar:?]
	at de.db.vendo.cms.commands.monitorpublication.MonitoredPublicationCommand.execute(MonitoredPublicationCommand.java:30) ~[common-1.2.25-SNAPSHOT.jar:?]
	at info.magnolia.commands.MgnlCommand.executeSynchronized(MgnlCommand.java:80) ~[magnolia-core-6.1.4.jar:?]
	at info.magnolia.commands.MgnlCommand.execute(MgnlCommand.java:69) ~[magnolia-core-6.1.4.jar:?]
	at info.magnolia.commands.chain.ChainBase.execute(ChainBase.java:101) ~[magnolia-core-6.1.4.jar:?]
	at info.magnolia.module.scheduler.CommandJob.execute(CommandJob.java:110) [magnolia-module-scheduler-2.3.2.jar:?]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.3.1.jar:?]
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.1.jar:?] 
Generated at Mon Feb 12 10:35:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.