Posts tagged 'zope'

Watch out: Python 2.4 ZEO client and Python 2.6 ZEO Server

Today was interesting when an issue with saving content on a Plone 3.3.5 site got reported to me. The system was producing undecipherable error messages about ZEO disconnections and database conflicts whenever someone would try and create some content within Plone (folders, particularly). Errors looked like:

Module ZEO.zrpc.connection, line 796, in wait. DisconnectedError" and "raise ReadConflictError().
ReadConflictError: database read conflict error"

and also:

ERROR ZEO.zrpc (2515) can't decode message: '(K\x11K\x01U\tserialnos(]((U\x08\x00\x00\x00\x00\x00X\x...'

— essentially the issue described here. My ZEO server was running ZODB3 3.9.5 …

Extracting a Buildout versions.cfg from a Zope instance script

Today, I needed to migrate some legacy Plone installs set up using Buildout. If I were to simply move the buildout files and re-run buildout, I’d end up with the latest versions of add-on products - and since I’m using legacy versions of Plone 3, that’d almost certainly break the system.  I do know about the Buildout extension buildout.dumppickedversions (which does what its name suggests and exports picked versions of eggs) but I can’t re-run buildout to get this extension for risk of updating existing products (what I’m trying to avoid!).

The good news is …

Can’t run Plone/Zope buildout on Ubuntu 11.04 after upgrade from 10.10

After upgrading from Ubuntu 10.10 (Maverick Meerkat) to Ubuntu 11.04 (Natty Narwhal), you’ll probably find that if you’re running a Plone 4 buildout where you need to upgrade the Plone version, that compilation of Zope will fail. The output will look something like this:

Getting distribution for 'Zope2==2.12.17'.
In file included from src/AccessControl/cAccessControl.c:51:0:
include/ExtensionClass/ExtensionClass.h:83:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
An error occured when trying …

Increasing Plone’s session timeout

What you may notice if you’re developing with Plone/Zope, is that if you’re storing small pieces of data within Plone’s session variable (the session_data_manager tool), data expires after a few minutes.  By default, this timeout is 20 minutes, but is far too short if you’re expecting the information stored to last for say the whole time a user is logged in.  In this situation, you’ll need to increase the timeout.

Documentation on changing the session timeout is potentially a little sketchy (Google “session-timeout-minutes zope”), but it’s clear that you need to change the …

Bad relationships: RelationChoice, RelationCatalog and removed Dexterity content in Plone

Disclaimer: this post isn’t giving relationship advice (or..it is in some twisted way).  Unsurprisingly, removing content in Plone via the ZMI when Plone says something can’t be deleted is likely to cause problems.

In my case, the fact I removed a Dexterity-based container (“Project”) caused users to no longer add or edit content of my Project type.  The reason for this boiled down to my use of RelationChoice fields, in order link Projects to Person objects and vice versa.  The backend storage for the RelationChoice field is an instance of z3c.relationfield.index.RelationCatalog, and this keeps …

Plone/Zope: Truncating a Data.fs back to a certain date/time

Okay. So, anyone out here who’s listening — particularly those overly-enthusiastic users — don’t try to recursively wget your Plone site (or other CMS, for that matter) whilst you’re logged in with an account that can make edits. It will lead to a very bad situation where your site administrator and technical team need to step in and fix your mistakes. For the uninitiated, a loose recursive wget (when logged in with some degree of Edit rights) will hit every link that’s on your pages, and I mean in the (X)HTML source. For a Plone site, this …

Plone: Overrides.zcml gets auto-included with z3c.autoinclude

Unsurprisingly, specifying a z3c.autoinclude entry point in your Plone product egg means your ZCML gets automatically included. That’s great because it means you don’t have to specify your product under the ZCML section of your instance in buildout. One thing that isn’t so obvious (it’s not mentioned that I can see on plone.org) is that if your package is marked for ZCML autoinclude, then Plone will automatically load an overrides.zcml file in your product.

Nothing hits you like a slippery wet fish in the face more than hitting this issue and having it …

Plone: SiteManager leftovers; not the good kind

Note

Update: You should check out wildcard.fixpersistentutilities - it’s a fantastic solution to problems like this. Many thanks to Nathan Van Gheem, the author of the add on. Check out the link and see how to install it (temporarily) on your Plone instance that needs its site manager cleaned up.

Leftovers are typically useful when they’re in your fridge at home. They mean you don’t have to mess around making lunch for the next day for work, and can just grab them, and walk right out the door. Now, leftovers in the zope.component SiteManager aren’t …

Plone, Dexterity, and Incorrect Widgets

A nice ‘gotcha’ is the distinction between Zope’s schema.Date and schema.Datetime. The difference is obvious and straightforward when the two terms are laid out side-by-side: one is for dates only and the other adds a time component. Where things fell down for me in my usage of these fields with a Dexterity-based content type in Plone is the human component. When these fields are mashed in together within a lot of other text/Python/names, it’s easy to miss those 4 little letters of ‘time’. This lead me trying to use a DatetimeFieldWidget when I really …

Plone/Zope: Using LDAPUserFolder with posixGroups

Due to various reasons, the Products.LDAPUserFolder package available for Plone and Zope doesn’t support POSIX groups.  The ‘official’ (ish) reason for this is because of the fact that these groups don’t store full distinguished names (DNs) for members.  It makes some degree of sense, because a user ID like ‘david.test’ isn’t strictly unique.  On the other hand, these types of groups are quite common in LDAP implementations; not supporting them without giving it at least half a shot to find the user seems a bit strange.

Here’s where a quick patch steps in. Thanks …