#19 — Migration from 1.0b2 to 1.0b3 breaks item view (AttributeError: 'NoneType' object has no attribute 'getAccessor')

State Resolved
Version:
Area Functionality
Issue type Bug
Severity Critical
Submitted by Thomas Kiser
Submitted on May 17, 2009
Responsible Andreas Zeidler
Target release: 1.0
I successfully worked with 1.0b2 but was not satisfied about missing content indexing. So I was happy to take note about the new release and installed it today. Everything seemed to work fine, but when I finally wanted to view a (blob-)item, it stopped with AttributeError: 'NoneType' object has no attribute 'getAccessor'. Full error details below.

What I did:
- rerun buildout
- restarted Zope
- in the Plone site: reinstalled the plone.app.blob-Product.

I'm glad to provide more information on request. Unfortunately I'm no Plone/Zope insider at all and would need some guidance.

My "setup":
    * Plone 3.2.2
    * CMF 2.1.2
    * Zope (Zope 2.10.7-final, python 2.4.4, linux2)
    * Python 2.4.4 (#5, Jun 8 2007, 04:52:14) [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)]
    * PIL 1.1.6

---

Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.CMFCore.FSPageTemplate, line 216, in _exec
  Module Products.CMFCore.FSPageTemplate, line 155, in pt_render
  Module Products.PageTemplates.PageTemplate, line 98, in pt_render
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
   - Warning: Macro expansion failed
   - Warning: exceptions.KeyError: 'file'
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 891, in do_useMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 957, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 861, in do_defineMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 957, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 525, in do_optTag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 949, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 861, in do_defineMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 586, in do_setLocal_tal
  Module zope.tales.tales, line 696, in evaluate
   - URL:
file:/home/biblioconsult/webapps/zopebo/eggs/Plone-3.2.2-py2.4.egg/Products/CMFPlone/skins/plone_content/file_view.pt
   - Line 12, Column 4
   - Expression: <PathExpr standard:u'here/get_content_type|here/Format'>
   - Names:
      {'container': <PloneSite at /pierregavin/pierregavin.ch>,
       'context': <ATBlob at
/pierregavin/pierregavin.ch/cours-recents/zurich-mas-okt-dez-2007/02-Verschiedene-Katalogformen.pdf>,
       'default': <object object at 0xb7ef9528>,
       'here': <ATBlob at
/pierregavin/pierregavin.ch/cours-recents/zurich-mas-okt-dez-2007/02-Verschiedene-Katalogformen.pdf>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object
at 0xaf3ae12c>,
       'request': <HTTPRequest,
URL=http://www.pierregavin.ch/[…]/file_view>,
       'root': <Application at >,
       'template': <FSPageTemplate at
/pierregavin/pierregavin.ch/file_view used for
/pierregavin/pierregavin.ch/cours-recents/zurich-mas-okt-dez-2007/02-Verschiedene-Katalogformen.pdf>,
       'traverse_subpath': [],
       'user': <SpecialUser 'Anonymous User'>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 161, in _eval
  Module Products.PageTemplates.Expressions, line 123, in render
  Module Products.ATContentTypes.content.base, line 300, in get_content_type
AttributeError: 'NoneType' object has no attribute 'getAccessor'

--
Added by Andreas Zeidler on May 19, 2009 09:46 PM
Issue state: UnconfirmedResolved
Responsible manager: (UNASSIGNED)witsch
the blob-based content items are missing the new sub-type marker interfaces (which were introduced with image support, i.e. in 1.0b3). those markers can be added using a maintenance view introduced in http://dev.plone.org/plone/changeset/27022 and release in 1.0b4:

  http://localhost:8080/[…]/resetSubtypes

clicking that link will search the catalog and reset the sub-type markers for all blob-based content. the host, port and id of your plone site might differ here, of course.

Added by Thomas Kiser on May 21, 2009 10:20 PM
Issue state: ResolvedConfirmed
Sorry, but no luck: after installing 1.0b4 over 1.0b2 and calling the maintenance view, there's no more error. BUT: the files are no more viewable: the xyz.pdf/view does not show up the xyz.pdf and causes "a loop". See attached image. :-(

Attached:
Clipboard03a.jpg — image/jpeg, 296 Kb
Added by (anonymous) on May 22, 2009 12:19 PM
did you re-install the package via the control panel/quick-installer (or re-apply the profile in the setup tool)? i've also had this effect (of getting a 404) during debugging, but a re-install solved it... i didn't have time to investigate further, though.
Added by Andreas Zeidler on May 22, 2009 12:20 PM
Target release: None1.0
that last commment was by me, btw — forgot to log in... :)
Added by Jukka Ojaniemi on May 28, 2009 10:12 AM
We're having exactly same problem with 1.0b4. Resetting subtypes solved the first problem, but then our site is having 404 errors when trying to access files. We tested this with Plone 3.2.2 and Plone 3.1.7.

This also happens with fresh plone site without any other addons or data. Reinstalling package or re-applying profile doesn't have any effect.
Added by Andreas Zeidler on May 28, 2009 12:45 PM
Severity: MediumCritical
ok, i'll check again on tuesday. re-installing seemed to have done the trick for me, but i didn't have much time to investigate...

but just to be clear: you mean that you're also getting 404s on a fresh, non-migrated site with plone 3.2.2 and b4?
Added by Jukka Ojaniemi on May 29, 2009 08:38 AM
Yeah. I tested it with a new plone-site in a brand new Plone 3.2.2 buildout which was made just for this test.

I tried same test now again and there is one difference compared to our migrated site results. I can see the data I added from filesystem in my blobstorage folder, and it works if I remove the /view part from the end of url. So basically the files view-template seems to be somehow messed up.

Our migrated test site (from 1.0b2 -> 1.0b4) gives 404 when I remove the '/view' from the end of url. One possible reason for our migration site porblems could be that the sites data.fs and blobstorage was copied from our production site to this migration test site to see if the product/plone update works (we updated our plone site at the same time from 3.1.5 to 3.2.2).

Does the blobstorage mind if it's data are copied to another instance when the path inside the buildout are still the same (var/blobstorage)?
Added by Andreas Zeidler on May 29, 2009 12:02 PM
thanks for those details — like i said i'll look into it on tuesday.

as for the blobstorage location, no, you can move it around to wherever you like as long as you update the path in your `buildout.cfg`/`zope.conf`. so copying both file- and blobstorage from your production site in order to test the migration is perfectly okay, and in fact just what you should do...
Added by Andreas Zeidler on May 29, 2009 10:34 PM
after some click-testing i found that quick-installing `plone.app.imaging` resolves the 404 issue. i'll dig deeper asap, but you should be able to use this as a workaround for now.

technically you don't need the package at the moment, but it is required for image support (i.e. storing images in blobs) and chances are you'll want its functionality anyway... ;)
Added by Andreas Zeidler on Jun 20, 2009 10:22 PM
Issue state: ConfirmedResolved
http://dev.plone.org/old/plone/changeset/27555/ should finally and properly fix the 404 for `/view`. jukka, could you please verify it works for you?

No responses can be added.