isawnyu / isaw.web

Isaw website buildout
http://isaw.nyu.edu
1 stars 3 forks source link

deleting a page succeeds but throws InvalidSavepointRollbackError #345

Closed paregorios closed 6 years ago

paregorios commented 6 years ago

Steps to reproduce:

  1. Login to production.
  2. Navigate to an existing page.
  3. Choose actions -> delete from the beautiful, green tertiary submenu.
  4. Behold the traceback:
Traceback (innermost last):

    Module ZPublisher.Publish, line 138, in publish
    Module ZPublisher.mapply, line 77, in mapply
    Module ZPublisher.Publish, line 48, in call_object
    Module Products.CMFFormController.FSControllerPythonScript, line 105, in __call__
    Module Products.CMFFormController.Script, line 145, in __call__
    Module Products.CMFCore.FSPythonScript, line 127, in __call__
    Module Shared.DC.Scripts.Bindings, line 322, in __call__
    Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
    Module Products.PythonScripts.PythonScript, line 344, in _exec
    Module script, line 6, in delete_confirmation
    <FSControllerPythonScript at /isaw/members/te20-40nyu.edu/more-image-tests/page-with-images/delete_confirmation>
    Line 6
    Module Products.CMFPlone.utils, line 655, in isLinked
    Module transaction._transaction, line 697, in rollback

InvalidSavepointRollbackError 
  1. Go back to the previous page URL and reload it.
  2. Wrinkle your brow when you are informed "This page does not seem to exist"

This seems to occur on both existing pages and newly created pages.

alecpm commented 6 years ago

What appears to be happening is that the link integrity checker tries to delete the object to find out if an content that references it. When an existing link is found an exception is raised and caught and Plone attempts to rollback to the prior transaction savepoint and ask for confirmation regarding potential broken links. Unfortunately, something is causing the savepoint to be considered invalid and preventing the rollback from succeeding. The result is the object is permanently deleted without link integrity checks happening. We can work around this by disabling the link integrity checker while we attempt to get to the bottom of the issue.

Do you know if this was happening immediately after the Plone 4.3.18 upgrade, or did it only start happening after last night's deployment?

alecpm commented 6 years ago

It looks like this was caused by collective.linkcheck, disabling the addon remedied the issue.

alecpm commented 6 years ago

I upgraded to the latest supported Plone 4.3 version of this add-on (1.4) when I did the Plone 4.3.18 upgrade, so I will attempt to downgrade to the last known working version (1.2).

alecpm commented 6 years ago

I've downgraded to collective.linkchecker to 1.2 and installed it on staging. Deletion seems to be working there again. If this add-on is important for ISAW I'll go ahead and downgrade/install on production. However, if you don't really use it I'd recommend keeping it uninstalled. My recollection is that it has some pretty serious performance implications and the background tasks that it runs can be very costly, separate from the weird transaction fiddling that it apparently does.

paregorios commented 6 years ago

As discussed during standup, we no longer need collective.linkchecker.

Deletion behavior seems to be working at present on production. @alecpm if there are no more actions to take regarding this issue, feel free to close the ticket.

alecpm commented 6 years ago

The included (but not installed) linkchecker addon will be downgraded with the next production push, and I think that's all there is to it. Closing.