[ZODB-Dev] [ZODB 3.8/Blob] Error in rename_or_copy_blob()

Jim Fulton jim at zope.com
Mon Apr 26 11:13:35 EDT 2010


On Mon, Apr 26, 2010 at 6:34 AM, Andreas Jung <lists at zopyx.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi there,
>
> a customer site is running Plone 3.3 w/ plone.app.blob.
>
> While creating a 'File' instance we get the following error:
>
> 2010-04-26T13:17:07 ERROR Zope.SiteErrorLog 1272277027.360.157502129415
> http://www.deisa.eu/test-project/conversions/@@generate/generate
> Traceback (innermost last):
>  Module ZPublisher.Publish, line 125, in publish
>  Module Zope2.App.startup, line 238, in commit
>  Module transaction._manager, line 93, in commit
>  Module transaction._transaction, line 325, in commit
>  Module transaction._transaction, line 432, in _commitResources
>  Module ZODB.Connection, line 762, in tpc_finish
>  Module ZEO.ClientStorage, line 1088, in tpc_finish
>  Module ZEO.ClientStorage, line 1134, in _update_cache
>  Module ZODB.blob, line 772, in rename_or_copy_blob
> IOError: [Errno 13] Permission denied:
> '/home/plone/Plone/zeocluster/var/blobstorage/0x00/0x00/0x00/0x00/0x00/0x07/0x4c/0xf0/0x0385b9291ea836aa.blob'
>
> The Plone processes is running as user 'plone' (nothing related to
> setuid/effective-user) and all files and directories are owned by
> 'plone'. I could even create a new file from the debugger inside
> rename_or_copy_blob() inside the
> /home/plone/Plone/zeocluster/var/blobstorage/0x00/0x00/0x00/0x00/0x00/0x07/0x4c/0xf0
> directory.
>
> The related code in blob.py is:
>
> 759 def rename_or_copy_blob(f1, f2, chmod=True):
> 760     """Try to rename f1 to f2, fallback to copy.
> 761
> 762     Under certain conditions a rename might not work, e.g. because
> the target
> 763     directory is on a different partition. In this case we try to
> copy the
> 764     data and remove the old file afterwards.
> 765
> 766     """
> 767     try:
> 768         os.rename(f1, f2)
> 769     except OSError:
> 770         copied("Copied blob file %r to %r.", f1, f2)
> 771         file1 = open(f1, 'rb')
> 772         file2 = open(f2, 'wb')
>            ^^^^^^^^^^^^^^^^^^^^^^^
> 773         try:
> 774             utils.cp(file1, file2)
> 775         finally:
> 776             file1.close()
> 777             file2.close()
> 778         remove_committed(f1)
> 779     if chmod:
> 780         os.chmod(f2, stat.S_IREAD)
>
> Is this a known problem

No.

> and how can this be fixed.

I have no idea, and have no idea how to reproduce it.

Jim

-- 
Jim Fulton


More information about the ZODB-Dev mailing list