Ask Your Question
1

manage.py migrate fatal error

asked 2013-02-01 07:59:31 -0600

coldsystem gravatar image

os : centos 6.3 Database mysql

askbot:0161_add_field__user_languages FATAL ERROR - The following SQL query failed: ALTER TABLE auth_user ADD COLUMN languages varchar(128) NOT NULL DEFAULT 'en'; The error was: (1060, "Duplicate column name 'languages'") ! Error found during real run of migration! Aborting.

edit retag flag offensive close merge delete

Comments

I found many errors when migrating on Heroku. Unfortunately I was not able to solve them (yet). But the website runs OK even with these...

oscarfh gravatar imageoscarfh ( 2013-02-01 09:10:46 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-02-01 11:00:18 -0600

Hi

This is common if you do syncdb first and then the migrations, askbot uses add_to_class to add more fields to the auth_user table when syncdb runs the first time it will add them and then the migration will try to add them again to solve it you can do the following command:

python manage.py migrate askbot 0160
python manage.py migrate askbot 0161 --fake

The first command will migrate it up to the last migration and the last one to "fake" the new migration, this "fake" parameter will add the migration into the south history but does not applies actual changes into the database, therefore you won't see any error message.

edit flag offensive delete link more

Comments

That is interesting. So everything should be working as expected even with the errors? And I should run the "fake" to avoid the error messages, correct?

oscarfh gravatar imageoscarfh ( 2013-02-01 13:13:23 -0600 )edit
1

you should run --fake because if the next askbot update comes and has migrations you won't be able to pass to the 0162 without faking 0161

Fitoria gravatar imageFitoria ( 2013-02-01 13:37:37 -0600 )edit
0

answered 2013-02-01 16:57:31 -0600

coldsystem gravatar image

Now . downloaded askbot 0.7.48

copied database sqlite backup from 0.7.43

i ran :

python manage.py syncdb

python manage.py migrate askbot 0160

python runserver host:port

Now i have this on the browser page :

DatabaseError at /
    database disk image is malformed
    Request Method: GET
    Request URL:    http://5.39.79.145:8081/
    Django Version: 1.4.3
    Exception Type: DatabaseError
    Exception Value:    
    database disk image is malformed
    Exception Location: /usr/lib/python2.6/site-packages/Django-1.4.3-py2.6.egg/django/db/backends/sqlite3/base.py in execute, line 344
    Python Executable:  /usr/bin/python
    Python Version: 2.6.6
    Python Path:    
    ['/root/forum',
     '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg',
     '/usr/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg',
     '/home/SITE-PROJECT',
     '/usr/lib/python2.6/site-packages/South-0.7.6-py2.6.egg',
     '/usr/lib/python2.6/site-packages/Coffin-0.3.7-py2.6.egg',
     '/usr/lib/python2.6/site-packages/lamson-1.1-py2.6.eg
edit flag offensive delete link more

Comments

file corruption on sqlite3? try to access it with the sqlite3 command and check this out: http://techblog.dorogin.com/2011/05/sqliteexception-database-disk-image-is.html

Fitoria gravatar imageFitoria ( 2013-02-01 20:43:40 -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

Stats

Asked: 2013-02-01 07:59:31 -0600

Seen: 735 times

Last updated: Feb 01 '13