Hi; I just built out a new server. The sites keep throwing AttributeErrors and I can't figure out why. Here's a simple example: contact_us_form is a Formulator form. Every Formulator form has an attribute called "header". So, why do I get this error? Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module OFS.DTMLDocument, line 128, in __call__ <DTMLDocument instance at e4e18f0> URL: http://example.com/eng/Equine-All_Products_frame/manage_main Physical Path:/example.com/eng/Equine-All_Products_frame Module DocumentTemplate.DT_String, line 474, in __call__ Module DocumentTemplate.DT_Util, line 198, in eval __traceback_info__: contact_us_form Module <string>, line 1, in <expression> AttributeError: header Display traceback as text <getLogEntryAsText?id=1185002988.840.657271479648> Top of Form 1 Bottom of Form 1 REQUEST form ? cookies ? lazy items SESSION <bound method SessionDataManager.getSessionData of <SessionDataManager instance at b6dcc50>> other TraversalRequestNameStack [] AUTHENTICATED_USER Anonymous User URL 'http://example.com/1024/eng/Equine-All_Products_frame' URL2 'http://example.com/1024' VirtualRootPhysicalPath ('', 'example.com') SERVER_URL 'http://example.com' AUTHENTICATION_PATH 'example.com/virtual_hosting' BASE1 'http://example.com' BASE2 'http://example.com/1024' BASE3 'http://example.com/1024/eng' BASE4 'http://example.com/1024/eng/Equine-All_Products_frame' URL3 'http://example.com' PUBLISHED <DTMLDocument instance at e4e18f0> URL1 'http://example.com/1024/eng' ACTUAL_URL 'http://example.com/1024/eng/Equine-All_Products_frame' URL0 http://example.com/1024/eng/Equine-All_Products_frame URL1 http://example.com/1024/eng URL2 http://example.com/1024 URL3 http://example.com BASE0 http://example.com BASE1 http://example.com BASE2 http://example.com/1024 BASE3 http://example.com/1024/eng BASE4 http://example.com/1024/eng/Equine-All_Products_frame environ HTTP_ACCEPT 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*' CONNECTION_TYPE 'Keep-Alive' HTTP_USER_AGENT 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)' HTTP_REFERER 'http://example.com/1024/eng/Equine-All_Products' SERVER_NAME 'server726.by2012.com' GATEWAY_INTERFACE 'CGI/1.1' HTTP_X_FORWARDED_FOR '200.88.97.130' SERVER_SOFTWARE 'Zope/(Zope 2.7.8-final, python 2.3.5, freebsd5) ZServer/1.1 Plone/2.1.4' REMOTE_ADDR '203.223.152.46' HTTP_ACCEPT_LANGUAGE 'en-us' SCRIPT_NAME '' REQUEST_METHOD 'GET' HTTP_HOST 'example.com:80' PATH_INFO '/1024/eng/Equine-All_Products_frame' SERVER_PORT '8080' SERVER_PROTOCOL 'HTTP/1.1' channel.creation_time 1185002986 HTTP_ACCEPT_ENCODING 'gzip, deflate' PATH_TRANSLATED '/1024/eng/Equine-All_Products_frame' Top of Form 2 Bottom of Form 2 TIA, Tony ________________________________________________________________________ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
tonylabarbara@aol.com wrote at 2007-7-21 10:42 -0400:
I just built out a new server. The sites keep throwing AttributeErrors and I can't figure out why. Here's a simple example:
contact_us_form is a Formulator form. Every Formulator form has an attribute called "header". So, why do I get this error?
You tell us too few details....
... Module OFS.DTMLDocument, line 128, in __call__ <DTMLDocument instance at e4e18f0> URL: http://example.com/eng/Equine-All_Products_frame/manage_main Physical Path:/example.com/eng/Equine-All_Products_frame
If you would use PageTemplates (rather than "DTMLDocument"), the error log info would be drastically more informative -- it would tell you which precise expression raises the "AttributeError".
... AttributeError: header
As you tell us, every "Formulator" form has a 'header' attribute, this means you are trying to access "header" on something different from a "Formulator" form. I cannot tell you what this is... -- Dieter
Okay, I can give you an example from a PT. It will follow. However... 1) All of these sites were working just fine when I made backups of them, which backups I installed on my new server I built. 2) I didn't edit anything. I just built and un-zexp'd (imported) everything. So...wouldn't it seem reasonable to conclude that there is a problem OTHER than the ones I'm posting which is causing SEVERAL AttributeErrors to be thrown from completely different sites? I would have to say it coudn't possibly be otherwise, myself. Everything else in Zope seems to be working fine. Built on FBSD 5.5 with Z 2.7.8 on Py 2.3.5 Below follows error info concerning another site with PT and a shop that says throws an AttributeError concerning "masterMarketItems". But, not only does that attr. exist, but I can surf to the shopkeeper's side of things and see the products, utilizing that very attr! Error Type: AttributeError Error Value: masterMarketItems This error shows on a page but not in the error log!! Below follows that which you requested, which I hope I have done correctly. I built the page only to throw the error. Again, "contact_us_form" does exist as a Formmailer object, and it lives in the very same folder. TIA, Tony Module ZPublisher.Publish, line 175, in publish_module_standard Module Products.PlacelessTranslationService.PatchStringIO, line 34, in new_publish Module ZPublisher.Publish, line 132, in publish Module Zope.App.startup, line 204, in zpublisher_exception_hook Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.Scripts.Bindings, line 306, in __call__ Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module Products.PageTemplates.ZopePageTemplate, line 222, in _exec Module Products.PageTemplates.PageTemplate, line 96, in pt_render <ZopePageTemplate at /example.com/eng/test> Module TAL.TALInterpreter, line 190, in __call__ Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 460, in do_setLocal_tal Module Products.PageTemplates.TALES, line 221, in evaluate URL: /example.com/eng/test Line 7, Column 0 Expression: <PythonExpr request.contact_us_form.header()> Names: {'container': <Folder instance at e967c50>, 'context': <Folder instance at e967c50>, 'default': <Products.PageTemplates.TALES.Default instance at 0x89fbdac>, 'here': <Folder instance at e967c50>, 'loop': <SafeMapping instance at ac0f0f0>, 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x8a07d6c>, 'nothing': None, 'options': {'args': ()}, 'repeat': <SafeMapping instance at ac0f0f0>, 'request': <HTTPRequest, URL=http://203.223.152.46:8080/example.com/eng/test>, 'root': <Application instance at e86af50>, 'template': <ZopePageTemplate at /example.com/eng/test>, 'traverse_subpath': [], 'user': beno} Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__ __traceback_info__: request.contact_us_form.header() Module Python expression "request.contact_us_form.header()", line 1, in <expression> Module ZPublisher.HTTPRequest, line 1223, in __getattr__ ________________________________________________________________________ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
tonylabarbara@aol.com wrote at 2007-7-21 14:27 -0400:
... Error Type: AttributeError Error Value: masterMarketItems
This error shows on a page but not in the error log!!
Maybe, it comes from your error page (i.e. "standard_error_message"). Then, you should see the entry in the error log that caused the error in the first place.
... Module Products.PageTemplates.TALES, line 221, in evaluate URL: /example.com/eng/test Line 7, Column 0 Expression: <PythonExpr request.contact_us_form.header()> ... Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__ __traceback_info__: request.contact_us_form.header()
Module Python expression "request.contact_us_form.header()", line 1, in <expression>
Module ZPublisher.HTTPRequest, line 1223, in __getattr__
You did it almost right. You forgot to include the "Error Type" and "Error Value" information. But, from what you have included, I guess that "request" does not have a "contact_us_form" attribute. I am unfamiliar with "Formulator" -- but it seems strange to me that you expect "request" to contain complete forms. -- Dieter
-----Original Message----- From: Dieter Maurer <dieter@handshake.de> To: tonylabarbara@aol.com Cc: zope@zope.org Sent: Sun, 22 Jul 2007 1:51 pm Subject: Re: [Zope] AttributeError: Can't Pin It Down! tonylabarbara@aol.com wrote at 2007-7-21 14:27 -0400:
... Error Type: AttributeError Error Value: masterMarketItems
This error shows on a page but not in the error log!!
Maybe, it comes from your error page (i.e. "standard_error_message"). Then, you should see the entry in the error log that caused the error in the first place.
Nothing in the error log about that :(
... Module Products.PageTemplates.TALES, line 221, in evaluate URL: /example.com/eng/test Line 7, Column 0 Expression: <PythonExpr request.contact_us_form.header()> ... Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__ __traceback_info__: request.contact_us_form.header()
Module Python expression "request.contact_us_form.header()", line 1, in <expression>
Module ZPublisher.HTTPRequest, line 1223, in __getattr__
You did it almost right. You forgot to include the "Error Type" and "Error Value" information.
Exception Type AttributeError Exception Value header
But, from what you have included, I guess that "request" does not have a "contact_us_form" attribute.
Can you explain? I have a Formulator form called "contact_us_form" and it's in the same folder, so there's no problem with inheritance.
I am unfamiliar with "Formulator" -- but it seems strange to me that you expect "request" to contain complete forms.
Well, frankly, I built this site a long time ago before PTs were in vogue and it worked just fine using DTML. I changed it to PT for you to throw and capture this error ;) Since this is happening with all applications and they worked just fine before I took the *zexp snapshots and loaded them into the new server, I was thinking this must come from something below the application level; namely, from a built of Zope itself. I thought maybe I built this from a FBSD port, but no, it's Z 2.7.8 and I built it from source thus: tar zxvf Zope-2.7.8-final.tgz cd Zope-2.7.8-final ./configure --with-python=/usr/local/bin/python2.3 --prefix=/usr/local/zope/278 && make && make install /usr/local/zope/278/bin/mkzopeinstance.py Directory: /usr/local/zope/instance1 cd /usr/local/zope/instance1 vi etc/zope.conf effective-user tony chown tony var/ chown tony etc/ chown tony etc/* chown tony log/ chown tony log/* This is fine, though, right? Also, I went to zope to find a copy of this tarball and couldn't! Every other tarball is on the list but 2.7.8!! http://www.zope.org/Products/Zope/swpackage_releases What's up with that?? TIA, Tony ________________________________________________________________________ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
tonylabarbara@aol.com wrote at 2007-7-23 08:47 -0400:
... Nothing in the error log about that :(
Almost not to believe... Unless, it comes from an exception ignored by the "error_log" object.
... Module Products.PageTemplates.TALES, line 221, in evaluate URL: /example.com/eng/test Line 7, Column 0 Expression: <PythonExpr request.contact_us_form.header()> ... Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__ __traceback_info__: request.contact_us_form.header()
Module Python expression "request.contact_us_form.header()", line 1, in <expression>
Module ZPublisher.HTTPRequest, line 1223, in __getattr__
You did it almost right. You forgot to include the "Error Type" and "Error Value" information.
Exception Type
AttributeError
Exception Value
header
This exception information seems not to correspond to the traceback you have posted. If you look carefully at your traceback, then you see that the exception comes from a "request.contact_us_form.header()" expression which then calls the "__getattr__" of an "HTTPRequest" instance (which almost surely is "request") -- and this "__getattr__" raises an "AttributeError". I do not see any reason why "contact_us_form" should call "request"'s "__getattr__". Thus, I expect that the "AttributeError" really comes from the "request.contact_us_form" access. If you are sure that you see "Exception Value: header", then the "contact_us_form" really behaves extremely strange....
... Well, frankly, I built this site a long time ago before PTs were in vogue and it worked just fine using DTML. I changed it to PT for you to throw and capture this error ;)
Then, your translation to PT went probably wrong. Are you sure that you access your forms via "request" (which would be "REQUEST" in DTML). -- Dieter
participants (2)
-
Dieter Maurer -
tonylabarbara@aol.com