Ask Your Question

Status of Zendesk import

asked 2013-05-21 16:30:28 -0500

kporangehat's avatar

Using the latest askbot-devel from github, I'm trying to import data from our Zendesk account. I followed the instructions in the documentation but it looks like the import function is broken. We have quite few users and it reports (before the traceback) that 0 were imported. Then it barfs.

Has this been kept up to date or is it likely in need of some love?

$ python import_zendesk /home/ec2-user/downloads/zendesk_import/zendesk.tgz 
/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/django/conf/ DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
  "use STATIC_URL instead.", DeprecationWarning)
/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/django/core/cache/ DeprecationWarning: settings.CACHE_* is deprecated; use settings.CACHES instead.
Importing user accounts: 0 users added
Traceback (most recent call last):
  File "", line 11, in <module>
  File "/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/django/core/management/", line 459, in execute_manager
  File "/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/django/core/management/", line 382, in execute
  File "/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/django/core/management/", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/django/core/management/", line 232, in execute
    output = self.handle(*args, **options)
  File "/home/ec2-user/downloads/shotgun-askbot/askbot/importers/zendesk/management/commands/", line 160, in handle
  File "/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/django/db/", line 224, in inner
    return func(*args, **kwargs)
  File "/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/django/db/", line 218, in __exit__
    self.exiting(exc_value, self.using)
  File "/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/django/db/", line 303, in exiting
  File "/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/django/db/", line 67, in leave_transaction_management
  File "/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/django/db/backends/", line 130, in leave_transaction_management
    raise TransactionManagementError("Transaction managed block ended with "
django.db.transaction.TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-05-21 17:23:47 -0500

Evgeny's avatar

Possibly this got out of hand. This may be a simple issue or due to change in the data schema. Could you send me a sample of dump data?

edit flag offensive delete link more


I can't send the schema unfortunately because of internal security reasons. But I'm going to take a hack at getting this working myself. If I get somewhere I will submit a pull request and update my findings here. Thanks.

kporangehat's avatar kporangehat  ( 2013-05-21 17:48:41 -0500 )edit

Super, thanks! Let me know if you have questions about the code.

Evgeny's avatar Evgeny  ( 2013-05-21 17:52:38 -0500 )edit

I submitted a couple of pull requests.

  1. The code to actually process the xml was commented out.

  2. Some values in the Zendesk data were longer than the max_length defined for the mapped fields. I added a snippet to truncate the content (like forum descriptions) to satisfy the max_length requirement.

  3. I submitted a separate pull request to fix some unicode errors I was seeing in the django admin when trying to delete users and posts.

Hoping I can do more with the Zendesk import (support tickets, select forums to import) but these changes at least got it working for me in its current state.

kporangehat's avatar kporangehat  ( 2013-05-22 00:27:23 -0500 )edit

Awesome, thank you, I've merged your pull requests.

Evgeny's avatar Evgeny  ( 2013-05-22 00:30:34 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-05-21 16:30:28 -0500

Seen: 497 times

Last updated: May 21 '13