url column not long enough

RESOLVED FIXED

Status

RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: willkg, Assigned: willkg)

Tracking

Details

I just saw an error go by from the feedback API:

   DataError: (1406, "Data too long for column 'url' at row 1")

That column has a max_length of 200 characters.

I kind of think we should just make that column a TextField which has no length limitations.

Why? Partially because it makes it easier to deal with long urls and long querystring params. Does the limit help us? I don't think so.

This bug covers changing that column.
Another way to deal with this is truncate at 200 characters. However, that depends on the following:

* What's the likelihood that a url is interesting after 200 characters?
* Do we get unicode urls which we then convert to utf-8 to store in the db?
* Does the max length specify bytes or characters?
I keep seeing this. Grabbing to work on soon.
Assignee: nobody → willkg
Status: NEW → ASSIGNED
My bad--it's not coming from the feedback API--it's coming from the view:

Internal Server Error: /en-US/feedback/firefox/41.0.2/
Traceback (most recent call last):
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/data/www/input.mozilla.org/venv/lib/python2.7/site-packages/newrelic-2.38.0.31/newrelic/hooks/framework_django.py", line 497, in wrapper
    return wrapped(*args, **kwargs)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/data/www/input.mozilla.org/input/fjord/feedback/views.py", line 383, in _persist_feedbackdev
    resp = fun(request, *args, **kwargs)
  File "/data/www/input.mozilla.org/input/fjord/feedback/views.py", line 482, in feedback_router
    *args, **kwargs)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/data/www/input.mozilla.org/input/fjord/feedback/views.py", line 305, in generic_feedback
    version, channel)
  File "/data/www/input.mozilla.org/input/fjord/base/utils.py", line 378, in _wrapped
    return fn(request, *args, **kwargs)
  File "/data/www/input.mozilla.org/input/fjord/base/utils.py", line 378, in _wrapped
    return fn(request, *args, **kwargs)
  File "/data/www/input.mozilla.org/input/fjord/feedback/views.py", line 229, in _handle_feedback_post
    opinion.save()
  File "/data/www/input.mozilla.org/input/fjord/feedback/models.py", line 322, in save
    super(Response, self).save(*args, **kwargs)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/base.py", line 734, in save
    force_update=force_update, update_fields=update_fields)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/base.py", line 762, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/base.py", line 846, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/base.py", line 885, in _do_insert
    using=using, raw=raw)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/query.py", line 920, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/sql/compiler.py", line 974, in execute_sql
    cursor.execute(sql, params)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/backends/mysql/base.py", line 124, in execute
    return self.cursor.execute(query, args)
  File "/data/www/input.mozilla.org/venv/lib/python2.7/site-packages/newrelic-2.38.0.31/newrelic/hooks/database_dbapi2.py", line 22, in execute
    *args, **kwargs)
  File "/data/www/input.mozilla.org/venv/lib/python2.7/site-packages/MySQLdb/cursors.py", line 173, in execute
    self.errorhandler(self, exc, value)
  File "/data/www/input.mozilla.org/venv/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
DataError: (1406, "Data too long for column 'user_agent' at row 1")
Bah. The traceback is this:

Internal Server Error: /fa/feedback/firefox/42.0/
Traceback (most recent call last):
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/data/www/input.mozilla.org/venv/lib/python2.7/site-packages/newrelic-2.38.0.31/newrelic/hooks/framework_django.py", line 497, in wrapper
    return wrapped(*args, **kwargs)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/data/www/input.mozilla.org/input/fjord/feedback/views.py", line 383, in _persist_feedbackdev
    resp = fun(request, *args, **kwargs)
  File "/data/www/input.mozilla.org/input/fjord/feedback/views.py", line 482, in feedback_router
    *args, **kwargs)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/data/www/input.mozilla.org/input/fjord/feedback/views.py", line 305, in generic_feedback
    version, channel)
  File "/data/www/input.mozilla.org/input/fjord/base/utils.py", line 378, in _wrapped
    return fn(request, *args, **kwargs)
  File "/data/www/input.mozilla.org/input/fjord/base/utils.py", line 378, in _wrapped
    return fn(request, *args, **kwargs)
  File "/data/www/input.mozilla.org/input/fjord/feedback/views.py", line 229, in _handle_feedback_post
    opinion.save()
  File "/data/www/input.mozilla.org/input/fjord/feedback/models.py", line 322, in save
    super(Response, self).save(*args, **kwargs)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/base.py", line 734, in save
    force_update=force_update, update_fields=update_fields)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/base.py", line 762, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/base.py", line 846, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/base.py", line 885, in _do_insert
    using=using, raw=raw)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/query.py", line 920, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/models/sql/compiler.py", line 974, in execute_sql
    cursor.execute(sql, params)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/data/www/input.mozilla.org/input/vendor/src/django/django/db/backends/mysql/base.py", line 124, in execute
    return self.cursor.execute(query, args)
  File "/data/www/input.mozilla.org/venv/lib/python2.7/site-packages/newrelic-2.38.0.31/newrelic/hooks/database_dbapi2.py", line 22, in execute
    *args, **kwargs)
  File "/data/www/input.mozilla.org/venv/lib/python2.7/site-packages/MySQLdb/cursors.py", line 173, in execute
    self.errorhandler(self, exc, value)
  File "/data/www/input.mozilla.org/venv/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
DataError: (1406, "Data too long for column 'url' at row 1")
Landed in master: https://github.com/mozilla/fjord/commit/8371b89c812af68db8431a8840807195974899ce

Pushed to prod just now. That should nix the problem.
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Product: Input → Input Graveyard
You need to log in before you can comment on or make changes to this bug.