[mod_python] *Occasional* AttributeError: Handler

Gregory Trubetskoy grisha at modpython.org
Sun Jul 2 19:43:37 EST 2000


Interestingly enough, when I try it, I get all the pictures loaded fine. I
wonder if this has something to do with the speed of the link - mine is
64K ISDN.

I have a theory - 

I think that sometimes the "AttributeError: handler" message can be
misleading, when there was an error importing the module. Your module
seems to try to open a connection in-line:

db = MySQLdb.connect(host=host, user=user, passwd=passwd, db="scrapbook")

This can fail sometimes, and I think after that you get the misleading
error. Make sure that the MaxClients setting for Apache does not exceed
the maximum number of allowed connections for your MySQL server.

--
  Gregory (Grisha) Trubetskoy
       grisha at modpython.org

On Sun, 2 Jul 2000, richard offer wrote:

> Hi, its me again :-)
> 
> I've started getting the occasional 
> 
> [Sun Jul  2 11:13:46 2000] [error] PythonHandler index: Traceback (innermost last):
> [Sun Jul  2 11:13:46 2000] [error] PythonHandler index:   File "/usr/local/lib/python1.5/site-packages/mod_python/apache.py", line 96, in Dispatch
>     object = self.resolve_object(module, object_str)
> [Sun Jul  2 11:13:46 2000] [error] PythonHandler index:   File "/usr/local/lib/python1.5/site-packages/mod_python/apache.py", line 42, in resolve_object
>     obj = getattr(obj, obj_str)
> [Sun Jul  2 11:13:46 2000] [error] PythonHandler index: AttributeError: handler
> 
> 
> By occasional I mean I've got a page that loads lots of images from a
> MySQL DB. Each image is a separate request. Most appear, but ~15%
> don't. Hitting reload sometimes works, sometimes its a different set of
> images that don't load.
> 
> This was working on the development server, moving across to the
> production server I had to change the database access mechanism (from a
> unix domain socket to a full inet socket (chroot) , and the production's
> version of python is not threaded).
> 
> 
> If anyone wants to check the failure mode of the site out its
> alfieireland.com/scrapbook/.  I'll make the code available if anyone
> can be bothered enough to ask for it. (this is a family site---neither
> the site or the connection is designed for the /. effect, please don't
> hurt it :-)
> 
> richard.
> 
> -- 
> richard offer @ home 
>           84 FE 48 E4 74 D0 26 D4  31 8E B6 86 98 74 E2 7C  8A FB BF A3
> ___________________________________http://216.185.15.144/users/richard/
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
> 





More information about the Mod_python mailing list