Ask Your Question

AtributeError when importing users from SE dump

asked 2012-11-20 03:56:13 -0600

mornaner gravatar image

I tryed the import multiple times and always get the error in the same point:

Traceback (most recent call last):
File "", line 11, in <module>
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/management/", line 459, in execute_manager
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/management/", line 382, in execute
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/management/", line 196, in run_from_argv
  self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/management/", line 232, in execute
  output = self.handle(*args, **options)
File "/var/www/askbot-devel/askbot/utils/", line 19, in wrapper
  return func(*args, **kwargs)
File "/var/www/askbot-devel/askbot/importers/stackexchange/management/commands/", line 374, in handle
File "/var/www/askbot-devel/askbot/importers/stackexchange/management/commands/", line 916, in transfer_users
  u_type =
AttributeError: 'NoneType' object has no attribute 'name'

Is it an error in the import script or maybe the dump has an error somewhere?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-11-20 09:19:35 -0600

Evgeny gravatar image

This one is not that hard to plug, but I'd like to know more about the contents of se_u. It is strange that user_type is None. It's possible that this user account is unusual in some way.

Seems to be a data-related issue that was not seen before in other dumps that we have used.

There is something that can save you time: the importer script has two options that allow you to separately read the dump and process the data. Use --help option to find out more.

Also - you can save yourself some time by using sqlite3 database engine for your test imports, as the database file can be simply copied to save the data and avoid re-reading it.

edit flag offensive delete link more


I removed the last users to check if this was a problem of the data dump but it raises the same error again. I think it's in the last user, because the first times was on 99.91% and now that I removed some users it's on 99.64%

mornaner gravatar imagemornaner ( 2012-11-20 15:33:53 -0600 )edit

You can fix up the code in that vicinity. if se_u.user_type is None: ... do something special .... If I had the dump here, I could work with this, but would have to bill you for this work.

Evgeny gravatar imageEvgeny ( 2012-11-20 15:38:09 -0600 )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: 2012-11-20 03:56:13 -0600

Seen: 129 times

Last updated: Nov 20 '12