wagtail / wagtailtrans

A Wagtail add-on for supporting multilingual sites
http://wagtailtrans.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
104 stars 60 forks source link

django.db.utils.OperationalError: cannot start a transaction within a transaction #156

Closed rafrasenberg closed 5 years ago

rafrasenberg commented 5 years ago

Hello, I am tryin to integrate wagtailtrans into a exsiting webpage however I get a traceback when I try to use migrate. I used the migration file provided in the docs. However I get a traceback.

Issue summary

Traceback (most recent call last): File "/home/webconexus/src/wagtail-portfolio/manage.py", line 10, in execute_from_command_line(sys.argv) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/core/management/init.py", line 381, in execute_from_command_line utility.execute() File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/core/management/init.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv self.execute(*args, cmd_options) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute output = self.handle(*args, *options) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped res = handle_func(args, kwargs) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 203, in handle fake_initial=fake_initial, File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/migrations/executor.py", line 244, in apply_migration state = migration.apply(state, schema_editor) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/migrations/migration.py", line 124, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/migrations/operations/special.py", line 105, in database_forwards self._run_sql(schema_editor, self.sql) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/migrations/operations/special.py", line 130, in _run_sql schema_editor.execute(statement, params=None) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 133, in execute cursor.execute(sql, params) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers return executor(sql, params, many, context) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/utils.py", line 89, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/backends/utils.py", line 83, in _execute return self.cursor.execute(sql) File "/home/webconexus/portfolio/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 296, in execute return Database.Cursor.execute(self, query) django.db.utils.OperationalError: cannot start a transaction within a transaction

Technical details

wagtailtrans==2.0.5 Django==2.1.7 wagtail==2.4 Python 3.6.7

mikedingjan commented 5 years ago

The migration make some assumptions about your setup, as stated in the docs. Also they aren't tested on SQLite only PostgreSQL..

Maybe you can check your setup and try it with PostgreSQL?

rafrasenberg commented 5 years ago

I just started with a fresh directory and it worked :) However I still have a issue. When I use Django's translation feature for strings, it is not recognized. Can wagtailtrans and those strings work together in one install?