BUG: subtransaction not handled correctly in "manage_addFile" (was: [Zope] Re: manage_addFile problem) (was: [Zope] Re: manage_addFile problem)
Ian Sealy writes:
I sent the following message to the list just before Christmas, but didn't get any replies. You probably did not get an answer because it is extremely difficult to see the problem cause.
Apparently, the upload was successful and resulted in some subtransaction (because your file was large). Later an exception occured during the commit. Zope tries to abort the associated transaction. During this abort, Zope hits the subtransactions and wants to abort them calling "abort_sub" on them. However, at least one of the subtransaction objects does not have this method. This results in your backtrace. Apparently, there is a Zope bug in the subtransaction handling or their abort. Please file a bug report into the Collector. On the other hand, the bug is triggered by something. I would expect, it is an exception in "ZODB.Transaction:261", AttributeError "commit_sub". You can verify this, if you put an "import traceback; traceback.print_exc()" below line 270. Problably some non-subtransaction object managed to enter in "subjars". I can't tell you why. Dieter
Dear all, Does anyone fancy earning a bit of pocket money? I've got a Zope problem that I can't solve because my Python isn't good enough and my understanding of the ZODB is pretty much still zero. We've got a simple Zope application that allows users to upload files without going near the Zope management screens. For more information on this and what the problem is, see: http://www.egroups.com/message/zope/48084 The basic thrust is that when a large file is uploaded and subtransactions are needed, something goes wrong. Dieter Maurer sent a reply helpful reply (thanks Dieter) that's archived at: http://www.egroups.com/message/zope/48116 In it, he said:
On the other hand, the bug is triggered by something. I would expect, it is an exception in "ZODB.Transaction:261", AttributeError "commit_sub". You can verify this, if you put an "import traceback; traceback.print_exc()" below line 270. Problably some non-subtransaction object managed to enter in "subjars".
Sure enough, Dieter was right. I get: Traceback (innermost last): File "/usr/local/zope/lib/python/ZODB/Transaction.py", line 261, in commit j.commit_sub(self) AttributeError: commit_sub Dieter told me to file a bug report (and he's told a couple of other people the same thing since) but I haven't yet because I'm having trouble replicating the problem. I can't replicate it by just copying the two salient methods to a fresh Zope installation of Zope 2.2.5. Other messages (e.g. < http://www.egroups.com/message/zope/48492 >) made me suspect that it was a problem with a Product, but installing the Products I'm using (SiteAccess, ZOracleDA, ZPyGreSQLDA and smbUserFolder) to this fresh installation didn't replicate the bug. I only see it if I copy over the Data.fs from the original installation. Other people seem to have come across the same problem in different contexts. Have a look at: http://groups.yahoo.com/group/zope/messagesearch?query=commit_sub We need to get this fixed ASAP so my boss has told me to send this message to the list and offer 400 pounds (sterling) to anyone who can fix this bug. Any takers? Cheers, Ian
Ian Sealy wrote:
We need to get this fixed ASAP so my boss has told me to send this message to the list and offer 400 pounds (sterling) to anyone who can fix this bug. Any takers?
What version of Zope are you using? cheers, Chris
Dear Chris,
We need to get this fixed ASAP so my boss has told me to send this message to the list and offer 400 pounds (sterling) to anyone who can fix this bug. Any takers?
What version of Zope are you using?
2.2.5 on Red Hat 6.2. Zope version: Zope 2.2.5 (source release, python 1.5.2, linux2) Python version: 1.5.2 (#1, Nov 18 2000, 20:03:24) [GCC egcs-2.91.66 19990314/Linux (egcs- System Platform: linux2 Cheers, Ian
Ian Sealy wrote:
Dear Chris,
We need to get this fixed ASAP so my boss has told me to send this message to the list and offer 400 pounds (sterling) to anyone who can fix this bug. Any takers?
What version of Zope are you using?
2.2.5 on Red Hat 6.2.
>
Zope version: Zope 2.2.5 (source release, python 1.5.2, linux2) Python version: 1.5.2 (#1, Nov 18 2000, 20:03:24) [GCC egcs-2.91.66 19990314/Linux (egcs- System Platform: linux2
Well, sorry to say, on Zope 2.2.4 and 2.2.5 under Linux and WinNT using files between 1kb and 110Mb (Boy, did Netscape like that ;-), I can't reproduce this :-( If anyone comes up with a fail safe way of reproducing the bug, I'd love to nail it, 'cos it sounds like fun :-) good luck for now, Chris
Dear all,
We need to get this fixed ASAP so my boss has told me to send this message to the list and offer 400 pounds (sterling) to anyone who can fix this bug. Any takers?
What version of Zope are you using?
2.2.5 on Red Hat 6.2.
Zope version: Zope 2.2.5 (source release, python 1.5.2, linux2) Python version: 1.5.2 (#1, Nov 18 2000, 20:03:24) [GCC egcs-2.91.66 19990314/Linux (egcs- System Platform: linux2
Well, sorry to say, on Zope 2.2.4 and 2.2.5 under Linux and WinNT using files between 1kb and 110Mb (Boy, did Netscape like that ;-), I can't reproduce this :-(
If anyone comes up with a fail safe way of reproducing the bug, I'd love to nail it, 'cos it sounds like fun :-)
I've finally managed to replicate the bug consistently, so I've just submitted it to the Collector: http://classic.zope.org:8080/Collector/1895/view I now know what causes it so I'm able to work around it, which means that I'm afraid the offer of 400 quid to fix the bug is now withdrawn. Sorry. The bug only occurs if the DTML Method that adds the large file tries to call a Z SQL Method that uses the ZPyGreSQLDA. Here's the description I just submitted to the Collector: Occurs on Zope 2.2.5 with ZPyGreSQLDA-0-0-3 installed. If you have a form like this: <form action="addfile" method="POST" enctype="multipart/form-data"> <input type="file" name="file"><br> Filename: <input type="text" name="filename"><br> <input type="submit" value="Upload"> </form> and a DTML Method called addfile: <dtml-in expr="sql()"></dtml-in> <dtml-call expr="manage_addFile(filename, file=file)"> OK where sql is a Z SQL Method that uses a PyGreSQL database connection. Trying to upload a file larger than about 128 kb gives: Error Type: AttributeError Error Value: abort_sub Traceback (innermost last): File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 175, in publish File /usr/local/zope/lib/python/Zope/__init__.py, line 235, in commit File /usr/local/zope/lib/python/ZODB/Transaction.py, line 290, in commit AttributeError: (see above) Cheers, Ian
Subtransactions aren't compatible with most database adapters. I'm not sure what to do about this one. ----- Original Message ----- From: "Ian Sealy" <Ian.Sealy@bristol.ac.uk> To: <zope@zope.org> Sent: Friday, January 26, 2001 7:55 AM Subject: Re: [Zope] Can't reproduce :-(
Dear all,
We need to get this fixed ASAP so my boss has told me to send this message to the list and offer 400 pounds (sterling) to anyone who can fix this bug. Any takers?
What version of Zope are you using?
2.2.5 on Red Hat 6.2.
Zope version: Zope 2.2.5 (source release, python 1.5.2, linux2) Python version: 1.5.2 (#1, Nov 18 2000, 20:03:24) [GCC egcs-2.91.66 19990314/Linux (egcs- System Platform: linux2
Well, sorry to say, on Zope 2.2.4 and 2.2.5 under Linux and WinNT using files between 1kb and 110Mb (Boy, did Netscape like that ;-), I can't reproduce this :-(
If anyone comes up with a fail safe way of reproducing the bug, I'd love to nail it, 'cos it sounds like fun :-)
I've finally managed to replicate the bug consistently, so I've just submitted it to the Collector:
http://classic.zope.org:8080/Collector/1895/view
I now know what causes it so I'm able to work around it, which means that I'm afraid the offer of 400 quid to fix the bug is now withdrawn. Sorry.
The bug only occurs if the DTML Method that adds the large file tries to call a Z SQL Method that uses the ZPyGreSQLDA. Here's the description I just submitted to the Collector:
Occurs on Zope 2.2.5 with ZPyGreSQLDA-0-0-3 installed. If you have a form like this:
<form action="addfile" method="POST" enctype="multipart/form-data"> <input type="file" name="file"><br> Filename: <input type="text" name="filename"><br> <input type="submit" value="Upload"> </form>
and a DTML Method called addfile:
<dtml-in expr="sql()"></dtml-in> <dtml-call expr="manage_addFile(filename, file=file)"> OK
where sql is a Z SQL Method that uses a PyGreSQL database connection. Trying to upload a file larger than about 128 kb gives:
Error Type: AttributeError Error Value: abort_sub
Traceback (innermost last): File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 175, in publish File /usr/local/zope/lib/python/Zope/__init__.py, line 235, in commit File /usr/local/zope/lib/python/ZODB/Transaction.py, line 290, in commit AttributeError: (see above)
Cheers, Ian
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Because most databases don't have the notion of a subtransaction. ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Chris McDonough" <chrism@digicool.com> Cc: "Ian Sealy" <Ian.Sealy@bristol.ac.uk>; <zope@zope.org> Sent: Friday, January 26, 2001 10:10 AM Subject: Re: [Zope] subtransactions
Chris McDonough wrote:
Subtransactions aren't compatible with most database adapters.
How come?
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Chris McDonough wrote:
Because most databases don't have the notion of a subtransaction.
Hang on... how come, if a file upload needs to commit a subtransaction, that means that an SQL method you call while processing the same request also needs to support sub-transactions? confusedly, Chris
Now that's a good question ;) ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Chris McDonough" <chrism@digicool.com> Cc: "Ian Sealy" <Ian.Sealy@bristol.ac.uk>; <zope@zope.org> Sent: Friday, January 26, 2001 3:35 PM Subject: Re: [Zope] subtransactions
Chris McDonough wrote:
Because most databases don't have the notion of a subtransaction.
Hang on... how come, if a file upload needs to commit a subtransaction, that means that an SQL method you call while processing the same request also needs to support sub-transactions?
confusedly,
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Currently, yes. This is arguably wrong. ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Chris McDonough" <chrism@digicool.com> Cc: "Ian Sealy" <Ian.Sealy@bristol.ac.uk>; <zope@zope.org> Sent: Friday, January 26, 2001 10:35 AM Subject: Re: [Zope] subtransactions
Chris McDonough wrote:
Because most databases don't have the notion of a subtransaction.
Hang on... how come, if a file upload needs to commit a subtransaction, that means that an SQL method you call while processing the same request also needs to support sub-transactions?
confusedly,
Chris
[Ian Sealy] | We need to get this fixed ASAP so my boss has told me to send this | message to the list and offer 400 pounds (sterling) to anyone who | can fix this bug. Any takers? I'm not quite sure what DigiCool charge, but how about asking them?
participants (6)
-
Chris McDonough -
Chris Withers -
Dieter Maurer -
Erik Enge -
Ian Sealy -
Phil Harris