Skip to content.

Etria Lists

 

[quills-dev] RPCAuth hook error on 1.6 upgrade

Tim Hicks tim at sitefusion.co.uk
Wed Jan 16 14:42:57 UTC 2008


Derek Richardson wrote:
> On Jan 16, 2008 8:34 AM, Tim Hicks <tim at sitefusion.co.uk> wrote:
>> Derek Richardson wrote:
>>> Hi all! I upgraded a site to Quills 1.6b? and every access through the
>>> browser spews a bunch of:
>>>
>>> 2008-01-15T16:17:15 ERROR ZPublisher BeforeTraverse: Error while
>>> invoking hook: "RPCAuth"
>>> Traceback (most recent call last):
>>>   File "/srv/share-it/parts/zope2/lib/python/ZPublisher/BeforeTraverse.py",
>>> line 145, in __call__
>>>     meth(*(container, request, None)[:args])
>>> AttributeError: __call__
>>>
>>> This, of course, is because the RPCAuth product is missing and
>>> represented by a broken icon in the ZMI. On a test site, I deleted the
>>> RPCAuth object from the site root in the ZMI and that caused the error
>>> messages to stop, with apparently no impact on site functionality. Is
>>> this the best way to handle this situation on my prod site? Does
>>> anyone know of a reason I should just delete the broken RPCAuth
>>> object?
>> Hi Derek,
>>
>> It should be fine to delete the RPCAuth object.  In fact, this should
>> really be done automatically in the migration step that gets called by
>> the QI tool (or is it GS these days?).  I don't suppose you'd be able to
>> add such a step to
>> <http://dev.plone.org/collective/browser/Quills/trunk/migrations/quills15to16.py>,
>> would you?  It would be a great help if you could :).
> 
> Might someone also be using the RPCAuth object for something besides
> Quills?

I guess that's possible.  However, I don't know of any other products 
using RPCAuth.

> Seems like we wouldn't want to auto-delete it, but somehow
> make it optional.  Either instructions in the README or a separate GS
> profile that could be imported if necessary? If we want a separate GS
> profile, I can write it. But it seems like overkill if all one is
> foing is deleting a broken object (see below).

My feeling on making it optional is to say YAGNI - which you should 
interpret as: I wouldn't bother myself, but have no objection to others 
bothering :).

>> While I'm thinking about this, strictly speaking just removing the
>> RPCAuth object is probably not quite sufficient.  You should probably
>> also do the equivalent of what RPCAuth.manage_beforeDelete does (as this
>> will obviously not get called when the RPCAuth product/code is absent).
>>   See <http://dev.plone.org/collective/browser/RPCAuth/trunk/RPCAuth.py>
>> for details.
> 
> Thanks for the pointer to _beforeDelete. However, it looks like it
> needs the code to be present to do what it does. Reproduced here for
> ease of reading:
> 
>     def manage_beforeDelete(self, item, container):
>         if item is self:
>             handle = self.meta_type + '/' + self.getId()
>             BeforeTraverse.unregisterBeforeTraverse(container, handle)
> 
> Particularly, what about the self.getId() ? I don't know how to get
> that if the object is broken....

You should just be able to hard-code the meta_type and id into the 
Quills migration step, rather than accessing it on the broken object. 
The id should be 'RPCAuth' - see the installRPCAuth function from the 
1.5 Quills installer 
<http://dev.plone.org/collective/browser/Quills/branches/1.5/Extensions/Install.py>. 
  meta_type = 'RPC Auth' is defined on the RPCAuth class.


Tim


More information about the quills-dev mailing list