Closed
Bug 1221252
Opened 9 years ago
Closed 9 years ago
url column not long enough
Categories
(Input Graveyard :: Code Quality, defect)
Input Graveyard
Code Quality
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: willkg, Assigned: willkg)
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.
Assignee | ||
Comment 1•9 years ago
|
||
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?
Assignee | ||
Comment 2•9 years ago
|
||
I keep seeing this. Grabbing to work on soon.
Assignee: nobody → willkg
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•9 years ago
|
||
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")
Assignee | ||
Comment 4•9 years ago
|
||
Here's an example: http://www.yjc.ir/fa/news/5386835/%D9%88%D8%A7%DA%A9%D9%86%D8%B4-%D8%A2%D8%B0%D8%B1%DB%8C-%D8%B2%D8%A8%D8%A7%D9%86-%D9%87%D8%A7-%D8%A8%D9%87-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87-%D9%81%DB%8C%D8%AA%DB%8C%D9%84%D9%87-%D9%81%DB%8C%D9%84%D9%85
Assignee | ||
Comment 5•9 years ago
|
||
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")
Assignee | ||
Comment 6•9 years ago
|
||
In a PR: https://github.com/mozilla/fjord/pull/704
Assignee | ||
Comment 7•9 years ago
|
||
Landed in master: https://github.com/mozilla/fjord/commit/8371b89c812af68db8431a8840807195974899ce Pushed to prod just now. That should nix the problem.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Product: Input → Input Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•