question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TransactionManagementError with syncdata management command

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
MattFishercommented, May 25, 2020

Raised #1532

1reaction
greyharecommented, Jan 10, 2019

There’s still a transaction.rollback() on line 173 of syncdata.py. It can probably be deleted.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found