TransactionManagementError with syncdata management command
See original GitHub issueI’m running django-extensions 2.0.7, Django 2.0.5 and Python 3.5.2.
When I run the command ./manage.py syncdata
I see this error:
Traceback (most recent call last):
File "./manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/home/myuser/.virtualenvs/myproject/lib/python3.5/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/home/myuser/.virtualenvs/myproject/lib/python3.5/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/myuser/.virtualenvs/myproject/lib/python3.5/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/myuser/.virtualenvs/myproject/lib/python3.5/site-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/home/myuser/.virtualenvs/myproject/lib/python3.5/site-packages/django_extensions/management/utils.py", line 59, in inner
ret = func(self, *args, **kwargs)
File "/usr/lib/python3.5/contextlib.py", line 30, in inner
return func(*args, **kwds)
File "/home/myuser/.virtualenvs/myproject/lib/python3.5/site-packages/django_extensions/management/commands/syncdata.py", line 190, in handle
transaction.commit()
File "/home/myuser/.virtualenvs/myproject/lib/python3.5/site-packages/django/db/transaction.py", line 35, in commit
get_connection(using).commit()
File "/home/myuser/.virtualenvs/myproject/lib/python3.5/site-packages/django/db/backends/base/base.py", line 260, in commit
self.validate_no_atomic_block()
File "/home/myuser/.virtualenvs/myproject/lib/python3.5/site-packages/django/db/backends/base/base.py", line 432, in validate_no_atomic_block
"This is forbidden when an 'atomic' block is active.")
django.db.transaction.TransactionManagementError: This is forbidden when an 'atomic' block is active.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
TransactionManagementError "You can't execute queries until ...
I have the same issue, but with transaction.atomic() and TransactionTestCase didn't work for me. python manage.py test -r instead of python manage.
Read more >django.db.transaction.atomic Example - Program Talk
Source File: syncdata.py. @signalcommand @transaction.atomic def handle(self, *fixture_labels, **options): """ Main method of a Django command """ from ...
Read more >Command to wait for database connection
1) Before we run the server, we have to check if the database is connected in the docker-compose file. 2) To do this,...
Read more >2021年06月_weixin_39975868的博客_CSDN博客
html文件里写typescript,关于.net:.cshtml Razor文件中的TypeScript,2021上海自考计算机应用基础,2021自考计算机应用基础精选习题及答案.doc,mvc html.radiobutton ...
Read more >Untitled
... Apartamentos tropical park vera, Hp business service management training, ... Unknown getinfo command received cubase, Work programme uk welfare, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Raised #1532
There’s still a
transaction.rollback()
on line 173 ofsyncdata.py
. It can probably be deleted.