First time here? Check out the FAQ!
0

AtributeError when importing users from SE dump

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

Traceback (most recent call last):
File "manage.py", line 11, in <module>
  execute_manager(settings)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/management/__init__.py", line 459, in execute_manager
  utility.execute()
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/management/__init__.py", line 382, in execute
  self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/management/base.py", 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/base.py", line 232, in execute
  output = self.handle(*args, **options)
File "/var/www/askbot-devel/askbot/utils/dummy_transaction.py", line 19, in wrapper
  return func(*args, **kwargs)
File "/var/www/askbot-devel/askbot/importers/stackexchange/management/commands/load_stackexchange.py", line 374, in handle
  self.transfer_users()
File "/var/www/askbot-devel/askbot/importers/stackexchange/management/commands/load_stackexchange.py", line 916, in transfer_users
  u_type = se_u.user_type.name
AttributeError: 'NoneType' object has no attribute 'name'

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

mornaner's avatar
109
mornaner
asked 2012-11-20 03:56:13 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

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.

Evgeny's avatar
13.2k
Evgeny
answered 2012-11-20 09:19:35 -0600
edit flag offensive 0 remove flag delete link

Comments

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's avatar mornaner (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's avatar Evgeny (2012-11-20 15:38:09 -0600) edit
add a comment see more comments