I've been using the excellent FSSession product (many thanks Mr Christoforou) to hold some information on the language a user wishes to display a page in. I kept having weird errors however - every now and again I'd change some code somewhere completely unrelated (even just adding a user) and FSSession would break. Undoing the last change wouldn't help. The error was to do with _v_data and (I think) _v_id or something similar. This post isn't about that problem.
From reading through the extremely useful nipltd archives it appeared the problem was not doing a <dtml-call FSSession> at the beginning of the code. This was bemusing because that code was sitting in my standard header and called everywhere. However, I had an uneasy workaround which did a 'try' on using FSSession and if it failed initialise it in the normal way. I say 'uneasy' because I didn't know why I needed it and when I added another bit of code to handle another cookie that needed to be recorded it broke again.
This post isn't about that problem either. I decided enough was enough today and thought I'd try and find out what was happening. So I could give some proper information to Pavlos Christoforou I downloaded the latest version of FSSession and tried to reproduce my error. Bang - I got a much more impressive error. Whenever I went to any of my pages that used FSSession I got the following. Zope has encountered an error while publishing this resource. Error Type: OSError Error Value: [Errno 2] No such file or directory Followed by the following traceback 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: ElementWithAttributes) 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 296, in commit File /usr/local/zope/lib/python/Shared/DC/ZRDB/TM.py, line 122, in tpc_finish (Object: TM) File /usr/local/zope/lib/python/Products/FSSession/FSSession.py, line 84, in _finish (Object: TM) File /usr/local/zope/lib/python/Products/FSSession/FSSession.py, line 193, in final_commit (Object: FSSession) OSError: (see above) Interestingly the line above 193 in FSSession.py is a comment which reads 'should never fail'. Well it does and the reason is (as you may have guessed from the title) that I called FSSession twice. Line 193 appears to rename a .tmp file and I'd guess that by calling it twice my second attempt fails as the file has already been renamed. Obviously this isn't the way I should be doing things and I'm going to have a go and see if the new version of FSSession cures my earlier problems. The reason I mention this now is that the problem causes any future attempts at transactions to give the following error - which can only be remedied by restarting zope. Error Type: TransactionError Error Value: A serious error, which was probably a system error, occurred in a previous database transaction. This application may be in an invalid state and must be restarted before database updates can be allowed. Beware though that if the error was due to a serious system problem, such as a disk full condition, then the application may not come up until you deal with the system problem. See your application log for information on the error that lead to this problem. So if you make the same mistake as I did on a production server you will not be popular :-). I'm running this on Zope 2.2.0 by the way (although it happens on the previous production version as well). Hope this is of some use Ian
icottee@bluefountain.com wrote:
I decided enough was enough today and thought I'd try and find out what was happening. So I could give some proper information to Pavlos Christoforou I downloaded the latest version of FSSession and tried to reproduce my error. Bang - I got a much more impressive error. Whenever I went to any of my pages that used FSSession I got the following.
Zope has encountered an error while publishing this resource.
Error Type: OSError Error Value: [Errno 2] No such file or directory
Followed by the following traceback
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: ElementWithAttributes) 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 296, in commit File /usr/local/zope/lib/python/Shared/DC/ZRDB/TM.py, line 122, in tpc_finish (Object: TM) File /usr/local/zope/lib/python/Products/FSSession/FSSession.py, line 84, in _finish (Object: TM) File /usr/local/zope/lib/python/Products/FSSession/FSSession.py, line 193, in final_commit (Object: FSSession) OSError: (see above)
Interestingly the line above 193 in FSSession.py is a comment which reads 'should never fail'. Well it does and the reason is (as you may have guessed from the title) that I called FSSession twice. Line 193 appears to rename a .tmp file and I'd guess that by calling it twice my second attempt fails as the file has already been renamed. Obviously this isn't the way I should be doing things and I'm going to have a go and see if the new version of FSSession cures my earlier problems. The reason I mention this now is that the problem causes any future attempts at transactions to give the following error - which can only be remedied by restarting zope.
Error Type: TransactionError Error Value: A serious error, which was probably a system error, occurred in a previous database transaction. This application may be in an invalid state and must be restarted before database updates can be allowed. Beware though that if the error was due to a serious system problem, such as a disk full condition, then the application may not come up until you deal with the system problem. See your application log for information on the error that lead to this problem.
Whats Going On- on every page request FSSession loads up its data(_v_data) from the fs. At the beg. of transaction commit FSSession opens up a temp file and dumps its data to it. at the end of a transaction commit.. actually now that i think about it is the second pass of Zope's two-phase commit. On the second phase of the commit FSSession tries to copy this temp file (not a proper one in unix terms just a file with .tmp , portability) over to the actual file. an error in the second phase of the two-phase commit basically signals to zope that something seriously bad has happened and it disallows any commits to transaction aware objects (ZODB, FSSession,etc). if this is disjointed i apologize i'm sleep deprived. Possible Fixes- hmmm. i'm not exactly sure you since had fssession up and running before... i know i've had this error before... but i can't remember right now why... oh yeah i was developing an FSSession derivative product... hmmm... make sure the directory exists (Zope/Var/FSSession) and has the proper permissions on it. if that doesn't work.... hmmm... contact Pavlos. Cheers Kapil
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 )
On Tue, 1 Aug 2000 icottee@bluefountain.com wrote:
Zope has encountered an error while publishing this resource.
Error Type: OSError Error Value: [Errno 2] No such file or directory
from the title) that I called FSSession twice. Line 193 appears to rename a .tmp file and I'd guess that by calling it twice my second attempt fails as the file has already been renamed. Obviously this
Hope this is of some use
Ian
Ian Thanks for the report and the excellent analysis. Unfortunately I did not consider the case of calling FSSession twice. During the last couple of days I had a few suggestions (Brian and Dieter) on improving FSSession so a new version soon. Thanks Pavlos
participants (3)
-
icotteeļ¼ bluefountain.com -
Kapil Thangavelu -
Pavlos Christoforou