"too many SQL variables" when doing rebuild_index on sqlite3 backend

328 views
Skip to first unread message

Adrian Fita

unread,
Nov 13, 2015, 1:05:19 PM11/13/15
to reviewboard
Hi. So, search broke some while ago and I'm trying to make it work again. I'm trying to rebuild the search index from scratch following the instructions from https://www.reviewboard.org/docs/manual/2.0/admin/sites/search-indexing/ but I get the following:

# "/usr/local/bin/rb-site" manage "/var/www/reviews" rebuild_index

WARNING: This will irreparably remove EVERYTHING from your search index in connection 'default'.
Your choices after this are to restore from backups or rebuild via the `rebuild_index` command.
Are you sure you wish to continue? [y/N] y
Removing all documents from your index because you said so.
All documents removed.
Indexing 16022 review requests
ERROR:root:Error updating reviews using default
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django_haystack-2.2.1-py2.7.egg/haystack/management/commands/update_index.py", line 221, in handle_label
    self.update_backend(label, using)
  File "/usr/local/lib/python2.7/dist-packages/django_haystack-2.2.1-py2.7.egg/haystack/management/commands/update_index.py", line 266, in update_backend
    do_update(backend, index, qs, start, end, total, self.verbosity)
  File "/usr/local/lib/python2.7/dist-packages/django_haystack-2.2.1-py2.7.egg/haystack/management/commands/update_index.py", line 89, in do_update
    backend.update(index, current_qs)
  File "/usr/local/lib/python2.7/dist-packages/django_haystack-2.2.1-py2.7.egg/haystack/backends/whoosh_backend.py", line 188, in update
    for obj in iterable:
  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.7-py2.7.egg/django/db/models/query.py", line 96, in __iter__
    self._fetch_all()
[...]
  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.7-py2.7.egg/django/db/backends/sqlite3/base.py", line 452, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: too many SQL variables
Traceback (most recent call last):
  File "/usr/local/bin/rb-site", line 9, in <module>
    load_entry_point('ReviewBoard==2.0.7', 'console_scripts', 'rb-site')()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.7-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1858, in main
    command.run()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.7-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1787, in run
    site.run_manage_command(args[0], args[1:])
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.7-py2.7.egg/reviewboard/cmdline/rbsite.py", line 645, in run_manage_command
    execute_from_command_line([__file__, cmd] + params)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.7-py2.7.egg/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.7-py2.7.egg/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.7-py2.7.egg/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.7-py2.7.egg/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
[...]
  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.7-py2.7.egg/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.7-py2.7.egg/django/db/backends/sqlite3/base.py", line 452, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: too many SQL variables

I'm using sqlite3 as backend. It seems that sqlite3 is limited to SQLITE_MAX_VARIABLE_NUMBER, which defaults to 999, as found on http://stackoverflow.com/questions/7106016/too-many-sql-variables-error-in-django-witih-sqlite3.

Any way to bypass this limitation and bring back the search?

Thanks,
Adrian

David Trowbridge

unread,
Nov 13, 2015, 1:46:49 PM11/13/15
to reviewboard
It looks like the only way to bypass that would be to recompile sqlite with a higher limit.

It's for reasons like this (and many others) that we do not recommend the sqlite backend for production deployments. You would be well served by migrating to MySQL or PostgreSQL.

-David

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages