Ask Your Question
0

AtributeError when importing users from SE dump

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

mornaner gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

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

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 gravatar imagemornaner ( 2012-11-20 15:33:53 -0500 )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 -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

Stats

Asked: 2012-11-20 03:56:13 -0500

Seen: 131 times

Last updated: Nov 20 '12