So I was using osqa svn 332 and I wanted to upgrade to version 550 I ran:

#python2.6 /var/www/osqa/manage.py migrate forum

it migrated all the 244 awards but when it came to load the inital data for forum it died a horrible death heres the traceback:

File "/var/www/techanswers/manage.py", line 13, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.6/site-packages/Django-1.2.1-py2.6.egg/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.6/site-packages/Django-1.2.1-py2.6.egg/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.6/site-packages/Django-1.2.1-py2.6.egg/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.6/site-packages/Django-1.2.1-py2.6.egg/django/core/management/base.py", line 218, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/management/commands/migrate.py", line 109, in handle
    ignore_ghosts = ignore_ghosts,
  File "/usr/local/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/migration/__init__.py", line 215, in migrate_app
    post_migrate.send(None, app=app_label)
  File "/usr/local/lib/python2.6/site-packages/Django-1.2.1-py2.6.egg/django/dispatch/dispatcher.py", line 162, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/signals.py", line 22, in create_permissions_compat
    create_permissions(get_app(app), (), 0)
  File "/usr/local/lib/python2.6/site-packages/Django-1.2.1-py2.6.egg/django/contrib/auth/management/__init__.py", line 28, in create_permissions
    defaults={'name': name, 'content_type': ctype})
  File "/usr/local/lib/python2.6/site-packages/Django-1.2.1-py2.6.egg/django/db/models/manager.py", line 135, in get_or_create
    return self.get_query_set().get_or_create(**kwargs)
  File "/usr/local/lib/python2.6/site-packages/Django-1.2.1-py2.6.egg/django/db/models/query.py", line 381, in get_or_create
    raise e
django.db.utils.IntegrityError: duplicate key violates unique constraint "auth_permission_pkey"

anybody has any idea on how to solve the issue? (thanks in advance for your time =])

asked 19 Jul '10, 16:38

segfault's gravatar image

segfault
2655913
accept rate: 50%


I happen to know that you just transferred the entire database from one machine to another using an external utility :) The problem is that some of those utilities do not reset the primary key sequences correctly. So what you can do is to reset the sequences manually, do, this:

On the command line run:

python manage.py sqlsequencereset forum
python manage.py sqlsequencereset auth
python manage.py sqlsequencereset south

And run the output of each command directly in the database (for example, using the same tool you used to make the data transfer).

link

answered 19 Jul '10, 16:58

Hernani%20Cerqueira's gravatar image

Hernani Cerq... ♦♦
16.8k65975
accept rate: 52%

that fixed it thank you so much!!! =DDD

(19 Jul '10, 18:31) segfault
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:

×37

Asked: 19 Jul '10, 16:38

Seen: 398 times

Last updated: 19 Jul '10, 18:31

powered by OSQA