hasadna / Open-Knesset

A project aimed at making the Israeli Knesset more transparent. Python and Django based
http://oknesset.org/
BSD 3-Clause "New" or "Revised" License
106 stars 175 forks source link

sync_dev management task that creates dev db failed with error: too many SQL variables #648

Open OriHoch opened 8 years ago

OriHoch commented 8 years ago

(oknesset)oknesset@ip-10-209-139-40:/oknesset_data/oknesset/Open-Knesset$ ./manage.py sync_dev 2016-04-05 13:16:55,084 opbeat.instrumentation.packages.base:211 DEBUG Skipping instrumentation of memcache.Client.touch: type object 'Client' has no attribute 'touch' 2016-04-05 13:16:55,086 opbeat.instrumentation.packages.base:203 DEBUG Skipping instrumentation of redis. Module redis.client not found 2016-04-05 13:16:55,087 opbeat.instrumentation.packages.base:203 DEBUG Skipping instrumentation of urllib3. Module urllib3.connectionpool not found 2016-04-05 13:16:55,088 opbeat.instrumentation.packages.base:203 DEBUG Skipping instrumentation of redis. Module redis.client not found 2016-04-05 13:16:55,089 opbeat.instrumentation.packages.base:203 DEBUG Skipping instrumentation of mysql. Module MySQLdb not found 2016-04-05 13:16:55,090 opbeat.instrumentation.packages.base:203 DEBUG Skipping instrumentation of jinja2. Module jinja2 not found 2016-04-05 13:16:55,091 opbeat.instrumentation.packages.base:203 DEBUG Skipping instrumentation of pylibmc. Module pylibmc not found 2016-04-05 13:16:55,119 opbeat.instrumentation.packages.base:203 DEBUG Skipping instrumentation of sqlite. Module pysqlite2.dbapi2 not found Syncing... Creating tables ... Creating table waffle_flag_groups Creating table waffle_flag_users Creating table waffle_flag Creating table waffle_switch Creating table waffle_sample Installing custom SQL ... Installing indexes ... Installed 1 object(s) from 1 fixture(s)

Synced:

django.contrib.auth django.contrib.contenttypes django.contrib.sessions django.contrib.sites django.contrib.admin django.contrib.comments django.contrib.sitemaps django.contrib.flatpages django.contrib.messages django.contrib.staticfiles debug_toolbar tagging south planet pagination django_extensions actstream avatar hitcount annotatetext mailer backlinks djangoratings voting social.apps.django_app.default devserver crispy_forms storages corsheaders waffle import_export auxiliary mks mmm laws committees simple tagvotes accounts links user agendas notify persons events video okhelptexts polyorg tinymce suggestions okscraper_django lobbyists ok_tag opbeat.contrib.django tastypie

Not synced (use migrations):

Traceback (most recent call last): File "./manage.py", line 10, in execute_from_command_line(sys.argv) File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line utility.execute() File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/core/management/init.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv self.execute(_args, _options.dict) File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute output = self.handle(_args, _options) File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/core/management/base.py", line 415, in handle return self.handle_noargs(**options) File "/oknesset_data/oknesset/Open-Knesset/simple/management/commands/sync_dev.py", line 39, in handle_noargs model.objects.using(self.DB).delete() File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/db/models/query.py", line 468, in delete collector.delete() File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/db/models/deletion.py", line 260, in delete qs._raw_delete(using=self.using) File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/db/models/query.py", line 479, in _raw_delete sql.DeleteQuery(self.model).delete_qs(self, using) File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/db/models/sql/subqueries.py", line 85, in delete_qs self.get_compiler(using).execute_sql(None) File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql cursor.execute(sql, params) File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute return self.cursor.execute(sql, params) File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in exit six.reraise(dj_exc_type, dj_exc_value, traceback) File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute return self.cursor.execute(sql, params) File "/oknesset_data/oknesset/local/lib/python2.7/site-packages/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

alonisser commented 8 years ago

@OriHoch wtf? and looks like you are running this vs sqlite and not the postgres db. And I suspect this command can't work with sqlite

OriHoch commented 8 years ago

the sync_dev command copies the data from the postgres DB to an sqlite DB file - that's why you are seeing sqlite there