core icon indicating copy to clipboard operation
core copied to clipboard

Push Publishing: Partial Deletion when Push + Delete is selected on Push Task

Open joseorsini opened this issue 10 years ago • 4 comments

Reproduced in 3.2.4 with client data. Support Ticket: https://my.dotcms.com/tickets/detail.dot?id=d907ba5f-1bdd-4dd0-b7fc-46360013bd70

Also reproduced in 3.5 + Java 1.8 + Postgres Db (Starter).

Please follow the next steps to reproduce it:

  1. Setup a Push Publishing Environment with 1 node per each Endpoint.
  2. Create a test page under /about-us/. For testing purposes, let's call this page '/about-us/halfway-there'
  3. Push it to the Receiver Side.
  4. Make sure that the page has been pushed and Identifier is the same. Open a Query tool and search the page by its identifier.
  5. On Sender Site, add the Page to a Bundle and Download for Unpublish.
  6. Upload the Bundle to the Receiver Side. Logs will indicate the page has been deleted
[06/05/16 13:56:19:220 EDT]  INFO rest.PublishThread: Started bundle publish process
[06/05/16 13:56:19:267 EDT]  INFO business.ESContentletAPIImpl: UserId : system : delete : User trying to delete the following contents[6731e087-0260-464a-821c-6dca33490a14]
[06/05/16 13:56:19:288 EDT]  INFO db.DotConnect: Executing delete from tree where child in ('81fd57bd-5525-40cd-a8fa-ff2d274bcf71') or parent in ('81fd57bd-5525-40cd-a8fa-ff2d274bcf71')
[06/05/16 13:56:19:289 EDT]  INFO db.DotConnect: Executing delete from multi_tree where child in ('81fd57bd-5525-40cd-a8fa-ff2d274bcf71') or parent1 in ('81fd57bd-5525-40cd-a8fa-ff2d274bcf71') or parent2 in ('81fd57bd-5525-40cd-a8fa-ff2d274bcf71')
[06/05/16 13:56:19:322 EDT]  INFO rest.PublishThread: Finished bundle publish process

however, if we go to the Query Tool on Receiver side, we will see this: screen shot 2016-05-06 at 2 02 33 pm

The Query Tool will return 1 result, however, no ContentMap is pulled for that Content. Same content on SENDER side shows the ContentMap as expected.

Data on Sender Side:

35sender=# select * from identifier where id = '6731e087-0260-464a-821c-6dca33490a14'; id | parentpath | assetname | hostinode | assettype | syspublishdate | sysexpiredate --------------------------------------+-------------+-------------+--------------------------------------+------------+-----------------+---------------- 6731e087-0260-464a-821c-6dca33490a14 | /about-us/ | halfway-there | 48190c8c-42c4-46af-8d1a-0cd5db894797 | contentlet | | (1 row)

Data on Receiver side:

35receiver=# select * from identifier where id = '6731e087-0260-464a-821c-6dca33490a14'; id | parentpath | assetname | hostinode | assettype | syspublishdate | sysexpiredate ----+-------------+------------+------------+------------+-----------------+---------------- (0 rows)

joseorsini avatar May 06 '16 18:05 joseorsini

note: If we push again this page and push+delete again, it breaks and shows a similar behavior of what's described here https://github.com/dotCMS/core/issues/8984

joseorsini avatar May 06 '16 18:05 joseorsini

Stacktrace related to latest comment

[06/05/16 14:07:02:540 EDT]  INFO rest.PublishThread: Started bundle publish process
[06/05/16 14:07:02:577 EDT]  INFO business.ESContentletAPIImpl: UserId : system : delete : User trying to delete the following contents[6731e087-0260-464a-821c-6dca33490a14]
[06/05/16 14:07:02:588 EDT]  INFO db.DotConnect: Executing delete from tree where child in ('75eb18d2-4b2a-4356-b143-8931a2ebe372') or parent in ('75eb18d2-4b2a-4356-b143-8931a2ebe372')
[06/05/16 14:07:02:589 EDT]  INFO db.DotConnect: Executing delete from multi_tree where child in ('75eb18d2-4b2a-4356-b143-8931a2ebe372') or parent1 in ('75eb18d2-4b2a-4356-b143-8931a2ebe372') or parent2 in ('75eb18d2-4b2a-4356-b143-8931a2ebe372')
[06/05/16 14:07:02:623 EDT] ERROR db.HibernateUtil: ---------- DotHibernate: error on rollbackTransaction ---------------
org.postgresql.util.PSQLException: Cannot rollback when autoCommit is enabled.
[06/05/16 14:07:02:623 EDT] ERROR business.PublisherAPIImpl: Error Publishing Bundle: Unable to close Hibernate Session
com.dotmarketing.exception.DotHibernateException: Unable to close Hibernate Session
    at com.dotmarketing.db.HibernateUtil.closeSession(HibernateUtil.java:738) ~[dotcms_3.5_g14af2ce.jar:?]
    at com.dotmarketing.db.HibernateUtil.commitTransaction(HibernateUtil.java:763) ~[dotcms_3.5_g14af2ce.jar:?]
    at com.dotcms.publisher.receiver.BundlePublisher.process(BundlePublisher.java:165) [dotcms_3.5_g14af2ce.jar:?]
    at com.dotcms.rest.PublishThread.run(PublishThread.java:41) [dotcms_3.5_g14af2ce.jar:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_60]
Caused by: java.lang.RuntimeException: com.dotmarketing.business.DotStateException: No version info. Call setWorking first
    at com.dotcms.content.elasticsearch.business.ESContentletIndexAPI$1.run(ESContentletIndexAPI.java:315) ~[dotcms_3.5_g14af2ce.jar:?]
    at com.dotmarketing.db.HibernateUtil$RunnablesExecutor.run(HibernateUtil.java:707) ~[dotcms_3.5_g14af2ce.jar:?]
    at com.dotmarketing.db.HibernateUtil.closeSession(HibernateUtil.java:729) ~[dotcms_3.5_g14af2ce.jar:?]
    ... 4 more
Caused by: com.dotmarketing.business.DotStateException: No version info. Call setWorking first
    at com.dotmarketing.business.VersionableAPIImpl.isWorking(VersionableAPIImpl.java:221) ~[dotcms_3.5_g14af2ce.jar:?]
    at com.dotmarketing.portlets.contentlet.model.Contentlet.isWorking(Contentlet.java:400) ~[dotcms_3.5_g14af2ce.jar:?]
    at com.dotcms.content.elasticsearch.business.ESContentletIndexAPI.indexContentletList(ESContentletIndexAPI.java:340) ~[dotcms_3.5_g14af2ce.jar:?]
    at com.dotcms.content.elasticsearch.business.ESContentletIndexAPI.access$100(ESContentletIndexAPI.java:45) ~[dotcms_3.5_g14af2ce.jar:?]
    at com.dotcms.content.elasticsearch.business.ESContentletIndexAPI$1.run(ESContentletIndexAPI.java:309) ~[dotcms_3.5_g14af2ce.jar:?]
    at com.dotmarketing.db.HibernateUtil$RunnablesExecutor.run(HibernateUtil.java:707) ~[dotcms_3.5_g14af2ce.jar:?]
    at com.dotmarketing.db.HibernateUtil.closeSession(HibernateUtil.java:729) ~[dotcms_3.5_g14af2ce.jar:?]
    ... 4 more
[06/05/16 14:07:02:638 EDT] ERROR lang.String: Error Publishing: com.dotmarketing.exception.DotHibernateException: Unable to close Hibernate Session
[06/05/16 14:07:02:638 EDT]  INFO rest.PublishThread: Finished bundle publish process

joseorsini avatar May 06 '16 18:05 joseorsini

This is fixed on 3.6 by #7512

maurizo avatar Jun 03 '16 15:06 maurizo

Passed QA. Download for Unpublish deletes the page on the Receiver Side Query Tool is returning 0 results after the page is deleted. DB query shows 0 rows in receiver side after the page is deleted

Tested locally in: (reciever) master-3.6 // Win7 Pro SP1 // MySQL 5.7.11 // Firefox (sender) master-3.6 // Mac OS 10.10 // MySQL 5.6.23 // Chrome

shaydotcms avatar Jun 06 '16 23:06 shaydotcms