Question

I'm using a view to archive old content by moving it into another folder. (catalog search for enddate more than N months ago, pass id's into the following command:

target.manage_pasteObjects( source.manage_cutObjects(idsToArchive) )

One or two years ago moving about 800 or even more objects was no problem. Today I need to limit the catalog search to around 80 items, otherwise I get a

    Module OFS.CopySupport, line 193, in manage_pasteObjects
CopyError: 

The data in the clipboard could not be read, possibly due to cookie data being truncated by your web browser. Try copying fewer objects.

running plone 4.1.6 / Zope2-2.13.15.

I already tried to deactivate beaker-session-datamanager (still the same problems)

Was it helpful?

Solution

You installed the latest Plone hotfix, 20130618. It includes a DDOS-prevention measure limiting the size of the __cp cookie data to 8kb (decompressed).

Future Zope versions will also include this fix.

To work around this temporarily your only option is to increase the maximum size default. Doing this will allow other threads use larger cookies as well until you restore the default:

from OFS.CopySupport import _cb_decode

_default_maxsize = _cb_decode.func_defaults[0]

def _increase_maxsize(newsize):
    # Patch the maxsize default
    _cb_decode.func_defaults = (newsize,)

def _restore_maxsize(newsize):
    # Patch the maxsize default
    _cb_decode.func_defaults = (_default_maxsize,)

The cookie data consists almost entirely of object paths (absolute paths as tuples) as marshall dumps, you'll have to estimate a suitable maximum size from that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top