Monday, December 17, 2012

Shouldn't load state for ... when the connection is closed

Update: Suspicion has been falsified, as the same error occurred again yesterday.

We got this error from our live sites. Never locally, so hard to trace. One mailing list post warned that it might indicate a "severe persistency bug" which might cause "catastrophic inconsistencies". Most people agree that it's due to code that stores objects in inappropriate places (cached views).

That felt like looking for a needle in a haystack. We did find a viewlet that in its update method stored a portal tool on the viewlet, like so:

def update(self):
super(ViewletClass, self).update()
self.workflow_tool = getToolByName(self.context, 'portal_workflow') 

After replacing that line, the messages went away after the next update. Might be that something else that went into that update caused it, but i thought i'd share my suspicion here in case anyone ever googles for this.

1 comment:

davisagli said...

Odd. I wouldn't expect that to cause problems unless the viewlet itself is getting stored as an attribute of a persistent object, which would not be normal.