Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes /account/settings/location/ crashes #1234

Open
imported-from-roundup opened this issue Aug 8, 2014 · 1 comment
Open

Sometimes /account/settings/location/ crashes #1234

imported-from-roundup opened this issue Aug 8, 2014 · 1 comment

Comments

@imported-from-roundup
Copy link

Comment by paulproteus:

This is the traceback:

Traceback (most recent call last):

File "/home/deploy/milestone-
a.buildout/vendor/packages/Django/django/core/handlers/base.py", line 111, in
get_response
response = callback(request, _callback_args, *_callback_kwargs)

File "/home/deploy/milestone-
a.buildout/vendor/packages/Django/django/contrib/auth/decorators.py", line 23,
in _wrapped_view
return view_func(request, _args, *_kwargs)

File "<string>", line 2, in set_location

File "/home/deploy/milestone-a.buildout/mysite/base/decorators.py", line 73,
in view
request, template, view_data = func(_args, *_kw)

File "/home/deploy/milestone-a.buildout/mysite/account/views.py", line 290, in
set_location
mysite.base.middleware.get_user_ip(request))[1]

File "/home/deploy/milestone-a.buildout/mysite/profile/view_helpers.py", line
142, in get_geoip_guess_for_ip
country_name = geoip_database.country_name_by_addr(ip_as_string)

File "/home/deploy/milestone-
a.buildout/vendor/packages/pygeoip/pygeoip/init.py", line 467, in
country_name_by_addr
return self.record_by_addr(addr)['country_name']

TypeError: 'NoneType' object is unsubscriptable

In my opinion, the view_helpers.py get_geoip_guess_for_ip() function should
catch TypeError and do something reasonable in that situation.

This causes real users to hit our Error 500 page, which is sad.


Comment by paulproteus:

Hi Susan!

I remember you and I were looking at this on IRC a few weeks ago. Are you still
interested in working on it? Did you manage to reproduce the problem in the test
suite?


Comment by onceuponatimeforever:

I couldn't repro the bug several weeks ago. Sorry I should've kept you updated on the progress of
this ticket. I'll look into this further later tonight and Ill be on IRC to discuss it.


Comment by paulproteus:

No worries about not following up.

Reproducing it is likely to be somewhat subtle. I seem to recall you were
having trouble getting the MaxMind database in a path that our code will
find.

Also our code for finding that database is pretty bad. We should simplify
it.

I won't be on IRC much later tonight, but if you can manage to help there
& then from others, thumbs up. I'm happy to find some other time.


Comment by onceuponatimeforever:

Attached is an imperfect, still-in-progress PR: #200
Feel free to comment, I still cannot reproduce the bug. :(


Comment by onceuponatimeforever:

In the issue #990, I've removed all mentions of the location, including the settings/location/ path.


Status: chatting
Nosy List: individuwill, onceuponatimeforever, paulproteus
Priority: urgent
Imported from roundup ID: 919 (view archived page)
Last modified: 2014-05-13.08:52:10

@ehashman
Copy link
Member

I am wondering if this "urgent" bug is still relevant? Are we even using account/settings/location this way anymore? I'm going to retriage this.

cc @paulproteus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants