Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction fails when mail is sent in the same transaction as a new version is saved #40

Open
ghost opened this issue Oct 11, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 11, 2016

I'm using CMFEditions 2.2.20 in Plone 5.0.5. I have an event listener on content (that uses the plone.app.versioningbehavior.behaviors.IVersionable behavior) that sends automatic email. However this fails with the following error.

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 plone.z3cform.layout, line 66, in __call__
    Module plone.z3cform.layout, line 50, in update
    Module plone.dexterity.browser.edit, line 58, in update
    Module plone.z3cform.fieldsets.extensible, line 59, in update
    Module plone.z3cform.patch, line 30, in GroupForm_update
    Module z3c.form.group, line 145, in update
    Module plone.app.z3cform.csrf, line 21, in execute
    Module z3c.form.action, line 98, in execute
    Module z3c.form.button, line 315, in __call__
    Module z3c.form.button, line 170, in __call__
    Module plone.dexterity.browser.edit, line 30, in handleApply
    Module z3c.form.group, line 126, in applyChanges
    Module zope.event, line 31, in notify
    Module zope.component.event, line 24, in dispatch
    Module zope.component._api, line 136, in subscribers
    Module zope.component.registry, line 321, in subscribers
    Module zope.interface.adapter, line 585, in subscribers
    Module zope.component.event, line 32, in objectEventNotify
    Module zope.component._api, line 136, in subscribers
    Module zope.component.registry, line 321, in subscribers
    Module zope.interface.adapter, line 585, in subscribers
    Module plone.app.versioningbehavior.subscribers, line 62, in create_version_on_save
    Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 305, in save
    Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 450, in _recursiveSave
    Module Products.CMFEditions.ArchivistTool, line 265, in prepare
    Module Products.CMFEditions.ModifierRegistryTool, line 143, in getReferencedAttributes
    Module plone.app.versioningbehavior.modifiers, line 114, in getReferencedAttributes
    Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 366, in retrieve
    Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 500, in _retrieve
    Module transaction._transaction, line 705, in rollback
    Module transaction._transaction, line 702, in rollback
    Module transaction._transaction, line 723, in rollback

TypeError: ('Savepoints unsupported', <zope.sendmail.delivery.MailDataManager object at 0x00000000170D6160>)

I can confirm that this is the cause because it works if I remove the dexterity behavior I get the email and no error (and no versioning) or if comment out the line that sends the email I get proper versioning and no behavior. I don't understand the low level transaction module too well but it seems like sending an email shouldn't be something that causes a db conflict.

The problem looks like it might be related to a fix waaay back in the day here My problem looks very similar to https://github.com/plone/Products.CMFEditions/blob/master/CHANGES.rst#205---2011-02-25 but I am not enough of an expert to know if that is a red herring.

@terapyon
Copy link
Member

terapyon commented Mar 2, 2018

I got same error on Plone 5.1rc2. I think the problem related zope.sendmail. I want to know how to fix or any workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant