Error on simultaneous updates/requests
I am working on an order entry system, and am getting a frequent error when multiple users are accessing the system. The error occurs most frequently when one user posts data which updates one or more folderish objects, and another user wants to get data at the same time as (or shortly after) the update. In most (all?) cases this is not the data that has been changed, or even data within the object that has been changed, but is data that must be found by acquisition, passing up a tree through one or more of the folderish objects that are being updated. The error message is "The object at XXX has an empty or missing docstring. Objects must have a docstring to be published", but has no obvious connection to a missing docstring - if the request is attempted again a few moments later, it works fine. Does anyone have any thoughts on the possible cause of this problem and/or how to solve it? (More info below) --Sean Hastings -------------------------------- SYSTEM INFO AND ERROR LOG ENTRY -------------------------------- Zope Version (Zope 2.6.1 (binary release, python 2.1, linux2-x86), python 2.1.3, linux2) Python Version 2.1.3 (#1, Sep 19 2002, 13:15:46) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] System Platform linux2 SOFTWARE_HOME /Zope/lib/python ZOPE_HOME /Zope INSTANCE_HOME /Zope CLIENT_HOME /Zope/var Process Id 18671 (65541) Running For 20 days 23 hours 33 min 0 sec ---------------- Site Error Log at /error_log Exception traceback Time 2004/01/01 18:45:37.760 US/Eastern User Name (User Id) Anonymous User (None) Request URL http://192.168.1.100:9980/bank/accounts/H/Polish/0300s/300 Exception Type NotFound Exception Value <TABLE BORDER="0" WIDTH="100%"> <TR VALIGN="TOP"> <TD WIDTH="10%" ALIGN="CENTER"> </TD> <TD WIDTH="90%"> <H2>Site Error</H2> <P>An error was encountered while publishing this resource. </P> <P><STRONG>Debugging Notice</STRONG></P> Zope has encountered a problem publishing your object.<p> The object at http://192.168.1.100:9980/bank/accounts/H/Polish/0300s/300 has an empty or missing docstring. Objects must have a docstring to be published. <HR NOSHADE> <P>Troubleshooting Suggestions</P> <UL> <LI>The URL may be incorrect.</LI> <LI>The parameters passed to this resource may be incorrect.</LI> <LI>A resource that this resource relies on may be encountering an error.</LI> </UL> <P>For more detailed information about the error, please refer to the HTML source for this page. </P> <P>If the error persists please contact the site maintainer. Thank you for your patience. </P> </TD></TR> </TABLE> Traceback (innermost last): Module ZPublisher.Publish, line 89, in publish Module ZPublisher.BaseRequest, line 341, in traverse Module ZPublisher.HTTPResponse, line 636, in debugError NotFound: <TABLE BORDER="0" WIDTH="100%"> <TR VALIGN="TOP"> <TD WIDTH="10%" ALIGN="CENTER"> </TD> <TD WIDTH="90%"> <H2>Site Error</H2> <P>An error was encountered while publishing this resource. </P> <P><STRONG>Debugging Notice</STRONG></P> Zope has encountered a problem publishing your object.<p> The object at http://192.168.1.100:9980/bank/accounts/H/Polish/0300s/300 has an empty or missing docstring. Objects must have a docstring to be published. <HR NOSHADE> <P>Troubleshooting Suggestions</P> <UL> <LI>The URL may be incorrect.</LI> <LI>The parameters passed to this resource may be incorrect.</LI> <LI>A resource that this resource relies on may be encountering an error.</LI> </UL> <P>For more detailed information about the error, please refer to the HTML source for this page. </P> <P>If the error persists please contact the site maintainer. Thank you for your patience. </P> </TD></TR> </TABLE> Display traceback as text REQUEST form cookies _ZopeId '87235459A1ITlILzPcQ' lazy items SESSION <bound method SessionDataManager.getSessionData of <SessionDataManager instance at 101d5f50>> other SERVER_URL 'http://192.168.1.100:9980' TraversalRequestNameStack ['tabs_html', '300', '0300s', 'Polish', 'H', 'accounts', 'bank'] URL 'http://192.168.1.100:9980/bank/accounts/H/Polish/0300s/300' URL0 http://192.168.1.100:9980/bank/accounts/H/Polish/0300s/300 URL1 http://192.168.1.100:9980/bank/accounts/H/Polish/0300s URL2 http://192.168.1.100:9980/bank/accounts/H/Polish URL3 http://192.168.1.100:9980/bank/accounts/H URL4 http://192.168.1.100:9980/bank/accounts URL5 http://192.168.1.100:9980/bank URL6 http://192.168.1.100:9980 BASE0 http://192.168.1.100:9980 BASE1 http://192.168.1.100:9980 BASE2 http://192.168.1.100:9980/bank BASE3 http://192.168.1.100:9980/bank/accounts BASE4 http://192.168.1.100:9980/bank/accounts/H BASE5 http://192.168.1.100:9980/bank/accounts/H/Polish BASE6 http://192.168.1.100:9980/bank/accounts/H/Polish/0300s BASE7 http://192.168.1.100:9980/bank/accounts/H/Polish/0300s/300 environ HTTP_ACCEPT_ENCODING 'gzip, deflate' channel.creation_time 1073000735 SERVER_PROTOCOL 'HTTP/1.1' SERVER_PORT '9980' PATH_INFO '/bank/accounts/H/Polish/0300s/300/bank/accounts/H/Polish/0300s/300/tabs_htm l' HTTP_HOST '192.168.1.100:9980' REQUEST_METHOD 'GET' PATH_TRANSLATED '/bank/accounts/H/Polish/0300s/300/bank/accounts/H/Polish/0300s/300/tabs_htm l' HTTP_COOKIE '_ZopeId="87235459A1ITlILzPcQ"' SCRIPT_NAME '' SERVER_SOFTWARE 'Zope/(Zope 2.6.1 (binary release, python 2.1, linux2-x86), python 2.1.3, linux2) ZServer/1.1b1' HTTP_ACCEPT_LANGUAGE 'en-us' HTTP_ACCEPT 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*' REMOTE_ADDR '192.168.1.8' HTTP_REFERER 'http://192.168.1.100:9980/bank/accounts/H/Polish/0300s/300/offers_layout_ht ml?account_url=bank/accounts/H/Polish/0300s/300' SERVER_NAME 'vault' GATEWAY_INTERFACE 'CGI/1.1' HTTP_USER_AGENT 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)'
Sean wrote at 2004-1-2 17:01 -0500:
I am working on an order entry system, and am getting a frequent error when multiple users are accessing the system.
The error occurs most frequently when one user posts data which updates one or more folderish objects, and another user wants to get data at the same time as (or shortly after) the update. In most (all?) cases this is not the data that has been changed, or even data within the object that has been changed, but is data that must be found by acquisition, passing up a tree through one or more of the folderish objects that are being updated.
The error message is "The object at XXX has an empty or missing docstring. Objects must have a docstring to be published", but has no obvious connection to a missing docstring - if the request is attempted again a few moments later, it works fine.
It is *very* unlikely that this error has anything to do with concurrent access... It is almost unbelievable that the problem disappears for the same request... I see only one (potential) explanation: * Python 2.1's "getattr" catches all exceptions (when called with an optional default argument) (while it should only catch "AttributeError"). This may transform "ConflictError" to "missing docstring". In this case, the affected object would define its docstring itself. This is very rare: usually, the docstring is defined by the class and not the object... -- Dieter
Dieter, Thank you for your response.
It is *very* unlikely that this error has anything to do with concurrent access...
It is almost unbelievable that the problem disappears for the same request...
However, repeatable experimentation does seem to demonstrate this to be the case. If I run a script repeating the same request every few seconds, and saving the results, I get an error when (and only when) I post data from another computer. The post works successfully, but the indicated error is a result of the request just after the time of the post. All requests before and after that time return successfully.
I see only one (potential) explanation:
* Python 2.1's "getattr" catches all exceptions (when called with an optional default argument) (while it should only catch "AttributeError"). This may transform "ConflictError" to "missing docstring".
In this case, the affected object would define its docstring itself. This is very rare: usually, the docstring is defined by the class and not the object...
I do not understand this. I am not using "getattr" in my code. Do you mean that Zserver is using getattr to check for a docstring, and is catching a "conflictError" and then throwing a "missing docstring"? If so, would you have any idea where in the Zope code this might be happening? How can an object define its own docstring separately from its class definition? I suppose that there may be some way to set this at run time, but I certainly have not written any code to do so. How does this relate to the "getattr" issue? -- Sean
On Sun, 4 Jan 2004 23:47:14 -0500 "Sean" <whysean@softhome.net> wrote:
Dieter,
Thank you for your response.
It is *very* unlikely that this error has anything to do with concurrent access...
It is almost unbelievable that the problem disappears for the same request...
However, repeatable experimentation does seem to demonstrate this to be the case. If I run a script repeating the same request every few seconds, and saving the results, I get an error when (and only when) I post data from another computer. The post works successfully, but the indicated error is a result of the request just after the time of the post. All requests before and after that time return successfully.
You will probably need to use the debugger to figure out what object is being published when this error occurs. Look at the traceback and see where the error is raised (Somewhere in lib/python/BaseRequest.py). change the code to envoke pdb.set_trace() instead of raising the error. Then run zope in the foreground (how exactly depends on the zope version) and cause the error. Then you can analyze why this error occurs. BTW: what is the name of the object trying to be acquired? My guess is that it sometimes acquires the wrong thing and tries to publish it. -Casey
On Sun, 4 Jan 2004 23:47:14 -0500 "Sean" <whysean@softhome.net> wrote:
Dieter,
Thank you for your response.
It is *very* unlikely that this error has anything to do with concurrent access...
It is almost unbelievable that the problem disappears for the same request...
However, repeatable experimentation does seem to demonstrate this to be the case. If I run a script repeating the same request every few seconds, and saving the results, I get an error when (and only when) I post data from another computer. The post works successfully, but the indicated error is a result of the request just after the time of the post. All requests before and after that time return successfully.
You will probably need to use the debugger to figure out what object is being published when this error occurs. Look at the traceback and see where the error is raised (Somewhere in lib/python/BaseRequest.py). change the code to envoke pdb.set_trace() instead of raising the error. Then run zope in the foreground (how exactly depends on the zope version) and cause the error. Then you can analyze why this error occurs. BTW: what is the name of the object trying to be acquired? My guess is that it sometimes acquires the wrong thing and tries to publish it. -Casey
Sean wrote at 2004-1-4 23:47 -0500:
...
* Python 2.1's "getattr" catches all exceptions (when called with an optional default argument) (while it should only catch "AttributeError"). This may transform "ConflictError" to "missing docstring".
In this case, the affected object would define its docstring itself. This is very rare: usually, the docstring is defined by the class and not the object...
I do not understand this.
I am not using "getattr" in my code.
"getattr" is used in "ZPublisher.BaseRequest.BaseRequest.traverse". Search for the error message to find the precise line...
How can an object define its own docstring separately from its class definition?
self.__doc__ = ... But, really, it is very rarely done. -- Dieter
participants (3)
-
Casey Duncan -
Dieter Maurer -
Sean