zope.conf zodb_db/zeoclient tags can not have "storage" names with upper case

Bug #287550 reported by auspex
4
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Low
Unassigned

Bug Description

If the zope.conf <zeoclient> tag contains a "storage" with a mixed or upper case name, Zope/ZEO is unable to access the storage. If "storage" is lower case, or numeric, there's no problem.

zope.conf file contains:
<zodb_db CHONe>
    cache-size 5000
    <zeoclient>
      server 11100
      storage CHONe
      name CHONe_zeostorage
      var /home/Plone-buildout/parts/instance/var
      cache-size 30MB

    </zeoclient>
    mount-point /CHONemount
</zodb_db>

zeo.conf contains:
    <filestorage CHONe>
      path /home/Plone-buildout/filestorage/CHONe-Data.fs
    </filestorage>

An attempt to create the mount point from the ZMI results in:
2008-10-20T21:48:45 INFO ZEO.ClientStorage (9697) ClientStorage (pid=9697) created RW/normal for storage: 'CHONe'
------
2008-10-20T21:48:45 INFO ZEO.cache created temporary cache file '<fdopen>'
------
2008-10-20T21:48:45 INFO ZEO.ClientStorage (9697) Testing connection <ManagedClientConnection ('127.0.0.1', 11100)>
------
2008-10-20T21:48:45 INFO ZEO.zrpc.Connection(C) (127.0.0.1:11100) received handshake 'Z303'
------
2008-10-20T21:48:45 INFO ZEO.ClientStorage (9697) Server authentication protocol None
------
2008-10-20T21:48:45 ERROR ZEO.zrpc (9697) CW: error in testConnection (('127.0.0.1', 11100))
Traceback (most recent call last):
  File "/home/Plone-buildout/parts/zope2/lib/python/ZEO/zrpc/client.py", line 454, in test_connection
    self.preferred = self.client.testConnection(self.conn)
  File "/home/Plone-buildout/parts/zope2/lib/python/ZEO/ClientStorage.py", line 442, in testConnection
    stub.register(str(self._storage), self._is_read_only)
  File "/home/Plone-buildout/parts/zope2/lib/python/ZEO/ServerStub.py", line 74, in register
    self.rpc.call('register', storage_name, read_only)
  File "/home/Plone-buildout/parts/zope2/lib/python/ZEO/zrpc/connection.py", line 646, in call
    raise inst # error raised by server
ValueError: unknown storage: CHONe

Revision history for this message
Hanno Schlichting (hannosch) wrote :

If you specify an invalid value in your configuration the server does not start up. Trying to automagically make things work, is not a good solution. Fix your configuration to have the names in lower-case in all places.

Changed in zope2:
status: New → Won't Fix
Revision history for this message
auspex (auspex) wrote :

Sorry, but this is not right. I'm not trying to "automagically" do anything - and the server IS starting up.

Perhaps I was unclear about the location of the error, but the server says it has _created_ the storage:

2008-10-20T21:48:45 INFO ZEO.ClientStorage (9697) ClientStorage (pid=9697) created RW/normal for storage: 'CHONe'

and yet the failure is in "testConnection"

Zope _should_ tell me I specified an invalid connection, rather than telling me it created the storage and then failing.

In any case, I've been unable to find anything that tells me _what_ is a valid value for "storage"

Changed in zope2:
status: Won't Fix → New
Revision history for this message
Hanno Schlichting (hannosch) wrote :

Ah, sorry. I mistook this as a ticket for the buildout recipe configuring the storage. The Launchpad UI isn't very good at telling you to which project a ticket belongs.

In this case there might indeed a problem in Zope2. The definition of the configuration file only specifies this as an abstract type. It's explanation states that the used value is historically an integer. It doesn't mention strings to being allowed at all.

Revision history for this message
auspex (auspex) wrote :

Indeed I also filed a ticket against collective.recipe.storage, because it shouldn't create illegal configurations - and until I found collective.recipe.storage, I hadn't imagined that storage _could_ be anything but a number. So I don't have a problem using just lower case - or just numbers for that matter - but I agree that the server shouldn't start if the configuration is invalid, and in this case both the zeo and zope servers start up, and it isn't until I actually try to mount those storages that they fail.

Changed in zope2:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.