1
1

I'm (finally!) migrating from SE 1.0 to OSQA for Merspi.com.au and I'm running intro some troubles with /admin/sximporter and importing the StackExchange database dump.

Here's the debug error message as below,

Environment:

Request Method: POST
Request URL: http://merspi.com.au/admin/sximporter/
Django Version: 1.2.4
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.humanize',
 'django.contrib.sitemaps',
 'django.contrib.markup',
 'forum',
 'south']
Installed Middleware:
['django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'forum.middleware.extended_user.ExtendedUser',
 'forum.middleware.anon_user.ConnectToSessionMessagesMiddleware',
 'forum.middleware.request_utils.RequestUtils',
 'forum.middleware.cancel.CancelActionMiddleware',
 'forum.middleware.admin_messages.AdminMessagesMiddleware',
 'django.middleware.transaction.TransactionMiddleware']

Traceback:
File "/home/merspi/webapps/merspi/lib/python2.6/django/core/handlers/base.py" in get_response
  100.                     response = callback(request, *callback_args, **callback_kwargs)
File "/home/merspi/webapps/merspi/osqa/forum_modules/sximporter/views.py" in sximporter
  31.             importer.sximport(extract_to, options)
File "/home/merspi/webapps/merspi/osqa/forum_modules/sximporter/importer.py" in sximport
  917.     uidmap = userimport(dump, options)
File "/home/merspi/webapps/merspi/osqa/forum_modules/sximporter/importer.py" in userimport
  347.     readTable(path, "Users", callback)
File "/home/merspi/webapps/merspi/osqa/forum_modules/sximporter/importer.py" in readTable
  90.     parser.parse(f)
File "/usr/local/lib/python2.6/xml/sax/expatreader.py" in parse
  107.         xmlreader.IncrementalParser.parse(self, source)
File "/usr/local/lib/python2.6/xml/sax/xmlreader.py" in parse
  123.             self.feed(buffer)
File "/usr/local/lib/python2.6/xml/sax/expatreader.py" in feed
  207.             self._parser.Parse(data, isFinal)
File "/usr/local/lib/python2.6/xml/sax/expatreader.py" in end_element
  304.         self._cont_handler.endElement(name)
File "/home/merspi/webapps/merspi/osqa/forum_modules/sximporter/importer.py" in endElement
  73.             self.callback(self.el_data)
File "/home/merspi/webapps/merspi/osqa/forum_modules/sximporter/importer.py" in callback
  224.                 osqau = orm.User.objects.get(id=authenticated_user.id)
File "/home/merspi/webapps/merspi/lib/python2.6/django/db/models/manager.py" in get
  132.         return self.get_query_set().get(*args, **kwargs)
File "/home/merspi/webapps/merspi/lib/python2.6/django/db/models/query.py" in get
  342.         num = len(clone)
File "/home/merspi/webapps/merspi/lib/python2.6/django/db/models/query.py" in __len__
  80.                 self._result_cache = list(self.iterator())
File "/home/merspi/webapps/merspi/lib/python2.6/django/db/models/query.py" in iterator
  271.         for row in compiler.results_iter():
File "/home/merspi/webapps/merspi/lib/python2.6/django/db/models/sql/compiler.py" in results_iter
  677.         for rows in self.execute_sql(MULTI):
File "/home/merspi/webapps/merspi/lib/python2.6/django/db/models/sql/compiler.py" in execute_sql
  732.         cursor.execute(sql, params)
File "/home/merspi/webapps/merspi/lib/python2.6/django/db/backends/util.py" in execute
  15.             return self.cursor.execute(sql, params)
File "/home/merspi/webapps/merspi/lib/python2.6/django/db/backends/postgresql_psycopg2/base.py" in execute
  44.             return self.cursor.execute(query, args)

Exception Type: DatabaseError at /admin/sximporter/
Exception Value: current transaction is aborted, commands ignored until end of transaction block

Thanks in advance.

asked 13 Apr '11, 12:44

James%20Spittal's gravatar image

James Spittal
66239
accept rate: 0%

At first I thought this could be the problem: http://meta.osqa.net/questions/6023/sximporter-incompatible-with-recent-sx-dumps

But looking at the error message - there's no mention of duplicate users? Hmmmm...

(13 Apr '11, 12:48) James Spittal

I saw a similar (perhaps identical?) issue with sximporter when using PostgreSQL. After moving to MySQL, sximporter ran without incident.

If you are using the canned script install @ WebFaction to do the install, you'll need to manually modify the script to use MySQL. By default, it uses PostgreSQL.

link

answered 13 Apr '11, 14:07

farmerguy's gravatar image

farmerguy
412
accept rate: 100%

Correct - I'm using the script install at WebFaction. Is it fairly straight forward to modify the script to use MySQL? Having a look now. Thanks!

(13 Apr '11, 14:25) James Spittal

At a guess, I just need to change the following line: api.create_db (db_name, pwd,'postgresql' ) to 'mysql'

(13 Apr '11, 14:26) James Spittal
1

Here's the copy of the modified script for MySQL usage: http://dl.dropbox.com/u/233981/OSQATrunkInstall

(13 Apr '11, 14:51) James Spittal

Success! It was a problem with the WebFaction script trying to use Postgresql (which apparently is incompatible with SX Importer from the sound of things.)

The fix was to use MySQL instead of Postgres.

Script included here to autoinstall with MySQL instead of Postgres:

http://dl.dropbox.com/u/233981/OSQATrunkInstall

link

answered 13 Apr '11, 15:12

James%20Spittal's gravatar image

James Spittal
66239
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×62
×38
×37
×18

Asked: 13 Apr '11, 12:44

Seen: 537 times

Last updated: 13 Apr '11, 15:12

powered by OSQA