| Graham Dumpleton (JIRA) 2006-04-10, 7:57 am |
| [ http://issues.apache.org/jira/brows...=3Dcomments#ac=
tion_12373816 ]=20
Graham Dumpleton commented on MODPYTHON-158:
--------------------------------------------
I have checked into subversion some new code to support a better troublesho=
oting guide. The checks that the code does is as follows:
1. On initialisation of mod_python, will compare the version string from th=
e version of Python that mod_python was compiled against, with that which w=
as found at runtime. If they differ, it will log error messages like:
[Mon Apr 10 16:06:22 2006] [error] python_init: Python version mismatch, ex=
pected '2.3.4', found '2.3'.
[Mon Apr 10 16:06:22 2006] [error] python_init: Python executable found '/u=
sr/bin/python'.
[Mon Apr 10 16:06:22 2006] [error] python_init: Python path being used '/Us=
ers/grahamd/lib/python:/System/Library/Frameworks/Python.framework/Versions=
/2.3/lib/python23.zip:/System/Library/Frameworks/Python.framework/Versions/=
2.3/lib/python2.3/:/System/Library/Frameworks/Python.framework/Versions/2.3=
/lib/python2.3/plat-darwin:/System/Library/Frameworks/Python.framework/Vers=
ions/2.3/lib/python2.3/plat-mac:/System/Library/Frameworks/Python.framework=
/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages:/System/Library/Fra=
meworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk:/System/Library/=
Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload'.
[Mon Apr 10 16:06:22 2006] [notice] mod_python: Creating 8 session mutexes =
based on 6 max processes and 25 max threads.
[Mon Apr 10 16:06:22 2006] [notice] mod_python: using mutex_directory /tmp=
=20
[Mon Apr 10 16:06:22 2006] [notice] Apache/2.0.55 (Unix) mod_python/3.3.0-d=
ev-20060410 Python/2.3 configured -- resuming normal operations
2. When it goes to import "mod_python.apache" when a request is first recei=
ved, if it cannot be found, it will dump out Python path that was used in t=
he search:
[Mon Apr 10 16:10:09 2006] [error] make_obcallback: could not import mod_py=
thon.apache.\n
ImportError: No module named mod_python.apache
[Mon Apr 10 16:10:09 2006] [error] make_obcallback: Python path being used =
"['/Users/grahamd/lib/python', '/System/Library/Frameworks/Python.framework=
/Versions/2.3/lib/python23.zip', '/System/Library/Frameworks/Python.framewo=
rk/Versions/2.3/lib/python2.3', '/System/Library/Frameworks/Python.framewor=
k/Versions/2.3/lib/python2.3/plat-darwin', '/System/Library/Frameworks/Pyth=
on.framework/Versions/2.3/lib/python2.3/plat-mac', '/System/Library/Framewo=
rks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages=
', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/=
lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/pyth=
on2.3/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2=
..3/lib/python2.3/site-packages', '/System/Library/Frameworks/Python.framewo=
rk/Versions/2.3/lib/python2.3/site-packages/PIL', '/System/Library/Framewor=
ks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PyObjC', '/Sys=
tem/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-pac=
kages/ZopePageTemplates', '/System/Library/Frameworks/Python.framework/Vers=
ions/2.3/lib/python2.3/site-packages/py2app', '/usr/local/src/reportlab_1_2=
0', '/usr/local/src/trml2pdf', '/System/Library/Frameworks/Python.framework=
/Versions/2.3/lib/python2.3/site-packages/wx-2.6-mac-ansi']".
[Mon Apr 10 16:10:09 2006] [error] get_interpreter: no interpreter callback=
found.
[Mon Apr 10 16:10:09 2006] [error] [client 127.0.0.1] python_handler: Can't=
get/create interpreter.
A similar error error is logged where "mod_python.apache" can be imported b=
ut an error occurred when doing so. This can happen when Apache module is 3=
..2+ and Python module code files are 2.7.X.
[Mon Apr 10 16:13:15 2006] [error] make_obcallback: could not import mod_py=
thon.apache.\n
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python=
2.3/site-packages/mod_python/apache.py", line 616, in ?
make_table =3D _apache.make_table
AttributeError: 'module' object has no attribute 'make_table'
[Mon Apr 10 16:13:15 2006] [error] make_obcallback: Python path being used =
"['/Users/grahamd/lib/python', '/System/Library/Frameworks/Python.framework=
/Versions/2.3/lib/python23.zip', '/System/Library/Frameworks/Python.framewo=
rk/Versions/2.3/lib/python2.3', '/System/Library/Frameworks/Python.framewor=
k/Versions/2.3/lib/python2.3/plat-darwin', '/System/Library/Frameworks/Pyth=
on.framework/Versions/2.3/lib/python2.3/plat-mac', '/System/Library/Framewo=
rks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages=
', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/=
lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/pyth=
on2.3/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2=
..3/lib/python2.3/site-packages', '/System/Library/Frameworks/Python.framewo=
rk/Versions/2.3/lib/python2.3/site-packages/PIL', '/System/Library/Framewor=
ks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PyObjC', '/Sys=
tem/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-pac=
kages/ZopePageTemplates', '/System/Library/Frameworks/Python.framework/Vers=
ions/2.3/lib/python2.3/site-packages/py2app', '/usr/local/src/reportlab_1_2=
0', '/usr/local/src/trml2pdf', '/System/Library/Frameworks/Python.framework=
/Versions/2.3/lib/python2.3/site-packages/wx-2.6-mac-ansi']".
[Mon Apr 10 16:13:15 2006] [error] get_interpreter: no interpreter callback=
found.
[Mon Apr 10 16:13:15 2006] [error] [client 127.0.0.1] python_handler: Can't=
get/create interpreter.
3. If it was able to import "mod_python.apache" but a failure occurred when=
calling "apache.init()", it will compare the version of the Apache mod_pyt=
hon module load against the version of mod_python Python code files found. =
If the version disagrees it will complain. This can occur where Apache modu=
le is 3.2+ but Python code files found are 3.1.X.
[Mon Apr 10 16:18:24 2006] [error] make_obcallback: could not call init.\n
TypeError: init() takes no arguments (2 given)
[Mon Apr 10 16:18:24 2006] [error] make_obcallback: mod_python version mism=
atch, expected '3.3.0-dev-20060410', found '<unknown>'.
[Mon Apr 10 16:18:24 2006] [error] get_interpreter: no interpreter callback=
found.
[Mon Apr 10 16:18:24 2006] [error] [client 127.0.0.1] python_handler: Can't=
get/create interpreter.
Unfortunately though, and I onlly just realised, the version string in mod_=
python/__init__.py file was only added in 3.2. :-(
All the same, all this extra information should hopefully be enough for peo=
ple to see there is a misconfiguration problem and work out what is missing=
or wrongly installed.
I'll possibly tweak this a bit more. Suggestions of other stuff to output a=
nd when, most welcome. For example, maybe should output __file__ from "mod_=
python" module so know where module is being picked up from.
> Improve Installation / Troubleshooting section in documentation
> ---------------------------------------------------------------
>
> Key: MODPYTHON-158
> URL: http://issues.apache.org/jira/browse/MODPYTHON-158
> Project: mod_python
> Type: Improvement
> Components: documentation
> Versions: 3.3
> Environment: All
> Reporter: Jim Gallacher
> Priority: Minor
>
> Some of the more commonly asked questions asked on the mailing list relat=
e to mod_python configuration issues that are not currently covered in the =
documentation.
> Apache can't load mod_python.so
> ---------------------------------------------
> This more common problem on Windows, but can occur on other platforms. A =
typical apache error message looks like this:
> Syntax error on line 173 of C:/Program Files/Apache
> Group/Apache2/conf/httpd.conf:
> Cannot load C:/Program Files/Apache
> Group/Apache2/modules/mod_python.so into server: The
> specified module could not be found.
> On Windows this may indicate a problem with missing D
> Nicolas offered the following as an explanation on Windows:
> """
> One of the possible cause of your problem is that Apache does find
> mod_python.so but not one of the DLL it relies on. Unfortunately the erro=
r
> reporting in this case is quite scarce and misguiding.
> The candidates missing DLLs are python24.dll and the Microsoft Runtime DL=
LS
> (normally msvcr71.dll and msvcp71.dll).
> Make sure that your Python directory and the runtime DLLs can be found on
> your PATH. The runtime DLLs are normaly copied in your Python directory, =
so
> putting the Python directory on your PATH variable should do the trick.
> Also, make sure that the user which is running Apache has its PATH variab=
le
> properly set. The best way to do this is to define it at the system-wide
> level, but logging it under the user and defining the variable at the use=
r
> level is also possible.
> """
> Apache can't load mod_python.so - undefined symbol
> -----------------------------------------------------------------------
> This may look similar to the first example, but indicates a deeper proble=
m. Typical error message:
> httpd: Syntax error on line 231 of /usr/local/apache2/conf/httpd.conf: Ca=
nnot load /usr/local/apache2/modules/mod_python.so into server: /usr/local/=
apache2/modules/mod_python.so: undefined symbol: apr_sockaddr_port_get
> This error could indicate an actual bug in mod_python, or a mismatch betw=
een the Apache version used to compile mod_python versus the one being used=
to run it. I'm not sure there is an easy answer, but we should offer some =
initial troubleshooting suggestions.
> make_obcallback: could not import mod_python.apache
> -------------------------------------------------------------------------=
-
> This one seems to occur on all platforms with similar frequency, and is u=
sually related to having Python multiple versions on the same system. Typic=
al error message:
> [Sun Apr 09 14:03:46 2006] [error] make_obcallback: could not import
> mod_python.apache.\n
> [Sun Apr 09 14:03:46 2006] [error] python_handler: no interpreter
> callback found.
> [Sun Apr 09 14:03:46 2006] [error] [client 192.168.2.100]
> python_handler: Can't get/create interpreter., referer:
> http://localhost/mptest.py
> The solution is to adjust that PATH apache uses so it finds the correct p=
ython version. This will be platform specific.
--=20
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|