TransactionManagementError when importing users from SE dump

When i run python load_stackexchange the import process starts and after a while, when is importing users I get this error:

Traceback (most recent call last):
  File "", line 11, in <module>
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/", line 43  8, in execute_manager
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/", line 37  9, in execute
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/", line 191, i  n run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/", line 220, i  n execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/db/", line 219, in inne  r
  File "/usr/local/lib/python2.7/dist-packages/django/db/", line 207, in __ex  it__
    self.exiting(exc_value, self.using)
  File "/usr/local/lib/python2.7/dist-packages/django/db/", line 302, in exit  ing
  File "/usr/local/lib/python2.7/dist-packages/django/db/", line 56, in leave  _transaction_management
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/", line 115, i  n leave_transaction_management
    raise TransactionManagementError("Transaction managed block ended with "
django.db.transaction.TransactionManagementError: Transaction managed block ended with pend  ing COMMIT/ROLLBACK

I've tried multiple times and always get the same error.

mornaner's avatar
asked 2012-11-12 09:49:14 -0600
Evgeny's avatar
updated 2012-11-12 09:57:16 -0600
edit flag offensive 0 remove flag close merge delete


Thank you. I will look into SE import in a few hours and then post an answer. This may be due to our more recent changes in the code, or a previously undiscovered issue that shows with your data.

Evgeny's avatar Evgeny (2012-11-12 09:58:38 -0600) edit

I have fixed some errors (in the repository) and was able to import a small dump, will try on a bigger one tomorrow.

Evgeny's avatar Evgeny (2012-11-12 22:13:47 -0600) edit

@Evgeny I have tried the import multiple times today after updating and the error is still showing. It seems to be random, two times happened when the progress was 0.x% and once, specially hurting, the progress was 99.33%

mornaner's avatar mornaner (2012-11-14 11:50:50 -0600) edit

@mornaner, it is possible that you are running out of memory. The process may grow to 200-300 MB possibly bigger with the larger data sets. Linux may be evicting processes that want to use too much RAM.

Evgeny's avatar Evgeny (2012-11-14 11:54:36 -0600) edit
add a comment see more comments