Protocol error when committing transaction in an existing ZODB in VM shared directory
The following code raises an OSError: [Errno 71] Protocol error
at the second transaction commit when run with the shared directory of my VM as working directory. The wendelin version is 0.8.
The first set of instructions creates the database properly. When we re-open it, the content is still available and correct. But when the second set of instructions tries to add a new array and commit it, the error is raised. I could not reproduce the error in another folder.
import numpy as np
import transaction
from wendelin.bigarray.array_zodb import ZBigArray
from wendelin.lib.zodb import dbopen, dbclose
# Create the database
r = dbopen('test')
r['arr1'] = ZBigArray((30, 30), np.float)
transaction.commit()
dbclose(r)
# Re-open the same database
r = dbopen('test')
r['arr2'] = ZBigArray((30, 30), np.float)
transaction.commit() # OSError is raised here
dbclose(r)
Here is the stacktrace
Traceback (most recent call last):
File "/home/efn509/.PyCharmCE2016.3/config/scratches/scratch.py", line 9, in <module>
transaction.commit()
File "/home/efn509/anaconda3/envs/wendelin/lib/python3.5/site-packages/transaction/_manager.py", line 124, in commit
return self.get().commit()
File "/home/efn509/anaconda3/envs/wendelin/lib/python3.5/site-packages/transaction/_transaction.py", line 311, in commit
reraise(t, v, tb)
File "/home/efn509/anaconda3/envs/wendelin/lib/python3.5/site-packages/transaction/_compat.py", line 56, in reraise
raise value
File "/home/efn509/anaconda3/envs/wendelin/lib/python3.5/site-packages/transaction/_transaction.py", line 302, in commit
self._commitResources()
File "/home/efn509/anaconda3/envs/wendelin/lib/python3.5/site-packages/transaction/_transaction.py", line 447, in _commitResources
reraise(t, v, tb)
File "/home/efn509/anaconda3/envs/wendelin/lib/python3.5/site-packages/transaction/_compat.py", line 56, in reraise
raise value
File "/home/efn509/anaconda3/envs/wendelin/lib/python3.5/site-packages/transaction/_transaction.py", line 424, in _commitResources
rm.tpc_vote(self)
File "/home/efn509/anaconda3/envs/wendelin/lib/python3.5/site-packages/ZODB/Connection.py", line 786, in tpc_vote
s = vote(transaction)
File "/home/efn509/anaconda3/envs/wendelin/lib/python3.5/site-packages/ZODB/FileStorage/FileStorage.py", line 720, in tpc_vote
cp(self._tfile, self._file, dlen)
File "/home/efn509/anaconda3/envs/wendelin/lib/python3.5/site-packages/ZODB/utils.py", line 141, in cp
data = read(n)
OSError: [Errno 71] Protocol error
Here are the directory permissions:
abc999@debian8-abc999:/media/sf_shared$ ls -ld /media/sf_shared/
drwxrwx--- 1 root vboxsf 4096 Jan 4 15:04 /media/sf_shared/
And the user belongs to the vboxsf
group and thus has all the permissions.
Also, here are the details of the newly created ZODB :
-rwxrwx--- 1 root vboxsf 898 Jan 4 15:25 test
-rwxrwx--- 1 root vboxsf 56 Jan 4 15:25 test.index
-rwxrwx--- 1 root vboxsf 7 Jan 4 15:25 test.lock
-rwxrwx--- 1 root vboxsf 727 Jan 4 15:25 test.tmp