[traceback] AttributeError: 'NoneType' object has no attribute 'strip'



5 years ago
2 years ago


(Reporter: willkg, Assigned: willkg)



(Whiteboard: u=user c=feedback p=1 s=input.2014q1)

Saw 4 of these today:

Traceback (most recent call last):

  File "/data/www/input.allizom.org/input/vendor/lib/python/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-", line 216, in __call__
    self._nr_instance, args, kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-", line 475, in wrapper
    return wrapped(*args, **kwargs)

  File "/data/www/input.allizom.org/input/vendor-local/src/django-rest-framework/rest_framework/compat.py", line 121, in view
    return self.dispatch(request, *args, **kwargs)

  File "/data/www/input.allizom.org/input/vendor/lib/python/django/views/decorators/csrf.py", line 77, in wrapped_view
    return view_func(*args, **kwargs)

  File "/data/www/input.allizom.org/input/vendor-local/src/django-rest-framework/rest_framework/views.py", line 327, in dispatch
    response = self.handle_exception(exc)

  File "/data/www/input.allizom.org/input/vendor-local/src/django-rest-framework/rest_framework/views.py", line 324, in dispatch
    response = handler(request, *args, **kwargs)

  File "/data/www/input.allizom.org/input/vendor-local/src/django-rest-framework/rest_framework/generics.py", line 372, in post
    return self.create(request, *args, **kwargs)

  File "/data/www/input.allizom.org/input/vendor-local/src/django-rest-framework/rest_framework/mixins.py", line 50, in create
    if serializer.is_valid():

  File "/data/www/input.allizom.org/input/vendor-local/src/django-rest-framework/rest_framework/serializers.py", line 479, in is_valid
    return not self.errors

  File "/data/www/input.allizom.org/input/vendor-local/src/django-rest-framework/rest_framework/serializers.py", line 471, in errors
    ret = self.from_native(data, files)

  File "/data/www/input.allizom.org/input/vendor-local/src/django-rest-framework/rest_framework/serializers.py", line 324, in from_native
    return self.restore_object(attrs, instance=getattr(self, 'object', None))

  File "/data/www/input.allizom.org/input/fjord/feedback/models.py", line 232, in restore_object

AttributeError: 'NoneType' object has no attribute 'strip'

It's worth checking into since it looks problematic.
Making this a P1 to look into asap. I've only gotten 4 and they're all on -stage, but it looks problematic and is probably an easy fix.
Assignee: nobody → willkg
Priority: -- → P1
Whiteboard: u=user c=feedback p= s=input.2013q4
I'm really puzzled by this. The device attribute is not a required field and it has a default. So if it's not provided, the default should kick in and that's an empty string--not a None.

Anyhow, I don't see obvious foul play here and I double-checked the documentation and we're doing restore_object as suggested. Ergo, I'm going to bump the priority way down and bump this out of this quarter.
Priority: P1 → P3
Whiteboard: u=user c=feedback p= s=input.2013q4 → u=user c=feedback p= s=
Duplicate of this bug: 948921
I keep getting these. Going to toss in a quick fix now.
Whiteboard: u=user c=feedback p= s= → u=user c=feedback p=1 s=input.2014q1
In a PR: https://github.com/mozilla/fjord/pull/213

Landed in master: https://github.com/mozilla/fjord/commit/2324aa3

Pushed to stage (where the problem keeps happening) and production (where it doesn't) just now.
Last Resolved: 5 years ago
Resolution: --- → FIXED
Product: Input → Input Graveyard
You need to log in before you can comment on or make changes to this bug.