3083: 500 error on first login due to profile not being created.

buck*****@gmai***** (Google Code) (Is this you? Claim this profile.)
david
david
Sept. 20, 2013
What version are you running?
1.7.13.

What's the URL of the page containing the problem?
http://rb.mydomain.com/r/

What steps will reproduce the problem?
1. Install ReviewBoard cleanly.
2. Navigate to /r/ [this step may be unnecessary]
3. Log in for the first time as 'admin' with the credentials created during rb-site setup.
4. 500 error.

What is the expected output? What do you see instead?
Expected: page loads correctly. Instead, a 500 error is generated.

What operating system are you using? What browser?
Windows. Firefox 24.0 beta.

Please provide any additional information below.
Here's the traceback from Apache's error log:
[Sun Sep 08 09:25:27 2013] [error] ERROR:root:Exception thrown for user admin at http://rb.mrflea.net/r/
[Sun Sep 08 09:25:27 2013] [error]
[Sun Sep 08 09:25:27 2013] [error] Profile matching query does not exist.
[Sun Sep 08 09:25:27 2013] [error] Traceback (most recent call last):
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/Django-1.4.6-py2.6.egg/django/core/handlers/base.py", line 111, in get_response
[Sun Sep 08 09:25:27 2013] [error]     response = callback(request, *callback_args, **callback_kwargs)
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.7.13-py2.6.egg/reviewboard/accounts/decorators.py", line 22, in _check
[Sun Sep 08 09:25:27 2013] [error]     return view_func(*args, **kwargs)
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.7.13-py2.6.egg/reviewboard/reviews/views.py", line 755, in all_review_requests
[Sun Sep 08 09:25:27 2013] [error]     local_site=local_site)
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.7.13-py2.6.egg/reviewboard/reviews/datagrids.py", line 576, in __init__
[Sun Sep 08 09:25:27 2013] [error]     self.timezone = pytz.timezone(user.get_profile().timezone)
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/Django-1.4.6-py2.6.egg/django/contrib/auth/models.py", line 400, in get_profile
[Sun Sep 08 09:25:27 2013] [error]     self._state.db).get(user__id__exact=self.id)
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/Django-1.4.6-py2.6.egg/django/db/models/query.py", line 366, in get
[Sun Sep 08 09:25:27 2013] [error]     % self.model._meta.object_name)
[Sun Sep 08 09:25:27 2013] [error] DoesNotExist: Profile matching query does not exist.
[Sun Sep 08 09:25:27 2013] [error] ERROR:django.request:Internal Server Error: /r/
[Sun Sep 08 09:25:27 2013] [error] Traceback (most recent call last):
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/Django-1.4.6-py2.6.egg/django/core/handlers/base.py", line 111, in get_response
[Sun Sep 08 09:25:27 2013] [error]     response = callback(request, *callback_args, **callback_kwargs)
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.7.13-py2.6.egg/reviewboard/accounts/decorators.py", line 22, in _check
[Sun Sep 08 09:25:27 2013] [error]     return view_func(*args, **kwargs)
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.7.13-py2.6.egg/reviewboard/reviews/views.py", line 755, in all_review_requests
[Sun Sep 08 09:25:27 2013] [error]     local_site=local_site)
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.7.13-py2.6.egg/reviewboard/reviews/datagrids.py", line 576, in __init__
[Sun Sep 08 09:25:27 2013] [error]     self.timezone = pytz.timezone(user.get_profile().timezone)
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/Django-1.4.6-py2.6.egg/django/contrib/auth/models.py", line 400, in get_profile
[Sun Sep 08 09:25:27 2013] [error]     self._state.db).get(user__id__exact=self.id)
[Sun Sep 08 09:25:27 2013] [error]   File "/usr/local/lib/python2.6/dist-packages/Django-1.4.6-py2.6.egg/django/db/models/query.py", line 366, in get
[Sun Sep 08 09:25:27 2013] [error]     % self.model._meta.object_name)
[Sun Sep 08 09:25:27 2013] [error] DoesNotExist: Profile matching query does not exist.

Here's my environment:
Debian 6.0.7
Django 1.4.6 [via easy_install dependencies]
Apache 2.2.16 (Debian)
mod_wsgi 3.3-2
PostgreSQL 8.4.17
#1 buck*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Note: After manually loading /, everything was fine.
david
#2 david
  • +EasyFix
    +Component-Dashboard
david
#3 david
  • +Started
  • +david
david
#4 david
Addressing this as I port to Django 1.5.x
david
#5 david
Fixed in master (e1b4b68). Thanks!
  • -Started
    +Fixed
#6 aj**@brookm******* (Google Code) (Is this you? Claim this profile.)
I am seeing this exact same issue with 1.7.25.

What version was this fixed in?  It would be good to add that info here if possible and a link to the specific commit would be super.
david
#7 david
This is fixed in the 2.0 releases.
david
#8 david
Also fixed in release-1.7.x (ce2e871)