Closed Bug 625384 Opened 14 years ago Closed 14 years ago

url dispatch not working for collector under apache/mod_wsgi

Categories

(Socorro :: General, task)

x86_64
Linux
task
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rhelmer, Unassigned)

Details

In scripts/collector.py, socorro/collector/wsgicollector.py is imported (as wscol) and a tuple of ('/submit', socorro.webapi.classPartial.classWithPartialInit(wscol.Collector)) is passed to either web.application (in wsgi mode) or sweb.StandAloneWebApplication (in standalone mode). When running in standalone mode POSTing to '/submit' seems to work as expected, but in wsgi mode dispatch does not seem to be working when '/submit' is called. Lars added some logging in a patch last night, and we can see that Collector is not being instantiated at all in wsgi mode. I would like to turn on more logging/debug output for mod_wsgi: http://code.google.com/p/modwsgi/wiki/DebuggingTechniques Also we should be able to turn on web.py debugging by flipping web.config.debug to True in scripts/collector.py (we tried that last night but didn't find where the log output was going; I think we may need to turn up apache's LogLevel for that to show up is in error.log)
(In reply to comment #0) > When running in standalone mode POSTing to '/submit' seems to work as expected, > but in wsgi mode dispatch does not seem to be working when '/submit' is called. More specifically, it looks like web.py is returning HTTP code 404 and the string "not found" for the URL '/submit' when run under mod_wsgi.
(In reply to comment #0) > In scripts/collector.py, socorro/collector/wsgicollector.py is imported (as > wscol) and a tuple of ('/submit', > socorro.webapi.classPartial.classWithPartialInit(wscol.Collector)) is passed to > either web.application (in wsgi mode) or sweb.StandAloneWebApplication (in > standalone mode). If I instead set this urls to: ('.*', cpart.classWithPartialInit(wscol.Collector, config) Then it works as expected.. also this works in standalone mode, so not sure why '/submit' does not work in this case. Links to the code in question are: http://code.google.com/p/socorro/source/browse/trunk/scripts/collector.py http://code.google.com/p/socorro/source/browse/trunk/socorro/collector/wsgicollector.py
(In reply to comment #2) > (In reply to comment #0) > If I instead set this urls to: > ('.*', cpart.classWithPartialInit(wscol.Collector, config) The simplest way to do this is to change: http://code.google.com/p/socorro/source/browse/trunk/socorro/collector/wsgicollector.py#29 uri = '/submit' to uri = '.*'
Here is a dump of the environment when running under apache/mod_wsgi: PID: 9817 UID: 48 GID: 48 CONTENT_LENGTH: '0' CONTENT_TYPE: 'application/x-www-form-urlencoded' DOCUMENT_ROOT: '/data/socorro' GATEWAY_INTERFACE: 'CGI/1.1' HTTP_ACCEPT: '*/*' HTTP_HOST: 'crash-reports.mozilla.com' HTTP_USER_AGENT: 'curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.12.6.2 zlib/1.2.3 libidn/1.18 libssh2/1.2.2' PATH_INFO: '' QUERY_STRING: '' REMOTE_ADDR: '::1' REMOTE_PORT: '56145' REQUEST_METHOD: 'POST' REQUEST_URI: '/submit' SCRIPT_FILENAME: '/data/socorro/application/scripts/collector.py' SCRIPT_NAME: '/submit' SERVER_ADDR: '::1' SERVER_ADMIN: 'root@localhost' SERVER_NAME: 'crash-reports.mozilla.com' SERVER_PORT: '80' SERVER_PROTOCOL: 'HTTP/1.1' SERVER_SIGNATURE: '<address>Apache/2.2.15 (Red Hat) Server at crash-reports.mozilla.com Port 80</address>\n' SERVER_SOFTWARE: 'Apache/2.2.15 (Red Hat)' mod_wsgi.application_group: 'crash-reports.mozilla.com|/submit' mod_wsgi.callable_object: 'application' mod_wsgi.handler_script: '' mod_wsgi.input_chunked: '0' mod_wsgi.listener_host: '' mod_wsgi.listener_port: '81' mod_wsgi.process_group: '' mod_wsgi.request_handler: 'wsgi-script' mod_wsgi.script_reloading: '1' mod_wsgi.version: (3, 2) wsgi.errors: <mod_wsgi.Log object at 0x7f05c2623470> wsgi.file_wrapper: <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f05b4d5ba08> wsgi.input: <mod_wsgi.Input object at 0x7f05b44ad930> wsgi.multiprocess: True wsgi.multithread: False wsgi.run_once: False wsgi.url_scheme: 'http' wsgi.version: (1, 1)
We are calling this from mod_wsgi like this: WSGIScriptAlias /submit /data/socorro/application/scripts/collector.py web.py seems to be matching on everything *after* "/submit" in this case, for example if we do: WSGIScriptAlias / /data/socorro/application/scripts/collector.py Then it will match on "/submit" as intended. I looked into middleware config, that's how it's working there too.
OK jabba configured apache per comment 5, looks good now.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Component: Socorro → General
Product: Webtools → Socorro
You need to log in before you can comment on or make changes to this bug.