Submitted by : simon at: 2004-02-25T19:52:14+00:00 (13 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

Tiran reports this with zwiki 0.27.1, plone 2, zope 2.7 - after installation, adding a new wiki page fails with:

 This wiki's editform template gave an error.

 Traceback (most recent call last):
  File "/zope/instances/main/Products/ZWiki/UI.py", line 384, in editform
    oldid=self.id())
  File "/zope/releases/270/lib/python/Shared/DC/Scripts/Bindings.py", line 306, in __call__
    return self._bindAndExec(args, kw, None)
  File "/zope/releases/270/lib/python/Shared/DC/Scripts/Bindings.py", line 343, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File "/zope/instances/main/Products/CMFCore/FSPageTemplate.py", line 191, in _exec
    result = self.pt_render(extra_context=bound_names)
  File "/zope/instances/main/Products/CMFCore/FSPageTemplate.py", line 124, in pt_render
    result = FSPageTemplate.inheritedAttribute('pt_render')(
  File "/zope/releases/270/lib/python/Products/PageTemplates/PageTemplate.py", line 96, in pt_render
    tal=not source, strictinsert=0)()
  File "/zope/releases/270/lib/python/TAL/TALInterpreter.py", line 189, in __call__
    self.interpret(self.program)
  File "/zope/releases/270/lib/python/TAL/TALInterpreter.py", line 233, in interpret
    handlers[opcode](self, args)
  File "/zope/releases/270/lib/python/TAL/TALInterpreter.py", line 663, in do_useMacro
    self.interpret(macro)
  File "/zope/releases/270/lib/python/TAL/TALInterpreter.py", line 233, in interpret
    handlers[opcode](self, args)
  File "/zope/releases/270/lib/python/TAL/TALInterpreter.py", line 408, in do_optTag_tal
    self.do_optTag(stuff)
  File "/zope/releases/270/lib/python/TAL/TALInterpreter.py", line 393, in do_optTag
    return self.no_tag(start, program)
  File "/zope/releases/270/lib/python/TAL/TALInterpreter.py", line 388, in no_tag
    self.interpret(program)
  File "/zope/releases/270/lib/python/TAL/TALInterpreter.py", line 233, in interpret
    handlers[opcode](self, args)
  File "/zope/releases/270/lib/python/TAL/TALInterpreter.py", line 663, in do_useMacro
    self.interpret(macro)
  File "/zope/releases/270/lib/python/TAL/TALInterpreter.py", line 233, in interpret
    handlers[opcode](self, args)
  File "/zope/releases/270/lib/python/TAL/TALInterpreter.py", line 463, in do_setGlobal_tal
    self.engine.setGlobal(name, self.engine.evaluateValue(expr))
  File "/zope/releases/270/lib/python/Products/PageTemplates/TALES.py", line 221, in evaluate
    return expression(self)
  File "/zope/releases/270/lib/python/Products/PageTemplates/ZRPythonExpr.py", line 47, in __call__
    return eval(code, g, {})
  File "Python expression "portal.portal_actions.listFilteredActionsFor(here)"", line 1, in 
  File "/zope/instances/main/Products/CMFPlone/ActionsTool.py", line 60, in listFilteredActionsFor
    self._listActions(append,provider,info,ec)
  File "/zope/instances/main/Products/CMFCore/ActionsTool.py", line 253, in _listActions
    if ai.testCondition(ec):
  File "/zope/instances/main/Products/CMFCore/ActionInformation.py", line 90, in testCondition
    return self.condition(ec)
  File "/zope/instances/main/Products/CMFCore/Expression.py", line 44, in __call__
    res = compiled(econtext)
  File "/zope/releases/270/lib/python/Products/PageTemplates/Expressions.py", line 201, in __call__
    return self._eval(econtext)
  File "/zope/releases/270/lib/python/Products/PageTemplates/Expressions.py", line 196, in _eval
    return render(ob, econtext.vars)
  File "/zope/releases/270/lib/python/Products/PageTemplates/Expressions.py", line 103, in render
    ob = ob()
  File "/zope/instances/main/Products/ZWiki/Tracker.py", line 138, in hasIssues
    return self.issueCount() > 0
  File "/zope/instances/main/Products/ZWiki/Tracker.py", line 134, in issueCount
    return len(filter(lambda x:x[:7]=='IssueNo',self.pageIds()))
  File "/zope/instances/main/Products/ZWiki/Tracker.py", line 134, in 
    return len(filter(lambda x:x[:7]=='IssueNo',self.pageIds()))
  TypeError: unsubscriptable object

I'm only guessing it's zope 2.7 related.

More details: his pages() is

  1. returning PageBrains? instead of catalog brains
  2. returning an extra, bogus item which causes the above traceback

And yet pageObjects() returns the correct page objects and the code from pageObjects to pages seems very straightforward.


comments:

I have not experienced such a problem --JároliJózsef, Thu, 26 Feb 2004 10:12:51 -0800 reply
I use ZWiki 0.27.1 with 2.7.final Zope and 2.0-RC3 Plone without such problems (yet?)

property change --SimonMichael, Thu, 26 Feb 2004 20:29:51 -0800 reply
Title: IssueNo0722 adding a new wiki page in plone fails with zope 2.7 => IssueNo0722 adding a new wiki page in plone fails (with zope 2.7 ?)

a clue --SimonMichael, Thu, 26 Feb 2004 21:04:59 -0800 reply
pages() can also return PageBrain?'s, rather than catalog mybrains's, if some metadata is missing from the catalog (ensureCompleteMetadataIn). That's what's happening at Tiran's wiki and apparently plone.org and probably elsewhere, unlike at plone.zwiki.org.

With the catalog involved, the bogus item is explainable. Probably a stale catalog entry for a page that no longer exists. I don't know how it came about, any ideas ?

Rebuilding the catalog or deleting that entry should fix it; maybe that's what you did as the editform seems to be working.

The remaining question is what metadata is zwiki not finding in the catalog, and why didn't setupCatalog (which I think we called yesterday) put it there.

a catalog aberration.. --SimonMichael, Thu, 26 Feb 2004 21:09:05 -0800 reply
Title: IssueNo0722 adding a new wiki page in plone fails (with zope 2.7 ?) => IssueNo0722 adding a new wiki page in plone failing with "unsubscriptable object"

The same error with ZWiki 0.28 and Plone2 rc6 -- Mon, 01 Mar 2004 20:45:16 -0800 reply

any clues ? --SimonMichael, Tue, 02 Mar 2004 08:06:09 -0800 reply
Ok.. how can I reproduce ? What have you done with this wiki to date ?

reproduce -- Tue, 02 Mar 2004 08:39:31 -0800 reply
I've found that after renaming wiki page call to pageIds() returns a list containing None elements.

reproduce --SimonMichael, Tue, 02 Mar 2004 13:32:26 -0800 reply
Good lead! thanks!

reproduce --SimonMichael, Wed, 03 Mar 2004 21:50:52 -0800 reply
No good, still haven't made it happen. Blocked on #733 plone.zwiki.org has broken.

The same error with ZWiki 0.28 and Plone2 rc6 -- Thu, 04 Mar 2004 09:56:04 -0800 reply
When I try to view a wiki that used to work before Plone2-rc6:

 Version information
 Plone version: 2.0-rc6
 Zope version: (unreleased version, python 2.3.3, linux2)
 Apache version:
 CMF version (if known): CMF-1.4.3-rc1
 Browser(s) and version(s): Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6)  Gecko/20040113 
 Operating system: linux2
 Python version: 2.3.3 (#1, Feb 18 2004, 20:51:21) 
 [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)]
 Debug mode: Yes

 Traceback and product information
 Traceback (innermost last):
  Module ZPublisher.Publish, line 100, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 40, in call_object
  Module Products.ZWiki.ZWikiPage, line 236, in __call__
  Module Products.ZWiki.CMF, line 122, in __call__
  Module Shared.DC.Scripts.Bindings, line 306, in __call__
  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  Module Products.CMFCore.FSPageTemplate, line 191, in _exec
  Module Products.CMFCore.FSPageTemplate, line 124, in pt_render
  Module Products.PageTemplates.PageTemplate, line 96, in pt_render
   - <FSPageTemplate at /Documentation/wikipage_view used for /Documentation/general/HowToInstallPsycopg>
  Module TAL.TALInterpreter, line 189, in __call__
  Module TAL.TALInterpreter, line 233, in interpret
  Module TAL.TALInterpreter, line 663, in do_useMacro
  Module TAL.TALInterpreter, line 233, in interpret
  Module TAL.TALInterpreter, line 408, in do_optTag_tal
  Module TAL.TALInterpreter, line 393, in do_optTag
  Module TAL.TALInterpreter, line 388, in no_tag
  Module TAL.TALInterpreter, line 233, in interpret
  Module TAL.TALInterpreter, line 663, in do_useMacro
  Module TAL.TALInterpreter, line 233, in interpret
  Module TAL.TALInterpreter, line 463, in do_setGlobal_tal
  Module Products.PageTemplates.TALES, line 220, in evaluate
   - Line 3, Column 0
   - Expression: <PythonExpr portal.portal_actions.listFilteredActionsFor(here)>
   - Names:
      {'container': <PloneSite instance at 41bc4230>,
       'context': <ZWikiPage at /Documentation/general/HowToInstallPsycopg>,
       'default': <Products.PageTemplates.TALES.Default instance at 0x40cfb78c>,
       'here': <ZWikiPage at /Documentation/general/HowToInstallPsycopg>,
       'loop': <SafeMapping instance at 41167d00>,
       'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x40cfb28c>,
       'nothing': None,
       'options': {'REQUEST': <HTTPRequest, URL=http://65.34.95.140:38490/Documentation/general/HowToInstallPsycopg>,
                   'RESPONSE': ZServerHTTPResponse(''),
                   'args': (<ZWikiPage at /Documentation/general/HowToInstallPsycopg>,)},
       'repeat': <SafeMapping instance at 41167d00>,
       'request': <HTTPRequest, URL=http://65.34.95.140:38490/Documentation/general/HowToInstallPsycopg>,
       'root': <Application instance at 41bbce60>,
       'template': <FSPageTemplate at /Documentation/wikipage_view used for /Documentation/general/HowToInstallPsycopg>,
       'traverse_subpath': [],
       'user': jetfu}
  Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
   - __traceback_info__: portal.portal_actions.listFilteredActionsFor(here)
  Module Python expression "portal.portal_actions.listFilteredActionsFor(here)", line 1, in <expression>
  Module Products.CMFPlone.ActionsTool, line 60, in listFilteredActionsFor
  Module Products.CMFCore.ActionsTool, line 253, in _listActions
  Module Products.CMFCore.ActionInformation, line 90, in testCondition
  Module Products.CMFCore.Expression, line 44, in __call__
  Module Products.PageTemplates.Expressions, line 201, in __call__
  Module Products.PageTemplates.Expressions, line 196, in _eval
  Module Products.PageTemplates.Expressions, line 103, in render
  Module Products.ZWiki.Tracker, line 138, in hasIssues
  Module Products.ZWiki.Tracker, line 134, in issueCount
  Module Products.ZWiki.Tracker, line 134, in <lambda>
 TypeError: unsubscriptable object

 Installed Products:
 Archetypes 1.2.4 installed 
 BTreeFolder2 BTreeFolder2-0.5.0+  
 CMFActionIcons  installed 
 CMFCalendar CMF-1.4.3-rc1 installed 
 CMFCore CMF-1.4.3-rc1  
 CMFDefault CMF-1.4.3-rc1  
 CMFFormController RC3 installed 
 CMFPhoto 0.4.2 installed 
 CMFPhotoAlbum 0.4final installed 
 CMFPlone 2.0-rc6  
 CMFQuickInstallerTool 1.5 devel  
 CMFTopic CMF-1.4.3-rc1  
 DCWorkflow CMF-1.4.3-rc1  
 Epoz Epoz 0.7.5 installed 
 ExternalEditor 0.7  
 ExternalMethod External Method-1-0-0  
 Formulator Formulator 1.6.2  
 GroupUserFolder 2.0 installed 
 MIMETools   
 MailHost MailHost-1-3-0  
 OFSP OFSP-1-0-0  
 PageTemplates PageTemplates-1-4-0  
 PlacelessTranslationService UNRELEASED/CVS  
 PloneErrorReporting 0.1 installed 
 PluginIndexes   
 PortalTransforms 1.0.2-final installed 
 PythonScripts PythonScripts-2-0-0  
 Sessions   
 SiteAccess SiteAccess-2-0-0  
 SiteErrorLog   
 StandardCacheManagers StandardCacheManagers-1-1-0  
 TemporaryFolder   
 TextIndexNG2 2.0.5  
 Transience   
 ZCTextIndex   
 ZCatalog ZCatalog-2-2-0  
 ZGadflyDA   
 ZODBMountPoint   
 ZReST 1.1  
 ZSQLMethods   
 ZWiki ZWiki-0-28-0 installed 
 ZopeTutorial Zope Tutorial 1.1  
 generator 1.0.1  
 validation 1.0.1  

also getting that error w/ zwiki 0.28, plone 2.0rc3, and zope 2.6.4 -- Fri, 05 Mar 2004 15:21:47 -0800 reply
Same error message. Zwiki seems to have trouble anytime I start renaming pages...especially FrontPage. Even deleting and re-creating a wiki still gives errors.

a clue --simon, Sat, 13 Mar 2004 00:32:10 -0800 reply
pages() always returns PageBrains? until after a call to setupTracker(). Either way, with renaming etc. I haven't reproduced this at http://plone.zwiki.org . I wonder if it happens only when there are conflicts.

tried it in a btreefolder --SimonMichael, Sat, 13 Mar 2004 01:17:24 -0800 reply
See if you can do it at http://plone.zwiki.org/folder/btreefolder/TroubleAtTheRanch

tried it in a btreefolder --SimonMichael, Sat, 13 Mar 2004 01:18:46 -0800 reply
Oh, but wait for #744 plone.zwiki.org gives NameError filterOut for anonymous visitors

works with Plone2-final -- Tue, 16 Mar 2004 08:06:13 -0800 reply
When I upgraded from Plone-2-r6 to Plone-2-final all my pages work again.

good general troubleshooting advice --MarkBronstein?, Wed, 17 Mar 2004 06:49:28 -0800 reply
I ran into the same problem after importing a folder of wiki pages that had been exported from another zope instance. Based on the above, I recreated the plone catalog and the problem disappeared.

I suggest that this should be mentioned in the zwiki book as a good early troubleshooting step whenever odd problems occur, and definitely after any zwiki pages are copied in to a zope instance.

speedPack seems to cause problems -- Thu, 18 Mar 2004 06:46:29 -0800 reply
I was having this problem (zwiki pages broken and couldn't add them) with 2 servers each with plone2-rc6. I then upgraded them both to plone-2-final and one of them is working. The one that isn't working has 1 difference and that is that I have speedPack http://sourceforge.net/project/showfiles.php?group_id=55262&package_id=107326 installed. I haven't tested it but this seems to be the only difference

latest --SimonMichael, Thu, 18 Mar 2004 16:19:19 -0800 reply
That's interesting.. Tiran had speedpack I believe.. but, the poster of the second traceback above seems not to have it (judging by the product list).

Right now my understanding is that this is a one-off type of thing, affecting a few people, but not biting anyone repeatedly.

I'll put in some code to avoid it if I have to, but I'd rather understand the cause.

Happened to me after importing a folder from plone 1 -- Wed, 24 Mar 2004 12:58:17 -0800 reply
Im upgrading to plone 2. Fixed it by reindexing the catalog. Maybe the problem isn't new, its just happening more often now because we're all moving to plone 2 :) Marcos

update --simon, Fri, 26 Mar 2004 00:30:09 -0800 reply
I see a way this could happen, due to junk in the catalog; ensureCompleteMetadataIn now reads:

        If the catalog says eg page id is None, we don't do anything about that;
        we'll return it in the metadata.

        If getObject() returns None (a stale catalog entry), we return None.

I think either kind of junk would have led to a None in pageIds, causing the problem above, but it was probably the latter. pageIds() and pages() now guard against these cases respectively. Hopefully this will help, though we may find more such cases.

update --simon, Fri, 26 Mar 2004 00:32:11 -0800 reply
So if you are able to reproduce this right now, please let us know if the latest code fixes it.

property change --simon, Fri, 26 Mar 2004 00:38:05 -0800 reply
Status: open => pending

updating the catalog "fixes" the problem for me -- Tue, 30 Mar 2004 11:07:54 -0800 reply
I renamed a page by accident, removed the stub page and then renamed the page to its original name. After that, I had a folder "deleted wiki pages" when I removed that folder, the wiki was broken. After a bit more fidling the wiki was completely fubar (luckily it was a new one and I still have the text lying around). After that, I removed the entire wiki and the folder it was in. I could create wiki's in other folder without any problems, but not in a folder with the same name as the original folder. I use zope 2.7, plone 2.0 final, cmf 1.4.2 and zwiki 0.28.

updating the catalog "fixes" the problem for me --SimonMichael, Tue, 30 Mar 2004 11:32:29 -0800 reply
Please try with 0.29 if it happens again.

property change --SimonMichael, Sat, 10 Apr 2004 12:16:33 -0700 reply
Status: pending => closed

... --betabug, Wed, 21 Feb 2007 08:24:55 +0000 reply
Name: #722 adrienne => #722 adding a new wiki page in plone failing with "unsubscriptable object" Category: user-mail => user-editing Status: open => closed