Problems editing existing page in Plone 4.3 - NoneType Object errors

Hi all!
This is getting very frustrating.
I've been working on my site for months now without problems, but now seem to have hit a wall. I open a page for editing, make a simple change or addition, but when I try to save, get this traceback.
In the current case, I'm trying to simply add an external link URL to a short bit of text.

This sort of thing is what makes Plone terrifying for the majority of users.

I've been working with Plone for over ten years, as an admin, rather than a developer. But I know how to grep the source code, and often can laboriously track things down. But this NoneType error just makes me shudder.
I don't have time to do days worth of Googling, and trial and error and everything to figure this out. But, having successfully made changes to this very page only hours ago, I'm now effectively locked out.
In some cases, I've been able to clone the whole page, and then edit the new one. This leaves orphaned pages, and causes problems with existing aliases...

http://fraterdeus.com/drawing-without-lines

What next?

Thanks for any tips, pointers, etc.

Cheers

Peter

Plone 4.3.4.1 (4309)
CMF 2.2.8
Zope 2.13.22
Python 2.7.5+ (default, Sep 19 2013, 13:49:51) [GCC 4.8.1]
PIL 2.3.0 (Pillow)

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.FSControllerPageTemplate, line 91, in call
Module Products.CMFFormController.BaseControllerPageTemplate, line 28, in _call
Module Products.CMFFormController.ControllerBase, line 231, in getNext
Module Products.CMFFormController.Actions.TraverseTo, line 38, in call
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.CMFFormController.FSControllerPythonScript, line 107, in call
Module Products.CMFFormController.ControllerBase, line 231, in getNext
Module Products.CMFFormController.Actions.TraverseTo, line 38, in call
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 1, in content_edit

  • <FSControllerPythonScript at /PFraterdeus/drawing-without-lines/content_edit>
  • Line 1
    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 12, in content_edit_impl
  • <FSPythonScript at /PFraterdeus/drawing-without-lines/content_edit_impl>
  • Line 12
    Module Products.Archetypes.BaseObject, line 667, in processForm
    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 Products.CMFEditions.subscriber, line 64, in objectEdited
    Module Products.CMFEditions.subscriber, line 44, in webdavObjectEventHandler
    Module Products.CMFEditions.utilities, line 123, in maybeSaveVersion
    Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 305, in save
    Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 451, in _recursiveSave
    Module Products.CMFEditions.ArchivistTool, line 265, in prepare
    Module Products.CMFEditions.ModifierRegistryTool, line 145, 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 Products.CMFEditions.CopyModifyMergeRepositoryTool, line 559, in _recursiveRetrieve
    Module Products.CMFEditions.ArchivistTool, line 340, in retrieve
    Module Products.CMFEditions.ArchivistTool, line 514, in getitem
    Module Products.CMFEditions.ModifierRegistryTool, line 254, in afterRetrieveModifier
    Module Products.CMFEditions.StandardModifiers, line 801, in afterRetrieveModifier
    Module Products.Archetypes.ReferenceEngine, line 349, in deleteReference
    Module Products.Archetypes.ReferenceEngine, line 566, in _deleteReference
    AttributeError: 'NoneType' object has no attribute '_getReferenceAnnotations'

Well, any bug in any piece of software is terrifying for a majority of users :smile:

This seems sort of related: AttributeError: 'NoneType' object has no attribute '_getReferenceAnnotations during migration · Issue #41 · plone/plone.app.contenttypes · GitHub

Looks like you're using plone.app.contenttypes? What other non-stock add-ons do you have installed? That'd be helpful to other looking to help you out.

Was the content migrated from Archetypes?

I've never seen anything like this but I've never run a plone 4 site with plone.app.contenttypes.

Thanks so much for the thoughts, Nathan!
No, there is no migrated content, the site was built in Plone 4.

Installed Add-ons
Autocomplete widget 1.2.7
Carousel for Plone 2.2.1
Content alias 1.3.1
Content tree widget 1.0.9
ContentWellPortlets 4.2.1
Dexterity Content Types 2.0.12
Dexterity versioning support 1.2.0
Diazo theme support 1.1.3
Gallery Image Type 1.0
HTTP caching support 1.1.8
Medialog Googlefonts 2.2.2
Plone Captchas 4.2
Plone DropDown Menu 1.2.13
Plone JQuery Integration 1.8.3
Plone JQuery Tools Integration 1.6.2
Plone True Gallery 3.4.4
Plone Widgets 1.4.0
PloneFormGen 1.7.16
Querystring formwidget 1.1.4
Quintagroup Captcha Core 0.4.3
Relation Field 1.2.1
Session refresh support 3.5.3
Static Stylish portlet 0.7
Static resource storage 1.0.3
SunRain Policy 1.0
SunRain Theme 6.2
Workflow Policy Support (CMFPlacefulWorkflow) 1.5.10
Working Copy Support (Iterate) 2.1.12
collective.twitter.accounts 1.0.3
collective.twitter.portlets 1.0b5
collective.z3cform.datetimewidget 1.2.6
jQuery UI 1.10.3
jarn.jsi18n 1.1
medialog.controlpanel 1.0.4
plone.app.collection 1.0.12
plone.app.event 1.1.2
plone.app.event.at
plone.app.intid: install utility 1.0.3
plone.formwidget.datetime default profile 1.1
plone.formwidget.recurrence 1.2.5

Hmm. What else??
Confirmed that I am able to copy and paste the page itself, and make the edits, and save the page. No problems.
Maybe I'll try clearing cache and compacting the ZopeDB?

Thanks!

P

I don't know if I need contenttypes... But I think maybe the alias type is defined with that...

Can you try uninstalling plone.app.versioningbehavior and seeing if that is your culprit? It actually seems like you do NOT have plone.app.contenttypes installed but it definitely seems like something to do with versioning.

Hmm. I don't see plone.app.versioningbehavior, but I disabled

Dexterity versioning support 1.2.0 and
Working Copy Support (Iterate) 2.1.12

which did not seem to do the trick...
Still get the same error attempting to save the page after edits.

Happy to try anything at this point.
I hate to say it, but this is the type of experience that has kept me from whole-heartedly recommending Plone to clients in the past.

I do understand the many benefits of python and Plone, but it really seems to take an advanced degree in Plonology to nail this stuff down... which I'm unlikely to earn any time soon :wink:

Many thanks for futher pointers

Peter
http://emptiness.design

It looks like it tries to remove a (no longer) existing reference, this may be caused by the versioning mechansim or by other code, probably in some addon.

I would try to move the following line 566 into the try-except block directly below this line.

Please make sure to have a backup or try this in a testing environment. At the moment it looks a bit like the real cause of the problem is masked. This change may unmask it a bit further

Hi Jensens
Thanks very much for this tip.
The thing that makes Plone amazingly special is that the core developers are so closely involved and always willing to provide their insights.

I will give this a try when I have a few minutes. I'll try it on a clone of the DigitalOcean droplet that's running the site.

Always learning!
Best
peter
http://emptiness.design
http://letterpress.expert

If you post your buildout.cfg and version pins maybe something will come to light.

1 Like
Hi Kim!

Here's buildout snippets...

(Actually, I should nix the toolbar stuff, it was not working right with something, and is not enabled in the site...)

and versions.

Thx!
P
----

extends =
    base.cfg
#    versions.cfg
   http://dist.plone.org/release/4.3.4-pending/versions.cfg

# If you change your Plone version, you'll also need to update
# the repository link below.
find-links +=
    http://dist.plone.org/release/4.3.4-pending

# If you try to start Zope as root, it will change user id to run as
# the effective user specified here. This user id must own the var directory
# of your buildout.
effective-user = plone_daemon
# This user will own the rest of the installation, and should be used to
# run buildout.
buildout-user = plone_buildout
# A flag to tell the Unified Installer whether or not to document sudo use.
need-sudo = yes

############################################
# Eggs
# ----
# Add an indented line to the eggs section for any Python
# eggs or packages you wish to include in your Plone instance.
#
# Note that versions may be specified here or in the [versions]
# section below. You should always specify versions that you know
# are compatible with the Plone release and at an acceptable
# development level.
#
# If you update to a later version of Plone, remove the hotfix.
#
eggs =
    Plone
    Pillow
    collective.alias
    quintagroup.theme.sunrain
    quintagroup.portlet.static
    quintagroup.plonecaptchas >=4.0
    Products.Carousel
    Products.ContentWellPortlets
    Products.PloneFormGen
    quintagroup.dropdownmenu
    quintagroup.sunrain.policy
    collective.plonetruegallery
    collective.ptg.flickr
    collective.ptg.picasa
    collective.ptg.allnewest
    collective.twitter.portlets
    medialog.googlefonts   
    plone.app.widgets[archetypes,dexterity]
    plone.app.toolbar
    python-oauth2
    six
#wildcard.foldercontents
    plone.app.dexterity [relations]
    wildcard.foldercontents
    tus

#wildcard.foldercontents
environment-vars =
    TUS_ENABLED true
    TUS_TMP_FILE_DIR ${buildout:directory}/var/tmp 
# mkdir var/tmp

############################################
# ZCML Slugs
# ----------
# Some eggs need ZCML slugs to tell Zope to
# use them. This is increasingly rare.
zcml =
#    plone.reload
    plone.app.widgets
    plone.app.toolbar

....

[versions]
six = 1.8.0
plone.app.contenttypes = 1.1b3
plone.app.event = 1.1.2
plone.app.jquery = 1.8.3
plone.app.portlets = 2.5.1
plone.app.widgets = 1.4.0

http://dist.plone.org/release/4.3.4-pending/versions.cfg does not exist anymore!

I would try disabling versioning for the content and seeing if that helps. You need to go into the Types control panel and
disable it for the type that you are having trouble with.

yeah, that's unfortunate. If somebody with admin powers can make a symlink to 4.3.4/versions.cfg that would help, otherwise change your buildout obviously but I think the 4.3.4-pending still comes with the Universal Installer.

Thanks Nathan, yes, that did the trick!
For the moment, I will just leave it as is until the rain starts :wink:
Have a roofing project and the weather is perfect — unseasonably cool and dry!

Many thanks... I'd like to get to the root of the problem, so when I get some time in the next week or so, I will clone the problem site, and see what I can come up with!

Best wishes from Galena three hours west on the highway from Chicago near the Mississippi River...

1 Like