How to catch an error in a Django project on apache: 10048 "The address is already in use"

Python 2.5.2, Apache 2.2, Django 1.0.2 final

My Django app is trying to connect to a specific port. When this port is busy, I get error 10048 "Address is already in use" from apache. I know where the error is coming from. How can I catch this apache error?

Additional Information:

error at /report/5/2009/08/01/

(10048, 'Address already in use')

Request Method:     GET
Request URL:    http://192.168.0.21/report/5/2009/08/01/
Exception Type:     error
Exception Value:    

(10048, 'Address already in use')

Exception Location:     C:\Python25\Lib\httplib.py in connect, line 683
Python Executable:  C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe
Python Version:     2.5.2
Python Path:    ['D:\\django\\system', 'C:\\Python25\\lib\\site-packages\\setuptools-0.6c9-py2.5.egg', 'C:\\Python25\\lib\\site-packages\\python_memcached-1.44-py2.5.egg', 'C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs', 'c:\\mapnik_0_6_0\\site-packages', 'C:\\Program Files\\Apache Software Foundation\\Apache2.2', 'C:\\WINDOWS\\system32\\python25.zip', 'C:\\Python25\\Lib', 'C:\\Python25\\DLLs', 'C:\\Python25\\Lib\\lib-tk', 'C:\\Program Files\\Apache Software Foundation\\Apache2.2\\bin', 'C:\\Python25', 'C:\\Python25\\lib\\site-packages', 'C:\\Python25\\lib\\site-packages\\PIL', 'C:\\Program Files\\GeoDjango\\Django-1.0.2-final']

      

Server time: don, 10 Sep 2009 11:20:45 +0200

+2


source to share


1 answer


If you are calling httplib.connect

directly from your code, then try

/ except

should be around that direct call. Or is the call happening indirectly ...? Unfortunately Apache does not give you a stack trace, so if you are having trouble figuring out which call sequence is involved, you can put the wider try / except version at the highest level available to you and keep a printout of the trace so you can identify the call leg involved (or edit your question to show a traceback and we can help you find it). See the traceback module in the Python standard library for more information on how to format a trace in a sentence except

.



+1


source







All Articles