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

Long search field causing error in search_maintenance #310

Open
mm-johnpeterson opened this issue Dec 27, 2018 · 2 comments
Open

Long search field causing error in search_maintenance #310

mm-johnpeterson opened this issue Dec 27, 2018 · 2 comments

Comments

@mm-johnpeterson
Copy link

mm-johnpeterson commented Dec 27, 2018

Describe the bug
A clear and concise description of what the bug is.
Running a Centos 7 deployment I run into an issue when trying to run search_maintenance.
django.db.utils.DataError: value too long for type character varying(254)

To Reproduce
Steps to reproduce the behavior:

  1. su - saluser
  2. cd sal_env
  3. source bin/activate
  4. cd sal
  5. python2.7 manage.py search_maintenance
  6. See error
/srv/saluser/sal_env/lib/python2.7/site-packages/django/db/models/fields/__init__.py:1430: RuntimeWarning: DateTimeField SavedSearch.created received a naive datetime (2018-11-27 18:39:34.789562) while time zone support is active.
  RuntimeWarning)
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/core/management/base.py", line 305, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/core/management/base.py", line 356, in execute
    output = self.handle(*args, **options)
  File "/srv/saluser/sal_env/sal/search/management/commands/search_maintenance.py", line 117, in handle
    SearchFieldCache.objects.bulk_create(search_fields)
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/db/models/query.py", line 452, in bulk_create
    ids = self._batched_insert(objs_without_pk, fields, batch_size)
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/db/models/query.py", line 1060, in _batched_insert
    inserted_id = self._insert(item, fields=fields, using=self.db, return_id=True)
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/db/models/query.py", line 1043, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 1054, in execute_sql
    cursor.execute(sql, params)
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/srv/saluser/sal_env/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.DataError: value too long for type character varying(254)

Server (please complete the following information):

  • Host environment [Centos 7. The environment is almost identical to https://github.com/salopensource/sal/wiki/RHEL-7 ]
  • Version [Sal version 3.3.13.1621]

Client (please complete the following information):
Not affected.

@mm-johnpeterson
Copy link
Author

This can likely be closed. Still trying to determine what field was that long as it has since disappeared but I modified the length of search_field and search_model under search_searchfieldcache and can now run search_maintenance.

@grahamgilbert
Copy link
Member

Can you PR what you did? There isn't really any reason for this to be kept to just your install.

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