[Zope] zForum problem

burley at zonnet.nl burley at zonnet.nl
Wed Mar 23 11:44:44 EST 2005


I'm using CookieCrumbler.py 1.18.10.1 from CMFPlone-2.0-final (I'm using Plone
indeed, yet at a lower level in the folder hierarch).
The error pops up just once for each of many attempts.
Also you say "...CookieCrumbler folder have read permission for the zope
user." I can't see the CookieCrumbler object is a folder (when I clikc it it's
just a "Cookie Crumbler" object with some properties).
However, in the zForum instance creation form when I switch off the checker
box for "Create user folder" I get past the previous error (at line 142 in
zForum.py). Instead, I obtain the following error message:

"""
Site Error

An error was encountered while publishing this resource.

Error Type: UnboundLocalError
Error Value: local variable 'files_dir' referenced before assignment
"""

with traceback in the Error Log file:

"""
Time  	2005/03/23 17:27:33.398 GMT+1
User Name (User Id) 	zope (zope)
Request URL 	http://localhost:8080/manage_addProduct/zForum/manage_addZForum
Exception Type 	UnboundLocalError
Exception Value 	local variable 'files_dir' referenced .
before assignment

Traceback (innermost last):

    * Module ZPublisher.Publish, line 101, in publish
    * Module ZPublisher.mapply, line 88, in mapply
    * Module ZPublisher.Publish, line 39, in call_object
    * Module Products.zForum.zForum, line 87, in manage_addZForum
    * Module Products.zForum.zForum, line 116, in __init__
    * Module Products.zForum.zForum, line 173, in zfSetupSystem

UnboundLocalError: local variable 'files_dir' referenced before assignment
"""
Around line 173 the zfSetupSystem method (in zForum) reads:
...
for k in [INSTANCE_HOME, SOFTWARE_HOME]:
      location = os.path.join(k, 'Products', 'zForum', 'www', 'forum_main')
      if os.path.exists(location):
         files_dir = location
for file in os.listdir(files_dir):                         # line 173
...

Apparently, in my session "os.path.exists(location)" evaluates to false,
files_dir becomes undefined (it's not defined before) yielding the runtime
error at 173. To me this looks like a bug...

As regards my problem, I can conclude that zForum creation seems to get past
the manage_addCC method when no user folder is created. What can we learn from
this. ...?

Citeren Cliff Ford <Cliff.Ford at ed.ac.uk>:

> OK - I am stumped! I have just created a zForum in my root folder 
> without a hitch. The problem is nothing to do with the root folder 
> acl_users folder or the database connection. It has to be something to 
> do with CookieCrumbler. Check you only have one installed (I assume you 
> are not using Plone). Check the version - mine is CookieCrumbler-1.2. 
> Have a look in __init__.py and CookieCrumbler.py to check they both have 
> manage_addCC references (i.e. have not been corrupted). Check that files 
> in the CookieCrumbler folder have read permission for the zope user.
> 
> You say the error keeps popping up again and again. Do you mean it pops 
> up many times during one installation attempt, or just once for each of 
> many attempts?
> 
> I this doesn't help you will need help from zForum or CookieCrumbler 
> experts. Did you try not checking the Create user folder checkbox? That 
> leaves out creation of acl_users so may not bother with the addCC call.
> 
> Cliff
> 
> H Jansen wrote:
> > I've gone through your details, yet I'm still stuck ;-( :
> > 
> > Cookie Crumbler is in the 'Add dropdown' list. Further, I try to keep
> > things simple as possible: zForum creation in root folder ("/"), single
> > acl_user ('zope', who is the Manager and by default has all permissions
> > including read/write permissions.); these all are aquired by
> > CookieCrumbler, zForum folders however do not exist at this stage since
> > zForum doesn't get past its instantiation. The error message:
> > 
> > 
> >>>>"""
> >>>>Site ErrorAn error was encountered while publishing this resource.
> >>>>
> >>>>Error Type: AttributeError
> >>>>Error Value: manage_addCC
> >>>>"""
> > 
> > 
> > keeps popping up again and again. The zope manager's password in
> acl_users is
> > different from that used in the database connection string; that can't be
> the
> > problem can it...?
> > 
> > 
> > On Wed, 2005-03-23 at 15:05, Cliff Ford wrote:
> > 
> >>Forgot to cc the list in the last reply. Line 142 of zForum.py says:
> >>
> >>CookieCrumbler.manage_addCC('cookie_authentication')
> >>
> >>and the error message is saying that it can't find manage_addCC in 
> >>CookieCrumbler (I have taken out the rest of the Error log from this 
> >>reply because it contained a plain text database connection string).
> >>
> >>Check that your Add dropdown list has Cookie Crumbler (Standalone) in 
> >>its list and that the Zope user has read/write access to the 
> >>CookieCrumbler and zForum folders.
> >>
> >>I have a test zForum installed and it just worked! If I create another 
> >>with a dud database connection string I get a database error when trying
> 
> >>to View (the installation appeared to work OK).
> >>
> >>Cliff
> >>
> >>H Jansen wrote:
> >>
> >>>Yep, that works. Here we go:
> >>>
> >>>Exception traceback
> >>>
> >>>Time
> >>>2005/03/23 14:08:12.432 GMT+1
> >>>User Name (User Id)
> >>>zope (zope)
> >>>Request URL
> >>>http://localhost:8080/mfts.nl/manage_addProduct/zForum/manage_addZForum
> >>>Exception Type
> >>>AttributeError
> >>>Exception Value
> >>>manage_addCC
> >>>
> >>>Traceback (innermost last):
> >>>
> >>>      * Module ZPublisher.Publish, line 101, in publish
> >>>      * Module ZPublisher.mapply, line 88, in mapply
> >>>      * Module ZPublisher.Publish, line 39, in call_object
> >>>      * Module Products.zForum.zForum, line 87, in manage_addZForum
> >>>      * Module Products.zForum.zForum, line 116, in __init__
> >>>      * Module Products.zForum.zForum, line 142, in zfSetupSystem
> >>>AttributeError: manage_addCC 
> >>>
> >>>
> >>
> >>... snip ...
> >>
> >>
> >>>On Wed, 2005-03-23 at 12:04, Cliff Ford wrote:
> >>>
> >>>
> >>>>Look at the Error Log for the Traceback, which tells you exactly where
> 
> >>>>the error occurred. That can often help pinpoint the problem by module
> 
> >>>>and line number - look at the Product code if necessary. Include the 
> >>>>Traceback in any question to the mailing list.
> >>>>
> >>>>Cliff
> >>>>
> >>>>burley at zonnet.nl wrote:
> >>>>
> >>>>
> >>>>>I've problems getting the zForum product working. When I try to create
> azForum
> >>>>>instance somewhere in my Zope site, I invariably obtain the
> errormessage:
> >>>>>
> >>>>>"""
> >>>>>Site ErrorAn error was encountered while publishing this resource.
> >>>>>
> >>>>>Error Type: AttributeError
> >>>>>Error Value: manage_addCC
> >>>>>"""
> >>>>>Looking for a solution on the internet, the closest I could get was
> >>>>>asdescribed in http://www.pcfltd.co.uk/docs/zforum.html (which is
> >>>>>aboutinstallation on a Windows machine; I'm working on Linux box).
> >>>>>
> >>>>>In the directory where I want to create the zForum:
> >>>>>1) I do have a database connection which is open en tested (works).
> >>>>>2) I do have a CookieCrumbler instance (which I'm not sure of
> whetherit's
> >>>>>essential or not...); the CookieCrubler properties are unchanged...
> (i.e.
> >>>>>__ac, __ac_name, __ac_password, etc)
> >>>>>3) In the zForum instance form I use the same connection string
> asdefined in
> >>>>>the database connection.
> >>>>>
> >>>>>The Site Error message keeps popping up all the time (...sigh).
> >>>>>Anyone some idea what's wrong...?
> >>>>>
> >>>>>
> >>
> >>_______________________________________________
> >>Zope maillist  -  Zope at zope.org
> >>http://mail.zope.org/mailman/listinfo/zope
> >>**   No cross posts or HTML encoding!  **
> >>(Related lists - 
> >> http://mail.zope.org/mailman/listinfo/zope-announce
> >> http://mail.zope.org/mailman/listinfo/zope-dev )
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 




-- 
_____________________________________________________________________
Versatel ADSL Gratis. De voordelen van gratis internet met de
snelheid van ADSL. Zonder abonnementskosten en zonder vast contract.
Je betaalt alleen voor de tijd online. Nu zonder aansluitkosten en 
met gratis modem. Bestel snel op www.versatel.nl.



More information about the Zope mailing list