-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'Transaction' object has no attribute 'extension_bytes' [was: Tests in TravisCI are broken] #35
Comments
Storage instances in ZODB expect their In the past, one could get away with passing a zodbupdate/src/zodbupdate/update.py Lines 57 to 61 in cf93479
|
With ZODB-5.6.0: Today, i have this error while i run a migration:
|
Added the bug label because it seems end users are affected too. @1letter the workaround would be to use ZODB 5.5 to do the update. |
I patch ZODB locally, but i don't know what are sideeffect happens. but the migration runs. # BaseStorage.py
def tpc_begin(self, transaction, tid=None, status=' '):
if self._is_read_only:
raise POSException.ReadOnlyError()
with self._lock:
if self._transaction is transaction:
raise POSException.StorageTransactionError(
"Duplicate tpc_begin calls for same transaction")
self._commit_lock.acquire()
with self._lock:
self._transaction = transaction
self._clear_temp()
user = transaction.user
desc = transaction.description
# ext = transaction.extension_bytes
# my patch begin
try:
ext = transaction.extension_bytes
except:
ext = b''
# my patch end
self._ude = user, desc, ext
if tid is None:
now = time.time()
t = TimeStamp(*(time.gmtime(now)[:5] + (now % 60,)))
self._ts = t = t.laterThan(self._ts)
self._tid = t.raw()
else:
self._ts = TimeStamp(tid)
self._tid = tid
del self._resolved[:]
self._tstatus = status
self._begin(self._tid, user, desc, ext) |
Please don't use that patch if you have any data you care about in transaction extension data. That includes things like the username and note/description associated with the transaction. The note is commonly used to hold the URL of a web request, for example. |
Yes, with ZODB 5.5 can i migrate. @jamadden 👍 Thanks for advice. |
I have changed the title to contain the error message, instead of only that tests are broken. I am seeing the same. Python 2, Plone 5.2.2-pending. An earlier version of this pending release used Zope 4.4.4, with ZODB 5.5.1. There it works. But latest pending release has Zope 4.5 with ZODB 5.6.0 and there I have the error.
|
@mauritsvanrees I'm touching this issue with zodbupdate/src/zodbupdate/update.py Lines 57 to 61 in cf93479
You may be able to fix this by substituting |
I don't know enough about this to know if the above change from |
Unfortunately I don't have enough internal ZODB knowledge, I cannot judge if that's a 100% safe solution. |
Fixes #35 This applies the fix from #35 (comment)
All jobs besides the
OLDZODB
one are broken, e. g. https://travis-ci.org/github/zopefoundation/zodbupdate/jobs/701272511There are multiple test failures which all look like this:
Do we use a too new or too old version of
transaction
?The tests break locally in the same way.
There is even no
extension_bytes
in thetransaction
package.Am I missing something here?
The text was updated successfully, but these errors were encountered: