Closed Bug 888946 Opened 11 years ago Closed 10 years ago

[traceback] TypeError: strptime() argument 1 must be string without null bytes, not unicode

Categories

(Input Graveyard :: Search, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: willkg)

Details

Just saw 500+ of these go by:


Traceback (most recent call last):

  File "/data/www/input.mozilla.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-1.11.0.55/newrelic/api/object_wrapper.py", line 216, in __call__
    self._nr_instance, args, kwargs)

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

  File "/data/www/input.mozilla.org/input/vendor/lib/python/django/utils/decorators.py", line 91, in _wrapped_view
    response = view_func(request, *args, **kwargs)

  File "/data/www/input.mozilla.org/input/vendor/src/django-mobility/mobility/decorators.py", line 23, in wrapper
    return f(request, *args, **kw)

  File "/data/www/input.mozilla.org/input/fjord/analytics/views.py", line 330, in dashboard
    for param, terms in facets.facet_counts().items():

  File "/data/www/input.mozilla.org/input/vendor-local/src/elasticutils/elasticutils/__init__.py", line 1403, in facet_counts
    for key, val in self._raw_facets().items():

  File "/data/www/input.mozilla.org/input/vendor-local/src/elasticutils/elasticutils/__init__.py", line 1390, in _raw_facets
    return self._do_search().response.get('facets', {})

  File "/data/www/input.mozilla.org/input/vendor-local/src/elasticutils/elasticutils/__init__.py", line 1213, in _do_search
    results = self.to_python(response.get('hits', {}).get('hits', []))

  File "/data/www/input.mozilla.org/input/vendor-local/src/elasticutils/elasticutils/__init__.py", line 376, in to_python
    return [self.to_python(item) for item in obj]

  File "/data/www/input.mozilla.org/input/vendor-local/src/elasticutils/elasticutils/__init__.py", line 373, in to_python
    obj[key] = self.to_python(val)

  File "/data/www/input.mozilla.org/input/vendor-local/src/elasticutils/elasticutils/__init__.py", line 373, in to_python
    obj[key] = self.to_python(val)

  File "/data/www/input.mozilla.org/input/vendor-local/src/elasticutils/elasticutils/__init__.py", line 367, in to_python
    return datetime.strptime(obj, '%Y-%m-%dT%H:%M:%S')

TypeError: strptime() argument 1 must be string without null bytes, not unicode


This is one of the urls:

https://input.mozilla.org/ru/?happy=1&product=Firefox&platform=Windows%207&locale=ru&date_start=2013-06-24&date_end=2013-07-01


That doesn't error out for me.

I'll look into this next.
So, to reproduce this, we have to send in a \x00. I don't see that happening in real life.

I fixed this in elasticutils in https://github.com/mozilla/elasticutils/commit/7ed9001c309b2e48f21b0f61fb8ca2a489744435

I'll wait until that fix lands in a released version of elasticutils and then update fjord with the latest version of elasticutils. Leaving this open until that work is done.
Closing old traceback bugs on input. Please reopen if they still need to be dealt with.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Hey--this one is new. It's still a problem.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
We have updated ElasticUtils a few times since then. I'm pretty sure this is fixed now given I haven't seen this error in a long while.
Status: REOPENED → RESOLVED
Closed: 11 years ago10 years ago
Resolution: --- → FIXED
Product: Input → Input Graveyard
You need to log in before you can comment on or make changes to this bug.