[mod_python] 500 internal server error

Graham Dumpleton grahamd at dscpl.com.au
Fri Dec 9 23:10:56 EST 2005


Even if apache.OK is returned, I would have expected it to display "0"
unless mod_python 3.0.3 is a bit different. There is though possibly  
some
other exit point from the function where no explicit return values is  
given
and thus None is returned. This would cause a 500 error with older
versions of mod_python.

Either way, I would really suggest that you upgrade from mod_python  
3.0.3
to mod_python 3.2.5b if your problems continue as it is easier for us to
debug things when the current version is used and not some obsolete
version that is no longer even supported.

Graham


On 10/12/2005, at 6:07 AM, Peter Sanchez wrote:

> You are using mod_python.publisher, so you need to return your HTML  
> code. Try this, instead of:
>
>     return apache.OK
>
> Use:
>
>    return '<center><h1>Testing</h1></center>'
>
> Should solve your problem.
>
> Peter
>
>
> On Dec 9, 2005, at 10:36 AM, chase3 at llnl.gov wrote:
>
>
>> As a first step in moving a CGI script to mod_python, I wrapped the
>> script in a handler.  This seems to work and the database does
>> receive the data.   It looks like things should be ok.  However,
>> I am getting a 500 Internal Server Error back that I have not been
>> able to figure out, as there were no other clues in the error_log.
>> In fact, putting an log message shows execution is successful:
>>
>>   ...
>>     # Close the connection
>>     db.close()
>>     apache.log_error ( "success", apache.APLOG_ERR )
>>     return apache.OK
>>   else:
>>     apache.log_error ( "Failed!", apache.APLOG_ERR )
>>     return apache.SERVER_RETURN
>>
>> I get "success" in the log file.
>>
>> I put this mod_python script in the cgi-bin because when it was
>> in htdocs, I ran into 401 Authorization Required problems.
>> I should mention that I am not communicating to the server with
>> a URL in a browser, but through a utility that uses CURL and SSL to
>> do an HTTPS post, so user authentication is not possible.
>> When the mod_python script is in cgi-bin, user authentication is
>> not required. The software uses a digital signature for  
>> authentication.
>>
>> <Directory "/etc/httpd/cgi-bin/tracker">
>>     AddHandler python-program .py
>>     PythonHandler mod_python.publisher
>>     PythonDebug On
>> </Directory>
>>
>> Any ideas on how to locate the server error?
>>
>> Apache server is at 2.0.46; python 2.2.35 and mod_python-3.0.3-3.ent
>>
>> Thanks,
>> Lila
>>
>>
>> -- 
>> Lila Chase
>> lchase at llnl.gov
>>
>> _______________________________________________
>> Mod_python mailing list
>> Mod_python at modpython.org
>> http://mailman.modpython.org/mailman/listinfo/mod_python
>>
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>



More information about the Mod_python mailing list