Ask Your Question
2

OperationalError at /account/signin/

asked 2012-08-24 15:25:25 -0500

Pepe gravatar image Pepe
71 6 10

Hi there, I'm getting this error when trying to sign in the first user right after installing askbot. Do you know what is it about?

OperationalError at /account/signin/

(1054, "Unknown column 'askbot_anonymousanswer.question_id' in 'field list'")

Request Method:     GET
Request URL:    http://127.0.1.1:8000/account/signin/?next=/
Django Version:     1.3.1
Exception Type:     OperationalError
Exception Value:    

(1054, "Unknown column 'askbot_anonymousanswer.question_id' in 'field list'")

Exception Location:     /usr/lib/python2.7/dist-packages/MySQLdb/connections.py in defaulterrorhandler, line 36
Python Executable:  /usr/bin/python
Python Version:     2.7.3
delete close flag offensive retag edit

Comments

Forgot to run migrations? Try "python manage.py migrate --list". Do you have any migrations that were not applied? If so, run "python manage.py migrate".

Evgeny ( 2012-08-24 15:29:48 -0500 )edit

Thanks for your quick response. I already did that. I've tried to run it again but it did not solve the problem. Any other suggestion?

Pepe ( 2012-08-24 15:39:15 -0500 )edit

Hey people, I'm still stuck with this... Any help?

Pepe ( 2012-08-26 08:59:26 -0500 )edit

Hi guys I am having the same problem and I can't install Posgres to solve the problem. Any other alternative?

Erich ( 2012-09-27 14:10:53 -0500 )edit
1

You must have forgotten to run python manage.py migrate

Evgeny ( 2012-09-27 15:54:59 -0500 )edit

2 Answers

Sort by » oldest newest most voted
2

answered 2012-08-27 10:13:09 -0500

Pepe gravatar image Pepe
71 6 10

Ok, finally I fixed this by running Postgresql instead of Mysql to create the database. ;)

link publish delete flag offensive edit

Comments

@Pepe, which version of MySQL did you have? Thank you.

Evgeny ( 2012-08-27 10:19:40 -0500 )edit

Current version, I think it is 5.5.27

Pepe ( 2012-08-27 14:54:53 -0500 )edit
1

answered 2012-11-01 11:53:21 -0500

sysko gravatar image sysko
63 1 6

updated 2012-11-01 12:00:21 -0500

It certainly due to the fact that before MySQL was using by default MyISAM as it's storage engine and the version 5.5 now use InnoDB, it seems to create some uncompatibility on altering table containing foreign key constraint (i.e it works with myisam but not innodb) so the migrate fails

doing this solve the issue for me (I know it's a work around, but it may helps to create a more generic solution)

open a MySQL shell (or phpmyadmin whatsoever) and run

 show create table askbot_anonymousanswer;

you should see a line that looks like this

CONSTRAINT `question_post_id_refs_id_648edfb25e596e3` FOREIGN KEY (`question_post_id`) REFERENCES `askbot_post` (`id`)

note the name of this question_post_id_refs_id_648edfb25e596e3

and then run

alter table askbot_anonymousanswer drop foreign key   question_post_id_refs_id_648edfb25e596e3 ;
alter table askbot_anonymousanswer change question_post_id question_id int(11) ;
link publish delete flag offensive edit

Comments

It should be possible now to run Askbot on InnoDB if Haystack is used for search, but this has not been tested yet.

Evgeny ( 2012-11-01 12:35:32 -0500 )edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-08-24 15:25:25 -0500

Seen: 144 times

Last updated: Dec 12 '12