DirectoryStorage product - zope won't start
using python 2.4.5 Zope 2.11.1-final DirectoryStorage 1.1.19 First, is there a more preferable product to use to serve files, mostly PDF, from the file system with Zope? I suspect lock_file.py has changed since the DirectoryStorage product was last updated. I followed instructions on http://dirstorage.sourceforge.net/install.html to install DirectoryStorage. I got to step 11. "Start Zope" and at the end of Traceback 1 (see below) File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/PosixFilesystem.py", line 12, in ? from ZODB.lock_file import lock_file ImportError: cannot import name lock_file There are no classes or methods named lock_file in lock_file.py so I changed the import statement in PosixFilesystem.py to from ZODB import lock_file Then the same thing occured in BaseDirectoryStorage.py and I made the same change to that import statement. (see Traceback 2) Now (see Traceback 3) I get File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/LocalFilesystem.py", line 55, in engage raise DirectoryStorageError('Storage is locked by another process') DirectoryStorage.utils.DirectoryStorageError: Storage is locked by another process But I'm not sure how to overcome this or is this because the locK_file problem but I suspect so. I can't find anything that indicates Storage is locked except for the end of that traceback. I don't know if I need to do " from ZODB.lock_file import _lock_file " or something else. Any help would be appreciated. Thanks, Thomas ================================================== Traceback 1 [xxxx@reserves bin]# ./zopectl fg /opt/zopehome/bin/runzope -X debug-mode=on 2008-09-09 12:16:16 INFO ZServer HTTP server started at Tue Sep 9 12:16:16 2008 Hostname: reserves.library.appstate.edu Port: 8080 2008-09-09 12:16:17 INFO Zope Set effective user to "effective_user_here" ^[[ATraceback (most recent call last): File "/opt/zope/lib/python/Zope2/Startup/run.py", line 56, in ? run() File "/opt/zope/lib/python/Zope2/Startup/run.py", line 21, in run starter.prepare() File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 109, in prepare self.startZope() File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 300, in startZope Zope2.startup() File "/opt/zope/lib/python/Zope2/__init__.py", line 47, in startup _startup() File "/opt/zope/lib/python/Zope2/App/startup.py", line 65, in startup DB = dbtab.getDatabase('/', is_root=1) File "/opt/zope/lib/python/Zope2/Startup/datatypes.py", line 288, in getDatabase db = factory.open(name, self.databases) File "/opt/zope/lib/python/Zope2/Startup/datatypes.py", line 186, in open DB = self.createDB(database_name, databases) File "/opt/zope/lib/python/Zope2/Startup/datatypes.py", line 183, in createDB return ZODBDatabase.open(self, databases) File "/opt/zope/lib/python/ZODB/config.py", line 97, in open storage = section.storage.open() File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/config.py", line 5, in open from DirectoryStorage.Storage import Storage File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/Storage.py", line 1, in ? from Filesystem import Filesystem File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/Filesystem.py", line 9, in ? from PosixFilesystem import PosixFilesystem as Filesystem File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/PosixFilesystem.py", line 12, in ? from ZODB.lock_file import lock_file ImportError: cannot import name lock_file ======================================================================= Traceback 2 [xxxx@reserves bin]# ./zopectl fg /opt/zopehome/bin/runzope -X debug-mode=on 2008-09-09 12:43:22 INFO ZServer HTTP server started at Tue Sep 9 12:43:22 2008 Hostname: reserves.library.appstate.edu Port: 8080 2008-09-09 12:43:22 INFO Zope Set effective user to "effective_user_here" Traceback (most recent call last): File "/opt/zope/lib/python/Zope2/Startup/run.py", line 56, in ? run() File "/opt/zope/lib/python/Zope2/Startup/run.py", line 21, in run starter.prepare() File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 109, in prepare self.startZope() File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 300, in startZope Zope2.startup() File "/opt/zope/lib/python/Zope2/__init__.py", line 47, in startup _startup() File "/opt/zope/lib/python/Zope2/App/startup.py", line 65, in startup DB = dbtab.getDatabase('/', is_root=1) File "/opt/zope/lib/python/Zope2/Startup/datatypes.py", line 288, in getDatabase db = factory.open(name, self.databases) File "/opt/zope/lib/python/Zope2/Startup/datatypes.py", line 186, in open DB = self.createDB(database_name, databases) File "/opt/zope/lib/python/Zope2/Startup/datatypes.py", line 183, in createDB return ZODBDatabase.open(self, databases) File "/opt/zope/lib/python/ZODB/config.py", line 97, in open storage = section.storage.open() File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/config.py", line 6, in open return Storage(self.config.path, read_only=self.config.read_only) File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/Storage.py", line 7, in Storage from Full import Full as S File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/Full.py", line 13, in ? from BaseDirectoryStorage import BaseDirectoryStorage File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/BaseDirectoryStorage.py", line 11, in ? from ZODB.lock_file import lock_file ImportError: cannot import name lock_file ========================================================================= Traceback 3 [xxxx@reserves bin]# ./zopectl fg /opt/zopehome/bin/runzope -X debug-mode=on 2008-09-09 12:58:57 INFO ZServer HTTP server started at Tue Sep 9 12:58:57 2008 Hostname: reserves.library.appstate.edu Port: 8080 2008-09-09 12:58:57 INFO Zope Set effective user to "effective_user_here" Traceback (most recent call last): File "/opt/zope/lib/python/Zope2/Startup/run.py", line 56, in ? run() File "/opt/zope/lib/python/Zope2/Startup/run.py", line 21, in run starter.prepare() File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 109, in prepare self.startZope() File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 300, in startZope Zope2.startup() File "/opt/zope/lib/python/Zope2/__init__.py", line 47, in startup _startup() File "/opt/zope/lib/python/Zope2/App/startup.py", line 65, in startup DB = dbtab.getDatabase('/', is_root=1) File "/opt/zope/lib/python/Zope2/Startup/datatypes.py", line 288, in getDatabase db = factory.open(name, self.databases) File "/opt/zope/lib/python/Zope2/Startup/datatypes.py", line 186, in open DB = self.createDB(database_name, databases) File "/opt/zope/lib/python/Zope2/Startup/datatypes.py", line 183, in createDB return ZODBDatabase.open(self, databases) File "/opt/zope/lib/python/ZODB/config.py", line 97, in open storage = section.storage.open() File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/config.py", line 6, in open return Storage(self.config.path, read_only=self.config.read_only) File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/Storage.py", line 12, in Storage return apply(S, (fs,)+args, kwargs) File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/BaseDirectoryStorage.py", line 33, in __init__ self.filesystem.engage(synchronous) File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/LocalFilesystem.py", line 55, in engage raise DirectoryStorageError('Storage is locked by another process') DirectoryStorage.utils.DirectoryStorageError: Storage is locked by another process -- ==================================================================== Thomas McMillan Grant Bennett Appalachian State University Operations & Systems Analyst P O Box 32026 University Library Boone, North Carolina 28608 (828) 262 6587 "... using OpenOffice.org, and save them back to disk automatically, in MS Word format. They surf the Web, check e-mail, do instant messaging, view YouTube videos, visit their Facebook pages, learn touch-typing skills and lots more. Our public library has been offering these Linux public stations for the past three years." - Phil Shapiro Linux Journal January 2008 Library Systems Help Desk: https://www.library.appstate.edu/help/ ====================================================================
Thomas Bennett wrote at 2008-9-9 13:12 -0400:
using python 2.4.5 Zope 2.11.1-final DirectoryStorage 1.1.19
First, is there a more preferable product to use to serve files, mostly PDF, from the file system with Zope?
I suspect lock_file.py has changed since the DirectoryStorage product was last updated.
I followed instructions on http://dirstorage.sourceforge.net/install.html to install DirectoryStorage. I got to step 11. "Start Zope" and at the end of Traceback 1 (see below) File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/PosixFilesystem.py", line 12, in ? from ZODB.lock_file import lock_file ImportError: cannot import name lock_file
There are no classes or methods named lock_file in lock_file.py so I changed the import statement in PosixFilesystem.py to from ZODB import lock_file
The interface changed a bit. Now, it is assumed that "LockFile" is used (and "close" to release the lock). It is probably very simple to adapt "DirectoryStorage" correspondingly. -- Dieter
Thank you Dieter, I've found that DirectoryStorage is not what I was looking for. I didn't realize that DS was something more like an file system version of Data.fs. Trying to install LocalFS it is missing two files, see below, and this is what happens with LocalFS and the updated LocalFS called StreamingFS. I wanted something more like the LocalFS product but it fails not finding content_types and then after adding content_types.py from Zope 2.6.1 it can't find ts_regex. I see that content_types just uses re and mimetypes so I didn't think there would be any harm adding it from an older version of Zope to this one. I added ts_regex.py from the 2.6.1 Zope and I can add a LocalFS object but opening it I get "Resource not found" and no errors on the terminal running zopectl fg. Although when starting Zope I get /opt/zope/lib/python/ts_regex.py:15: DeprecationWarning: the regex module is deprecated; please use the re module import regex, regsub #, Sync /usr/local/lib/python2.4/regsub.py:15: DeprecationWarning: the regsub module is deprecated; please use re.sub() DeprecationWarning) /opt/zope/lib/python/OFS/Application.py:809: DeprecationWarning: __init__.py of Products.ExternalFile has a long deprecated 'methods' attribute. 'methods' support might be removed in Zope 2.11 or a later feature release. Please use the 'legacy' argument of registerClass instead if the methods are constructors. Or refactor the product using adapters. DeprecationWarning) But I'm not sure what is involved in refactoring or registerClass and don't know if that will allow LocalFS to operate properly if that is done. I assume filesystemview doesn't work with Zope alone, right? I have moved away from the ExternalFile product because using the batch method does not update files in secondary folders, just the current folder and there are too many secondary folders to have to update each one individually. So, to anyone, is there a Product that works that will allow transparent access to files on the filesystem through zope, like LocalFS? Thomas On Wednesday 10 September 2008 13:36, Dieter Maurer wrote:
Thomas Bennett wrote at 2008-9-9 13:12 -0400:
using python 2.4.5 Zope 2.11.1-final DirectoryStorage 1.1.19
First, is there a more preferable product to use to serve files, mostly PDF, from the file system with Zope?
I suspect lock_file.py has changed since the DirectoryStorage product was last updated.
I followed instructions on http://dirstorage.sourceforge.net/install.html to install DirectoryStorage. I got to step 11. "Start Zope" and at the end of Traceback 1 (see below) File "/usr/local/lib/python2.4/site-packages/DirectoryStorage/PosixFilesystem. py", line 12, in ? from ZODB.lock_file import lock_file ImportError: cannot import name lock_file
There are no classes or methods named lock_file in lock_file.py so I changed the import statement in PosixFilesystem.py to from ZODB import lock_file
The interface changed a bit.
Now, it is assumed that "LockFile" is used (and "close" to release the lock).
It is probably very simple to adapt "DirectoryStorage" correspondingly.
-- ==================================================================== Thomas McMillan Grant Bennett Appalachian State University Operations & Systems Analyst P O Box 32026 University Library Boone, North Carolina 28608 (828) 262 6587 "... using OpenOffice.org, and save them back to disk automatically, in MS Word format. They surf the Web, check e-mail, do instant messaging, view YouTube videos, visit their Facebook pages, learn touch-typing skills and lots more. Our public library has been offering these Linux public stations for the past three years." - Phil Shapiro Linux Journal January 2008 Library Systems Help Desk: https://www.library.appstate.edu/help/ ====================================================================
participants (2)
-
Dieter Maurer -
Thomas Bennett