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

DB field length overflow problem #16

Closed
stevejalim opened this issue Jun 2, 2017 · 1 comment
Closed

DB field length overflow problem #16

stevejalim opened this issue Jun 2, 2017 · 1 comment
Assignees

Comments

@stevejalim
Copy link
Contributor

We just found a DataError: value too long for type character varying(200) when trying to view the package-monitor results in the Admin. We don't have the context/stack available but it might be related to a pinned commit (git -e ...) as a dependency

017-06-02T10:25:28.949518+00:00 app[web.1]: ERROR Internal Server Error: /package_monitor/reload/
2017-06-02T10:25:28.949531+00:00 app[web.1]: Traceback (most recent call last):
2017-06-02T10:25:28.949533+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/exception.py", line 42, in inner
2017-06-02T10:25:28.949533+00:00 app[web.1]:     response = get_response(request)
2017-06-02T10:25:28.949534+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
2017-06-02T10:25:28.949535+00:00 app[web.1]:     response = self.process_exception_by_middleware(e, request)
2017-06-02T10:25:28.949535+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
2017-06-02T10:25:28.949536+00:00 app[web.1]:     response = wrapped_callback(request, *callback_args, **callback_kwargs)
2017-06-02T10:25:28.949537+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
2017-06-02T10:25:28.949537+00:00 app[web.1]:     return view_func(request, *args, **kwargs)
2017-06-02T10:25:28.949538+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/package_monitor/views.py", line 12, in reload
2017-06-02T10:25:28.949539+00:00 app[web.1]:     refresh_packages.local()
2017-06-02T10:25:28.949540+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/package_monitor/management/commands/refresh_packages.py", line 36, in local
2017-06-02T10:25:28.949540+00:00 app[web.1]:     create_package_version(r)
2017-06-02T10:25:28.949542+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/package_monitor/management/commands/refresh_packages.py", line 23, in create_package_version
2017-06-02T10:25:28.949542+00:00 app[web.1]:     PackageVersion(requirement=requirement).save()
2017-06-02T10:25:28.949543+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/base.py", line 796, in save
2017-06-02T10:25:28.949543+00:00 app[web.1]:     force_update=force_update, update_fields=update_fields)
2017-06-02T10:25:28.949544+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/base.py", line 824, in save_base
2017-06-02T10:25:28.949545+00:00 app[web.1]:     updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
2017-06-02T10:25:28.949546+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/base.py", line 908, in _save_table
2017-06-02T10:25:28.949546+00:00 app[web.1]:     result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
2017-06-02T10:25:28.949547+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/base.py", line 947, in _do_insert
2017-06-02T10:25:28.949548+00:00 app[web.1]:     using=using, raw=raw)
2017-06-02T10:25:28.949548+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method
2017-06-02T10:25:28.949552+00:00 app[web.1]:     return getattr(self.get_queryset(), name)(*args, **kwargs)
2017-06-02T10:25:28.949553+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 1045, in _insert
2017-06-02T10:25:28.949553+00:00 app[web.1]:     return query.get_compiler(using=using).execute_sql(return_id)
2017-06-02T10:25:28.949554+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 1054, in execute_sql
2017-06-02T10:25:28.949554+00:00 app[web.1]:     cursor.execute(sql, params)
2017-06-02T10:25:28.949555+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
2017-06-02T10:25:28.949556+00:00 app[web.1]:     return super(CursorDebugWrapper, self).execute(sql, params)
2017-06-02T10:25:28.949556+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
2017-06-02T10:25:28.949557+00:00 app[web.1]:     return self.cursor.execute(sql, params)
2017-06-02T10:25:28.949557+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
2017-06-02T10:25:28.949558+00:00 app[web.1]:     six.reraise(dj_exc_type, dj_exc_value, traceback)
2017-06-02T10:25:28.949559+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
2017-06-02T10:25:28.949559+00:00 app[web.1]:     return self.cursor.execute(sql, params)
2017-06-02T10:25:28.949560+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/opbeat/instrumentation/packages/dbapi2.py", line 169, in execute
2017-06-02T10:25:28.949561+00:00 app[web.1]:     return self._trace_sql(self.__wrapped__.execute, sql, params)
2017-06-02T10:25:28.949561+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/opbeat/instrumentation/packages/dbapi2.py", line 182, in _trace_sql
2017-06-02T10:25:28.949562+00:00 app[web.1]:     return method(sql, params)
2017-06-02T10:25:28.949562+00:00 app[web.1]: DataError: value too long for type character varying(200)
@hugorodgerbrown
Copy link
Contributor

Yup - we have a couple of long lines - and checking this out has highlighted a potential future issue, which I will add - the pyenv generated requirements files have inline annotations:

-e git+git://github.com/yunojuno/django-pagination.git@b5981c3d47bfcc5e440b8246c59633782cae8644#egg=django_pagination
...
six==1.10.0               # via apscheduler, bleach, django-appmail, django-rosetta, elasticsearch-dsl, html5lib, microsofttranslator, python-dateutil, python-memcached, social-auth-app-django, social-auth-core, twilio

Fix for this is to up the field size to 200, after fixing the inline comments.

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

No branches or pull requests

2 participants