[Zope] BTreeFolder2 strangeness (invisible objects?)

knitti knitti at gmail.com
Tue Sep 6 17:08:46 EST 2011


Hi,

I just came across something very strange. We have here a large nested
BTreeFolder2 tree,
whose leaves contain ExtFiles, e.g.
btreef_root/btreef2/btreef3/btree_leave. Many of these leave
folders haven't been read since their creation, which could have been
up to 3 years ago.

During a data migration, which consists of a cut/paste operation of
the ExtFile objects into
another part of the tree (common root within the same zodb) I ran into
a CopyError during
manage_cutObjects.

Looking for the offending objects in the ZMI didn't show me the leave
folder, but calling
.objectIds() on its parent did show its name. Also, the leave folder
must be there somehow,
because the operation is only attempted when its .objectIds() returns something.

Accessing the "invisible" folder by direct url raises a NotFound.

Condensed code of the migration:

  v0container = root.unrestrictedTraverse(['the', 'correct', 'path'])
  file_ids = v0container.objectIds()
  if file_ids:
    v1container = create_v1container(precalculated_path)
    v1container.manage_pasteObjects(
        v0container.manage_cutObjects(file_ids)) # boom

so it seems unrestrictedTraverse() can do something which the ZMI
doesn't. User roles contain
Manager and Owner, I've tried running the script with Manager and
Owner proxy roles.
The same code on the same ZODB with the same user has worked some time
in the past.

Zope version: (Zope 2.11.6-final, python 2.4.5, freebsd8)

I would appreciate any idea which data structure I should have a
closer look at, to preferrably
recover or delete these objects.

best regards,
knitti


More information about the Zope mailing list