3385: Error 500 while trying to login when two url point to the same site

pval****@gmai***** (Google Code) (Is this you? Claim this profile.)
May 28, 2014
What version are you running?
2.0.1

What's the URL of the page containing the problem?
/account/login/

What steps will reproduce the problem?
1. Have an apache configuration that have two NamedVirtualHost pointing to exactly the same review board install
2. Configure, in general, one of the two hostname in the "server" field (for example: https://ipsla.cisco.com)
3. Test a logout/login with the two hostnames.

What is the expected output? What do you see instead?
I expect a normal login for both, but, instead, one of them gives me an error 500.


What operating system are you using? What browser?
Ubuntu 14.04, Chrome.

Please provide any additional information below.
I'm attaching my apache config.

Apache error log:
  Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 851, in emit
  msg = self.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 724, in format
  return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 467, in format
  s = self._fmt % record.__dict__
  KeyError: u'request_info'
  Logged from file response.py, line 111

The email I received from buildbot:
  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/core/handlers/base.py", line 118, in get_response
    response = middleware_method(request, e)
  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8.1-py2.7.egg/djblets/log/middleware.py", line 245, in process_exception
    exception, exc_info=1)
  File "/usr/lib/python2.7/logging/__init__.py", line 1586, in error
    root.error(msg, *args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1176, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8.1-py2.7.egg/djblets/log/__init__.py", line 116, in _log_with_request
    old_log(self, *args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1269, in _log
    self.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1279, in handle
    self.callHandlers(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1319, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 749, in handle
    self.emit(record)
  File "/usr/lib/python2.7/logging/handlers.py", line 424, in emit
    self.stream.flush()
  ValueError: I/O operation on closed file

The temporary fix I did:
Edit /usr/local/lib/python2.7/dist-packages/Djblets-0.8.1-py2.7.egg/djblets/log/middleware.py and comment out the implementation of LoggingMiddleware.process_exception
chipx86
#1 chipx86
Why are there two virtualhosts pointing to the same install?

I'm afraid it's really not a supported use case. Can you simply have one redirect to the other?
  • +NeedInfo
chipx86
#2 chipx86
Going into this more...

When you have two VirtualHosts using mod_wsgi and the same wsgi script, you're going to have issues. You need to section them both off to make use of directives like WSGIProcessGroup, WSGIApplicationGroup, etc. That's a bigger topic though.

On top of that, Review Board expects to have one single domain that it can identify itself as, for use in e-mails, the API, etc.

You'll need to have one of these domains redirect to the other, or have two separate installs/databases.
#3 pval****@gmai***** (Google Code) (Is this you? Claim this profile.)
I didn't know WSGI doesn't like this kind of setup. Mea culpa.

OK, I'll change my config and put a redirect from one hostname to the other. Not as clean, but let's avoid trouble.
You can close the defect.

Thanks for the help.
david
#4 david
  • -NeedInfo
    +SetupIssue