sankarNarayanan / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

When deploying TRAC integrated with Subversion (SVN), TRAC doesn't open any page at all. #135

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I've deployed trac using apache/mod_wsgi (no SSL) (preferable, since the
problem I'm facing with CGI is performance), and it works fine WITHOUT SVN
integration. But I actually need SVN, so when I configure the repository
path (i.e: repository_dir = c:/projects/svn/my_project) I can't even get my
project TRAC to even open any of its pages.

On Mozilla Firefox shows a white page and on MS-IE shows a 'The page cannot
be displayed' error as if the server has 'timed out'.

I've tried with mod_python (3.3.1) and the exact same problem happens. It
works fine with CGI though.

I've also tried disabeling SVN authentication, thinking it might be a
authentication conflict (I'm using Apache Basic Auth).

Environment:
- Win 2000 Server SP 4;
- Apache 2.2.10;
- Python 2.5.2;
- mod_wsgi revision 1018 2.3, py25_apache22;
- Trac 0.12dev;
- Subversion 1.5.3.

Configuration files:

- Apache httpd.conf excerpt:
---------
WSGIScriptAlias /trac "c:/projects/apache/trac.wsgi"

<Directory c:/projects/apache>
  WSGIApplicationGroup %{GLOBAL}
  Order deny,allow
  Allow from all
</Directory>
---------

- trac.wsgi:
---------
import sys
sys.stdout = sys.stderr

import os
os.environ['TRAC_ENV_PARENT_DIR'] = 'c:/projects/trac'
os.environ['PYTHON_EGG_CACHE'] = 'c:/projects/eggs'

import trac.web.main

application = trac.web.main.dispatch_request
---------

- trac.ini excerpt:
---------
repository_type = svn
repository_dir = c:/projects/svn/my_project
---------

Thanks,
Lucas Fragomeni

Original issue reported on code.google.com by lucasfra...@gmail.com on 3 Mar 2009 at 7:46

GoogleCodeExporter commented 8 years ago
You may be better asking about this on Trac users list 
(http://groups.google.com/group/trac-users?hl=en) as it is going 
to be something to do with the environment rather than mod_wsgi, since you 
appear to be doing the prime thing which 
is set:

  WSGIApplicationGroup %{GLOBAL}

As such, you may find more users using mod_wsgi/Trac on the Trac list who can 
help with the environment issues.

One could still verify that the correct application group is being used, by 
adding in debugging per first recipe in:

  http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Tracking_Request_and_Response

In the output in Apache error log, verify that 'mod_wsgi.application_group' is 
'', ie., empty string. If it isn't, then not 
running in first interpreter as required for subversion bindings.

Only other thoughts are that you are also loading mod_dav_svn and mod_authz_svn 
and they are using a different 
version of subversion DLL to what the Python subversion bindings are requiring. 
Also, whether you may have a problem 
with user that Apache service is running as accessing the directories/files 
containing the subversion repository.

Add back here any progress you make.

Original comment by Graham.Dumpleton@gmail.com on 4 Mar 2009 at 12:16

GoogleCodeExporter commented 8 years ago
Another thought. Have you tried to see if Trac will work if tracd is run 
directly?

Original comment by Graham.Dumpleton@gmail.com on 4 Mar 2009 at 12:17

GoogleCodeExporter commented 8 years ago
Graham,

I've added the debug (the first technic), and here is the result (I have to be
honest: I have no idea how to interpret it. This is my first experience with 
Python):

[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12] ('REQUEST',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]  {'COMSPEC':
'C:\\\\WINNT\\\\system32\\\\cmd.exe',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'DOCUMENT_ROOT':
'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'GATEWAY_INTERFACE':
'CGI/1.1',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'HTTP_ACCEPT': 
'image/gif,
image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   
'HTTP_ACCEPT_ENCODING':
'gzip, deflate',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   
'HTTP_ACCEPT_LANGUAGE':
'pt-br',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'HTTP_CONNECTION':
'Keep-Alive',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'HTTP_HOST': 
'10.12.166.12',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'HTTP_USER_AGENT':
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'PATH':
'C:\\\\WINNT\\\\system32;C:\\\\WINNT;C:\\\\WINNT\\\\System32\\\\Wbem;C:\\\\Progr
am
Files\\\\Microsoft SQL Server\\\\80\\\\Tools\\\\BINN;C:\\\\Program
Files\\\\Subversion\\\\bin;C:\\\\Python25',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'PATHEXT':
'.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'PATH_INFO': 
'/my_project',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'PATH_TRANSLATED':
'C:\\\\Program Files\\\\Apache Software 
Foundation\\\\Apache2.2\\\\htdocs\\\\my_project',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'QUERY_STRING': '',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'REMOTE_ADDR': 
'10.12.166.12',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'REMOTE_PORT': 
'2103',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'REQUEST_METHOD': 
'GET',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'REQUEST_URI':
'/trac/my_project',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'SCRIPT_FILENAME':
'C:/projects/apache/trac.wsgi',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'SCRIPT_NAME': 
'/trac',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'SERVER_ADDR': 
'10.12.166.12',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'SERVER_ADMIN':
'no-replay@myproject.com',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'SERVER_NAME': 
'10.12.166.12',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'SERVER_PORT': '80',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'SERVER_PROTOCOL': 
'HTTP/1.1',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'SERVER_SIGNATURE': 
'',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'SERVER_SOFTWARE':
'Apache/2.2.10 (Win32) SVN/1.5.4 mod_wsgi/2.3 Python/2.5.2 DAV/2',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'SystemRoot': 
'C:\\\\WINNT',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'WINDIR': 
'C:\\\\WINNT',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]  
'mod_wsgi.application_group': '',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]  
'mod_wsgi.callable_object': 'application',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   
'mod_wsgi.process_group': '',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]  
'mod_wsgi.reload_mechanism': '0',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]  
'mod_wsgi.script_reloading': '1',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'wsgi.errors':
<mod_wsgi.Log object at 0x008BA7D0>,
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'wsgi.file_wrapper':
<built-in method file_wrapper of mod_wsgi.Adapter object at 0x00940608>,
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'wsgi.input':
<mod_wsgi.Input object at 0x01F6A660>,
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'wsgi.multiprocess': 
False,
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'wsgi.multithread': 
True,
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'wsgi.run_once': 
False,
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'wsgi.url_scheme': 
'http',
[Wed Mar 04 11:17:24 2009] [error] [client 10.12.166.12]   'wsgi.version': (1, 
0)})
[Wed Mar 04 11:17:26 2009] [notice] Parent: child process exited with status
3221225477 -- Restarting.
[Wed Mar 04 11:17:26 2009] [warn] mod_wsgi: Compiled for Python/2.5.
[Wed Mar 04 11:17:26 2009] [warn] mod_wsgi: Runtime using Python/2.5.2.
[Wed Mar 04 11:17:26 2009] [warn] mod_wsgi: Python module path
'C:\\WINNT\\system32\\python25.zip;C:\\Python25\\Lib;C:\\Python25\\DLLs;C:\\Pyth
on25\\Lib\\lib-tk;;C:\\Program
Files\\Apache Software Foundation\\Apache2.2\\bin'.
[Wed Mar 04 11:17:26 2009] [info] mod_wsgi: Initializing Python.
[Wed Mar 04 11:17:26 2009] [notice] Apache/2.2.10 (Win32) SVN/1.5.4 mod_wsgi/2.3
Python/2.5.2 DAV/2 configured -- resuming normal operations
[Wed Mar 04 11:17:26 2009] [notice] Server built: Oct 10 2008 12:39:04
[Wed Mar 04 11:17:26 2009] [notice] Parent: Created child process 2164
[Wed Mar 04 11:17:26 2009] [warn] mod_wsgi: Compiled for Python/2.5.
[Wed Mar 04 11:17:26 2009] [warn] mod_wsgi: Runtime using Python/2.5.2.
[Wed Mar 04 11:17:26 2009] [warn] mod_wsgi: Python module path
'C:\\WINNT\\system32\\python25.zip;C:\\Python25\\Lib;C:\\Python25\\DLLs;C:\\Pyth
on25\\Lib\\lib-tk;;C:\\Program
Files\\Apache Software Foundation\\Apache2.2\\bin'.
[Wed Mar 04 11:17:26 2009] [info] mod_wsgi: Initializing Python.
[Wed Mar 04 11:17:27 2009] [notice] Child 2164: Child process is running
[Wed Mar 04 11:17:27 2009] [info] Parent: Duplicating socket 244 and sending it 
to
child process 2164
[Wed Mar 04 11:17:27 2009] [info] mod_wsgi (pid=2164): Attach interpreter ''.
[Wed Mar 04 11:17:27 2009] [notice] Child 2164: Acquired the start mutex.
[Wed Mar 04 11:17:27 2009] [notice] Child 2164: Starting 64 worker threads.
[Wed Mar 04 11:17:27 2009] [notice] Child 2164: Starting thread to listen on 
port 80.

Original comment by lucasfra...@gmail.com on 4 Mar 2009 at 2:27

GoogleCodeExporter commented 8 years ago
PS: I'm now trying something related to mod_dav_svn/mod_authz_svn and tracd.

Original comment by lucasfra...@gmail.com on 4 Mar 2009 at 2:29

GoogleCodeExporter commented 8 years ago
Solved!

I've aligned the SVN's dlls versions used by Apache and Python to the versions
avaliable here: 
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100
Also followed the instructions for SVN as mentioned here:
http://trac.edgewall.org/wiki/TracInstall#VersionControlSystem

Step-by-step:
1. Updated my Subversion to v1.5.5, Win32 binaries for Apache 2.2.x (avaliable 
at
http://subversion.tigris.org/files/documents/15/44589/svn-win32-1.5.5.zip).
1.1 Erased my old subversion and expanded the new one;
1.2 Put the new one on the system path, so that Apache can see SVN dlls;
1.3 Copyied 'mod_dav_svn.so' and 'mod_authz_svn.so' to Apache's modules 
directory.

2. Updated the Python 2.5 bindings for Subversion on Win32 (avaliable at
http://subversion.tigris.org/files/documents/15/44591/svn-win32-1.5.5_py.zip).
2.1 Copyied the files from '\libsvn' to 'c:\Python25\Lib\...\libsvn
2.2 Followed the instructions to rename the libsvn/*.dll files to .pyd (since 
python
2.5 no longer reads dlls);

3. Updated the Python 2.5 bindings installer for Win32 (avaliable at
http://subversion.tigris.org/files/documents/15/44597/svn-python-1.5.5.win32-py2
.5.exe).
3.1 Installed the 'exe';

4. Restart windows.

Just for the record... it didn't exactly happend in this order, nor it happend
peacefully. I've spent the whole day strugling with different 
.zips/.exes/.dlls/.sos.
So be sure to align SVN amongst all envolved parts before giving up that 
sollution.

Result: It worked and my Trac/SVN performance improved dramatically.

Original comment by lucasfra...@gmail.com on 4 Mar 2009 at 9:24

GoogleCodeExporter commented 8 years ago
Closing as due to environment issue.

Original comment by Graham.Dumpleton@gmail.com on 5 Mar 2009 at 10:59

GoogleCodeExporter commented 8 years ago

Original comment by Graham.Dumpleton@gmail.com on 6 Mar 2009 at 4:42