[ZCM] [ZC] 852/ 8 Comment "ZODB Transaction error hangs Zope: AttributeError: Surrogate instance has no attribute '_p_oid'"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Sat May 22 19:46:40 EDT 2004


Issue #852 Update (Comment) "ZODB Transaction error hangs Zope: AttributeError: Surrogate instance has no attribute '_p_oid'"
 Status Pending, Zope/bug critical
To followup, visit:
  http://collector.zope.org/Zope/852

==============================================================
= Comment - Entry #8 by dunny on May 22, 2004 7:46 pm

Fix applied to Zope-2_7-branch that allows propagation of the initial error that caused the transaction failure:

    lib/python/ZODB/Transaction.py: 1.49.4.3
    lib/python/ZODB/tests/testTransaction.py: 1.12.20.4

FWIW, in my case the failure was problems in freetds-0.61_1 and unixODBC-2.2.5. Simply updating to the latest releases solved the problem. However some other packages were updated at the same time too. Before:

    Python 2.2.2
    Zope 2.6.1
    freetds-0.61_1
    unixODBC-2.2.5
    mxODBCZopeDA 1.0.6

And after:

    Python 2.3.3
    Zope 2.6.4
    freetds-0.62_1
    unixODBC-2.2.8
    mxODBCZopeDA 1.0.8

Both on FreeBSD 4.9.
________________________________________
= Comment - Entry #7 by dunny on Mar 23, 2004 12:16 am

I think this is a problem with the logging code effectively hiding the real cause of a failed abort. Making the following edit to _commit_error() of ZODB/Transaction.py:

>             except:
>                 # nothing to do but log the error
>-                self.log("Failed to abort object %s" % repr(o._p_oid),
>-                         error=sys.exc_info())
>+                if hasattr(o,'_p_oid'):
>+                    msg = "Failed to abort object %s" % repr(o._p_oid)
>+                else:
>+                    msg = "Failed to abort object"
>+                self.log(msg, error=sys.exc_info())
                          
allows the cause of the exception to be logged. (Rather than the "AttributeError: Surrogate instance has no attribute '_p_oid'".) Now I'm seeing more enlightening exceptions of the form:

>2004-03-23T16:29:04 INFO(0) TM:150475776 Failed to abort object
>Traceback (innermost last):
>  File /usr/home/michael/zope/Zope/lib/python/ZODB/Transaction.py, line 390, in _commit_error
>  File /usr/home/michael/zope/Zope/lib/python/Shared/DC/ZRDB/TM.py, line 60, in abort
>  File Products/mxODBCZopeDA/ZopeDA.py, line 1032, in _abort
>  File Products/mxODBCZopeDA/ZopeDA.py, line 884, in errorhandler
>ProgrammingError: ('HY000', 1, '[unixODBC]Could not perform COMMIT or ROLLBACK', 1082)

Perhaps similar handling of the logging of o._p_oid should also be applied to abort() as well.
________________________________________
= Comment - Entry #6 by jeremy on Jan 17, 2004 4:29 pm

How would I go about reproducing the bug?  The report doesn't have a recipe right now, so I've got no idea how to start looking into it.  What's a Surrogate object?

________________________________________
= Comment - Entry #5 by koschinh on Jan 2, 2004 4:36 am

I confirm this problem with Zope2.6.2, Python 2.1.3, zodb-3.1, ZEO.

It's really strange - does anybody know if there is a fix inside?
________________________________________
= Comment - Entry #4 by zettai on Nov 19, 2003 3:27 pm

I am getting this with Zope 2.6.2 and Python 2.1.3 on FreeBSD 5.0, fwiw.
________________________________________
= Comment - Entry #3 by ctbk on Oct 28, 2003 5:41 am

I confirm this issue: debian linux 2.4.20 zope 2.6.2 python 2.2.3;
Don't know what to do: the entire site hangs, the only solution is to restart. Don't know if I can afford a Zope downgrade. What should I do (apart from automatically restart Zope every 20 minutes)?
________________________________________
= Comment - Entry #2 by hg_zen on Apr 2, 2003 12:23 pm

Found a Workaround:
Using Zope 2.6.0 does not raise the error.
________________________________________
= Request - Entry #1 by hg_zen on Mar 14, 2003 7:24 pm

Get the following error in the Zope log:
2003-03-14T16:10:43 ERROR(200) ZODB A storage error occured during transaction abort.  This shouldn't happen.
Traceback (innermost last):
  File /usr/www/xxxx/Zope-2.6.1-src/lib/python/ZODB/Transaction.py, line 261, in commit
  File /usr/www/xxxx/Zope-2.6.1-src/lib/python/ZODB/Transaction.py, line 392, in _commit_error
AttributeError: Surrogate instance has no attribute '_p_oid'

---
After that error occurs, requests to Zope hang without returning any data or errors.  We've had to restart the server several times a day to combat this problem.  We don't know what's causing the error that causes this.
==============================================================




More information about the Zope-Collector-Monitor mailing list