zopectl debug, 2.8.0 local zeo, Data.fs.lock file locking error
I am trying to use 'zopectl debug' for the first time with zope-2.8.0, local ZEO setup. It worked fine with zope-2.7.x and earlier. I am now getting a file locking error on Data.fs.lock, which stops the debug initialization at that point. The problem occurs whether I run zopectl as root or as the effective user ('zope') Can anyone familiar with local ZEO debugging on linux spot what might be the cause of the file locking error? Thanks. Zope Version : (Zope 2.8.0-final, python 2.4.1, linux2) Python Version : 2.4.1 (#1, Jun 17 2005, 09:31:29) [GCC 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8)] System Platform : linux2 SOFTWARE_HOME : /usr/lib/zope-2.8.0/lib/python ZOPE_HOME : /usr/lib/zope-2.8.0 INSTANCE_HOME : /var/lib/zope/zope-2.8.0 CLIENT_HOME : /var/lib/zope/zope-2.8.0/var Network Services : ZServer.HTTPServer.zhttp_server (Port: 8080) in /var/lib/zope/zope-2.8.0/etc/zope.conf: # Directive: effective-user effective-user zope # /var/lib/zope/zope-2.8.0/var $ ls -al drwxr-xr-x 3 zope zope 336 Jul 4 14:59 . drwxr-xr-x 9 root root 280 Jun 25 03:08 .. -rw-r--r-- 1 zope zope 4849715 Jul 4 14:59 Data.fs -rw-r--r-- 1 zope zope 55987 Jul 3 18:05 Data.fs.index -rw-r--r-- 1 zope zope 6 Jul 4 14:59 Data.fs.lock -rw-r--r-- 1 zope zope 4874585 Jul 3 18:04 Data.fs.old -rw-r--r-- 1 zope zope 154247 Jul 4 14:59 Data.fs.tmp -rw-rw-r-- 1 zope zope 299 Jun 25 03:08 README.txt -rw-r--r-- 1 zope zope 5 Jul 4 14:59 Z2.lock -rw-r--r-- 1 zope zope 5 Jul 4 14:59 Z2.pid drwxr-xr-x 2 zope zope 14648 Jul 4 14:08 pts srwx------ 1 root root 0 Jul 4 14:59 zopectlsock # /var/lib/zope/zope-2.8.0/bin/zopectl debug /usr/lib/python2.4/whrandom.py:38: DeprecationWarning: the whrandom module is deprecated; please use the random module DeprecationWarning) Starting debugger (the name "app" is bound to the top-level Zope object) /usr/lib/python2.4/whrandom.py:38: DeprecationWarning: the whrandom module is deprecated; please use the random module DeprecationWarning) /usr/lib/zope-2.8.0/lib/python/Products/CMFCore/CMFCorePermissions.py:24: DeprecationWarning: The module, 'Products.CMFCore.CMFCorePermissions' is a deprecated compatiblity alias for 'Products.CMFCore.permissions'; please use the new module instead. "the new module instead.", DeprecationWarning) 2005-07-04 14:59:58 WARNING PortalTransforms Unable to find binary "rtf-converter" in /usr/(snip) 2005-07-04 14:59:58 WARNING PortalTransforms Unable to find binary "rtf2xml" in /usr/(snip) 2005-07-04 14:59:58 WARNING PortalTransforms Unable to find binary "lynx" in /usr/(snip) /usr/lib/zope-2.8.0/lib/python/Products/CMFCore/utils.py:622: DeprecationWarning: format_stx() will be removed in CMF 1.6. Please use StructuredText.StructuredText.HTML instead. DeprecationWarning) 2005-07-04 15:00:03 ERROR ZODB.lock_file Error locking file /var/lib/zope/zope-2.8.0/var/Data.fs.lock Traceback (most recent call last): File "/usr/lib/zope-2.8.0/lib/python/ZODB/lock_file.py", line 63, in __init__ lock_file(self._fp) File "/usr/lib/zope-2.8.0/lib/python/ZODB/lock_file.py", line 42, in lock_file fcntl.flock(file.fileno(), _flags) IOError: [Errno 11] Resource temporarily unavailable Traceback (most recent call last): File "<string>", line 1, in ? File "/usr/lib/zope-2.8.0/lib/python/Zope2/__init__.py", line 51, in app startup() File "/usr/lib/zope-2.8.0/lib/python/Zope2/__init__.py", line 47, in startup _startup() File "/usr/lib/zope-2.8.0/lib/python/Zope2/App/startup.py", line 56, in startup DB = configuration.dbtab.getDatabase('/', is_root=1) File "/usr/lib/zope-2.8.0/lib/python/DBTab/DBTab.py", line 96, in getDatabase db = self._createDatabase(name, is_root) File "/usr/lib/zope-2.8.0/lib/python/DBTab/DBTab.py", line 113, in _createDatabase db = factory.open() File "/usr/lib/zope-2.8.0/lib/python/Zope2/Startup/datatypes.py", line 163, in open DB = self.createDB() File "/usr/lib/zope-2.8.0/lib/python/Zope2/Startup/datatypes.py", line 160, in createDB return ZODBDatabase.open(self) File "/usr/lib/zope-2.8.0/lib/python/ZODB/config.py", line 97, in open storage = section.storage.open() File "/usr/lib/zope-2.8.0/lib/python/ZODB/config.py", line 133, in open quota=self.config.quota) File "/usr/lib/zope-2.8.0/lib/python/ZODB/FileStorage/FileStorage.py", line 114, in __init__ self._lock_file = LockFile(file_name + '.lock') File "/usr/lib/zope-2.8.0/lib/python/ZODB/lock_file.py", line 63, in __init__ lock_file(self._fp) File "/usr/lib/zope-2.8.0/lib/python/ZODB/lock_file.py", line 42, in lock_file fcntl.flock(file.fileno(), _flags) IOError: [Errno 11] Resource temporarily unavailable
Other than this problem with debug, this zope is functioning normally. The only modification I have made is to symlink in BTreeFolder2 from the Plone 2.1 svn bundle, which reportedly includes fixes identified after 2.8.0 release.
File permissions. The user who is the effective user does not have permission to overwrite the Data.fs.lock file. On Mon, 2005-07-04 at 15:29 +0000, Jeff Kowalczyk wrote:
I am trying to use 'zopectl debug' for the first time with zope-2.8.0, local ZEO setup. It worked fine with zope-2.7.x and earlier. I am now getting a file locking error on Data.fs.lock, which stops the debug initialization at that point. The problem occurs whether I run zopectl as root or as the effective user ('zope')
Can anyone familiar with local ZEO debugging on linux spot what might be the cause of the file locking error? Thanks.
Zope Version : (Zope 2.8.0-final, python 2.4.1, linux2) Python Version : 2.4.1 (#1, Jun 17 2005, 09:31:29) [GCC 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8)] System Platform : linux2 SOFTWARE_HOME : /usr/lib/zope-2.8.0/lib/python ZOPE_HOME : /usr/lib/zope-2.8.0 INSTANCE_HOME : /var/lib/zope/zope-2.8.0 CLIENT_HOME : /var/lib/zope/zope-2.8.0/var Network Services : ZServer.HTTPServer.zhttp_server (Port: 8080)
in /var/lib/zope/zope-2.8.0/etc/zope.conf: # Directive: effective-user effective-user zope
# /var/lib/zope/zope-2.8.0/var $ ls -al drwxr-xr-x 3 zope zope 336 Jul 4 14:59 . drwxr-xr-x 9 root root 280 Jun 25 03:08 .. -rw-r--r-- 1 zope zope 4849715 Jul 4 14:59 Data.fs -rw-r--r-- 1 zope zope 55987 Jul 3 18:05 Data.fs.index -rw-r--r-- 1 zope zope 6 Jul 4 14:59 Data.fs.lock -rw-r--r-- 1 zope zope 4874585 Jul 3 18:04 Data.fs.old -rw-r--r-- 1 zope zope 154247 Jul 4 14:59 Data.fs.tmp -rw-rw-r-- 1 zope zope 299 Jun 25 03:08 README.txt -rw-r--r-- 1 zope zope 5 Jul 4 14:59 Z2.lock -rw-r--r-- 1 zope zope 5 Jul 4 14:59 Z2.pid drwxr-xr-x 2 zope zope 14648 Jul 4 14:08 pts srwx------ 1 root root 0 Jul 4 14:59 zopectlsock
# /var/lib/zope/zope-2.8.0/bin/zopectl debug
/usr/lib/python2.4/whrandom.py:38: DeprecationWarning: the whrandom module is deprecated; please use the random module
DeprecationWarning)
Starting debugger (the name "app" is bound to the top-level Zope object)
/usr/lib/python2.4/whrandom.py:38: DeprecationWarning: the whrandom module is deprecated; please use the random module
DeprecationWarning)
/usr/lib/zope-2.8.0/lib/python/Products/CMFCore/CMFCorePermissions.py:24: DeprecationWarning: The module, 'Products.CMFCore.CMFCorePermissions' is a deprecated compatiblity alias for 'Products.CMFCore.permissions'; please use the new module instead. "the new module instead.", DeprecationWarning)
2005-07-04 14:59:58 WARNING PortalTransforms Unable to find binary "rtf-converter" in /usr/(snip)
2005-07-04 14:59:58 WARNING PortalTransforms Unable to find binary "rtf2xml" in /usr/(snip)
2005-07-04 14:59:58 WARNING PortalTransforms Unable to find binary "lynx" in /usr/(snip)
/usr/lib/zope-2.8.0/lib/python/Products/CMFCore/utils.py:622: DeprecationWarning: format_stx() will be removed in CMF 1.6. Please use StructuredText.StructuredText.HTML instead.
DeprecationWarning)
2005-07-04 15:00:03 ERROR ZODB.lock_file Error locking file /var/lib/zope/zope-2.8.0/var/Data.fs.lock
Traceback (most recent call last):
File "/usr/lib/zope-2.8.0/lib/python/ZODB/lock_file.py", line 63, in __init__
lock_file(self._fp)
File "/usr/lib/zope-2.8.0/lib/python/ZODB/lock_file.py", line 42, in lock_file
fcntl.flock(file.fileno(), _flags)
IOError: [Errno 11] Resource temporarily unavailable
Traceback (most recent call last):
File "<string>", line 1, in ?
File "/usr/lib/zope-2.8.0/lib/python/Zope2/__init__.py", line 51, in app
startup()
File "/usr/lib/zope-2.8.0/lib/python/Zope2/__init__.py", line 47, in startup
_startup()
File "/usr/lib/zope-2.8.0/lib/python/Zope2/App/startup.py", line 56, in startup
DB = configuration.dbtab.getDatabase('/', is_root=1)
File "/usr/lib/zope-2.8.0/lib/python/DBTab/DBTab.py", line 96, in getDatabase
db = self._createDatabase(name, is_root)
File "/usr/lib/zope-2.8.0/lib/python/DBTab/DBTab.py", line 113, in _createDatabase
db = factory.open()
File "/usr/lib/zope-2.8.0/lib/python/Zope2/Startup/datatypes.py", line 163, in open
DB = self.createDB()
File "/usr/lib/zope-2.8.0/lib/python/Zope2/Startup/datatypes.py", line 160, in createDB
return ZODBDatabase.open(self)
File "/usr/lib/zope-2.8.0/lib/python/ZODB/config.py", line 97, in open
storage = section.storage.open()
File "/usr/lib/zope-2.8.0/lib/python/ZODB/config.py", line 133, in open
quota=self.config.quota)
File "/usr/lib/zope-2.8.0/lib/python/ZODB/FileStorage/FileStorage.py", line 114, in __init__
self._lock_file = LockFile(file_name + '.lock')
File "/usr/lib/zope-2.8.0/lib/python/ZODB/lock_file.py", line 63, in __init__
lock_file(self._fp)
File "/usr/lib/zope-2.8.0/lib/python/ZODB/lock_file.py", line 42, in lock_file
fcntl.flock(file.fileno(), _flags)
IOError: [Errno 11] Resource temporarily unavailable
Other than this problem with debug, this zope is functioning normally. The only modification I have made is to symlink in BTreeFolder2 from the Plone 2.1 svn bundle, which reportedly includes fixes identified after 2.8.0 release.
_______________________________________________ Zope maillist - Zope@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 )
Chris McDonough wrote:
File permissions. The user who is the effective user does not have permission to overwrite the Data.fs.lock file.
effective-user zope # /var/lib/zope/zope-2.8.0/var $ ls -al drwxr-xr-x 3 zope zope 336 Jul 4 14:59 . drwxr-xr-x 9 root root 280 Jun 25 03:08 .. -rw-r--r-- 1 zope zope 4849715 Jul 4 14:59 Data.fs -rw-r--r-- 1 zope zope 55987 Jul 3 18:05 Data.fs.index -rw-r--r-- 1 zope zope 6 Jul 4 14:59 Data.fs.lock -rw-r--r-- 1 zope zope 4874585 Jul 3 18:04 Data.fs.old -rw-r--r-- 1 zope zope 154247 Jul 4 14:59 Data.fs.tmp -rw-rw-r-- 1 zope zope 299 Jun 25 03:08 README.txt -rw-r--r-- 1 zope zope 5 Jul 4 14:59 Z2.lock -rw-r--r-- 1 zope zope 5 Jul 4 14:59 Z2.pid drwxr-xr-x 2 zope zope 14648 Jul 4 14:08 pts srwx------ 1 root root 0 Jul 4 14:59 zopectlsock
I get a little fuzzy on when the changeover from user root to user zope happens, but this is the confusing point, and why I originally excerpted the directory listing: doesn't (effective) user zope already have read-write on the Data.fs.lock file? Should I add user root to group zope, or would that defeat the security purpose of the effective-user? Or can you recommend the correct chmod setting for this setup, I don't want to 755 the thing into wide-open access without knowing what I'm doing. Thanks.
If you dont think it's file permissions, one thing this could also be... is your data.fs on an NFS partition? flock doesn't work well on NFS. On Mon, 2005-07-04 at 21:38 +0000, Jeff Kowalczyk wrote:
Chris McDonough wrote:
File permissions. The user who is the effective user does not have permission to overwrite the Data.fs.lock file.
effective-user zope # /var/lib/zope/zope-2.8.0/var $ ls -al drwxr-xr-x 3 zope zope 336 Jul 4 14:59 . drwxr-xr-x 9 root root 280 Jun 25 03:08 .. -rw-r--r-- 1 zope zope 4849715 Jul 4 14:59 Data.fs -rw-r--r-- 1 zope zope 55987 Jul 3 18:05 Data.fs.index -rw-r--r-- 1 zope zope 6 Jul 4 14:59 Data.fs.lock -rw-r--r-- 1 zope zope 4874585 Jul 3 18:04 Data.fs.old -rw-r--r-- 1 zope zope 154247 Jul 4 14:59 Data.fs.tmp -rw-rw-r-- 1 zope zope 299 Jun 25 03:08 README.txt -rw-r--r-- 1 zope zope 5 Jul 4 14:59 Z2.lock -rw-r--r-- 1 zope zope 5 Jul 4 14:59 Z2.pid drwxr-xr-x 2 zope zope 14648 Jul 4 14:08 pts srwx------ 1 root root 0 Jul 4 14:59 zopectlsock
I get a little fuzzy on when the changeover from user root to user zope happens, but this is the confusing point, and why I originally excerpted the directory listing: doesn't (effective) user zope already have read-write on the Data.fs.lock file?
Should I add user root to group zope, or would that defeat the security purpose of the effective-user? Or can you recommend the correct chmod setting for this setup, I don't want to 755 the thing into wide-open access without knowing what I'm doing. Thanks.
_______________________________________________ Zope maillist - Zope@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 )
Chris McDonough wrote:
If you dont think it's file permissions, one thing this could also be... is your data.fs on an NFS partition? flock doesn't work well on NFS.
This is a local ReiserFS partition. The zope and zeo are on the local machine, communicating over port 9999. I just checked, and it is not the 'zopectl debug' that fails, it is the second connection to the running zeo; if you run zopectl debug first, that starts, and the normal zope service will fail instead. I just did a chmod 666 Data.fs.lock -rw-rw-rw- 1 zope zope 6 Jul 4 22:15 Data.fs.lock And to my surprise, that doesn't change the second zeo connection problem, either.
Running zopectl debug runs your normal instance with additional debug breakpoints and pdb started. So in the same way that you cannot start the same instance twice, you cannot start your instance and a zopectl debug at the same time. Florent Jeff Kowalczyk <jtk@yahoo.com> wrote:
Chris McDonough wrote:
If you dont think it's file permissions, one thing this could also be... is your data.fs on an NFS partition? flock doesn't work well on NFS.
This is a local ReiserFS partition. The zope and zeo are on the local machine, communicating over port 9999.
I just checked, and it is not the 'zopectl debug' that fails, it is the second connection to the running zeo; if you run zopectl debug first, that starts, and the normal zope service will fail instead.
I just did a chmod 666 Data.fs.lock -rw-rw-rw- 1 zope zope 6 Jul 4 22:15 Data.fs.lock
And to my surprise, that doesn't change the second zeo connection problem, either.
-- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
On 5 Jul 2005, at 12:20, Florent Guillaume wrote:
Running zopectl debug runs your normal instance with additional debug breakpoints and pdb started. So in the same way that you cannot start the same instance twice, you cannot start your instance and a zopectl debug at the same time.
Umh, that's incorrect. zopectl debug has nothing to do with debug breakpoints or pdb. And you can run it right alongside your running Zope instance. All it does is present you with a Python prompt where the root object is bound to "app", nothing more and nothing less. jens
On 5 Jul 2005, at 12:55, Jens Vagelpohl wrote:
Umh, that's incorrect. zopectl debug has nothing to do with debug breakpoints or pdb. And you can run it right alongside your running Zope instance. All it does is present you with a Python prompt where the root object is bound to "app", nothing more and nothing less.
One correction: If you use ZEO you can run it alongside the running instance. Otherwise, since it would want exclusive access to the database, you could not. One of the reasons why ZEO is recommended even in single server setups. jens
On Mon, 04 Jul 2005 22:18:34 +0000, Jeff Kowalczyk wrote:
This is a local ReiserFS partition. The zope and zeo are on the local machine, communicating over port 9999.
I just checked, and it is not the 'zopectl debug' that fails, it is the second connection to the running zeo; if you run zopectl debug first, that starts, and the normal zope service will fail instead.
I just did a chmod 666 Data.fs.lock -rw-rw-rw- 1 zope zope 6 Jul 4 22:15 Data.fs.lock
And to my surprise, that doesn't change the second zeo connection problem, either.
The only thing I can think of which matches your symptoms is this. Is it possible you have misconfigured this new Zope 2.8 instance, and it's trying to use direct access to the Data.fs via FileStorage, instead of contacting zeo? Thanks, Malcolm. -- [] j a m k i t web solutions for charities malcolm cleaton T: 020 7549 0520 F: 020 7490 1152 M: 07986 563852 W: www.jamkit.com
Malcolm Cleaton wrote:
The only thing I can think of which matches your symptoms is this. Is it possible you have misconfigured this new Zope 2.8 instance, and it's trying to use direct access to the Data.fs via FileStorage, instead of contacting zeo?
I feel like a guy who brought the lawn mower in for repair, and they tell you 'its got no gas in it'. That was it of course, thanks for the catch. I normally diff-merge my zope.conf with each successive version, to pick up any new directives, comments, etc. I guess I forgot the zodb section at the tail end when moving from 2.7 to 2.8. It might be helpful to have the list of mounted databases (and thus ZEO vs. FS distinction) in the control panel summary, that seems like useful configuration summary information. Thanks again, and sorry to take up list traffic with a simple configuration mistake.
participants (5)
-
Chris McDonough -
Florent Guillaume -
Jeff Kowalczyk -
Jens Vagelpohl -
Malcolm Cleaton