Submitted by bluefluid on Sun, 02/20/2011 - 21:31
I'm installing Django and it fails with the following:
Now installing Django version 1.2.4 ..
Database initialization failed at yes.no :
Error: Your action, 'syncdb', was invalid.
This results in a partially installed Django. Didn't find resolution in a search. Before ever using the installer, I installed an older version of Django manually (0.91.3). My guess is that the previously installed version may be interfering -- if possible I'd like to install the new version without uninstalling the old manually-installed version first, although I would remove it if necessary.
Any other thoughts?
Status:
Active
Comments
Submitted by JamieCameron on Mon, 02/21/2011 - 01:15 Comment #1
Are you using a MySQL database with Django, or PostgreSQL?
Also, which Python version are you using?
Submitted by bluefluid on Mon, 02/21/2011 - 08:40 Comment #2
PostgreSQL v 8.1.22
Python v 2.4.3
Submitted by bluefluid on Mon, 02/21/2011 - 13:33 Comment #3
I think it was the old version of Django interfering -- after removing it I no longer see that error (now I'm on a different error).
Submitted by JamieCameron on Mon, 02/21/2011 - 15:07 Comment #4
Ok .. what is the new error?
Submitted by bluefluid on Mon, 02/21/2011 - 17:51 Comment #5
Unrelated issue with my db config. I'll continue working on this, thanks for your help!
Submitted by bluefluid on Mon, 02/21/2011 - 18:46 Comment #6
Actually, it looks like the installer is ignoring the login credentials I enter in the install options, instead using the default account login even though I've given it a different login. The default account login contains symbols like a numeral, which apparently won't let Django initialize the db. Thoughts?
Submitted by JamieCameron on Mon, 02/21/2011 - 20:06 Comment #7
Can you check if the account creation works if you just choose an alphabetic login and password?
Submitted by bluefluid on Tue, 02/22/2011 - 17:26 Comment #8
It doesn't. So now there are two issues:
1) Django installer ignores specified login info and always uses domain login info.
2) Django setup fails. The settings file has a syntax error, seems like it puts two sets of single quotes around the password string, maybe it should only have one. Here's the output:
Submitted by JamieCameron on Wed, 02/23/2011 - 14:28 Comment #9
I'm going to have to try re-producing this problem myself ... which Linux distribution and version are you running there?
Submitted by bluefluid on Wed, 02/23/2011 - 14:33 Comment #10
CentOS Linux 5.5
Virtualmin 3.83 Pro
Submitted by JamieCameron on Wed, 02/23/2011 - 17:53 Comment #11
Ok .. and is this a totally fresh Django install, or an upgrade?
Also, are you using the Python version that comes with CentOS 5.5?
Submitted by bluefluid on Wed, 02/23/2011 - 22:18 Comment #12
Fresh Django install.
Distro Python, version 2.4.3.
Submitted by JamieCameron on Thu, 02/24/2011 - 23:27 Comment #13
So I just did an install of Django using Virtualmin on a completely fresh CentOS 5.5 system with all packages up to date, and it worked fine..
I think I would need to login to your system myself to debug this further..
Submitted by bluefluid on Sat, 02/26/2011 - 17:06 Comment #14
It looks like the install script places single quotes around the password, and on my system the password already comes with single quotes. The resulting duplicates cause an error. I edited the install script to get it running here; you may want to work on a more generalized solution to account for different system setups. You may also want to look into the issue with the install script ignoring specified login credentials.
Submitted by JamieCameron on Sun, 02/27/2011 - 19:53 Comment #15
What was your change to the django installer exactly? From looking at the code, I don't see any place where it quotes the password at all ..
Submitted by bluefluid on Sun, 02/27/2011 - 19:58 Comment #16
Submitted by bluefluid on Sun, 02/27/2011 - 20:03 Comment #17
The installer seems to place django within the user home dir, so commands aren't found. e.g.:
Adding the parent dir to pythonpath hasn't helped. Thoughts?
Submitted by JamieCameron on Sun, 02/27/2011 - 20:15 Comment #18
Ok, thanks .. I actually already fixed that quoting issue, but it hasn't been released yet. The fix will be in Virtualmin 3.84.
As for the other error, make sure you set PYTHONPATH to /home/domain.com/public_html/lib/python
Submitted by bluefluid on Sun, 02/27/2011 - 20:21 Comment #19
Already did, still doesn't work.
Submitted by JamieCameron on Mon, 02/28/2011 - 00:28 Comment #20
I just tested this, and it worked fine for me.. make sure you set PYTHONPATH like so :
export PYTHONPATH=/home/domain.com/public_html/lib/python
This assumes that Django wasn't installed into a sub-directory under public_html.
Submitted by bluefluid on Mon, 02/28/2011 - 15:45 Comment #21
When I manually export PYTHONPATH it gets added, but for some reason this dir does not seem to work in my /etc/profile PYTHONPATH. Symlinking django from site-packages seems to work in the immediate sense...
Submitted by JamieCameron on Mon, 02/28/2011 - 15:59 Comment #22
Paths in /etc/profile might not get applied until you login and logout, or perhaps even reboot..
Submitted by bluefluid on Mon, 02/28/2011 - 17:29 Comment #23
I'd tried logging back in and rebooting, to no effect...
After a few more solved issues, I'm now getting a "No module named extensions" error. When I install django-extensions I get a syntax error, although it looks at least partially installed. Thoughts?
Once the initial hurdles are over I'm sure things'll quiet down again!
Submitted by JamieCameron on Mon, 02/28/2011 - 22:59 Comment #24
At this point, I think you may need to talk to Django experts ... Virtualmin just sets up a very basic development environment, after which you are on your own for creation of the rest of the app.
Submitted by bluefluid on Mon, 05/30/2011 - 14:05 Comment #25
I still see the quoting error in Virtualmin 3.85, and also the install script still ignores manually entered passwords.
Submitted by JamieCameron on Mon, 05/30/2011 - 19:06 Comment #26
So even for a new install of django, the PASSWORD line in the config file still isn't quoted properly?
I looked at the installer code, and it is definitely putting quotes on that line..
Submitted by bluefluid on Tue, 05/31/2011 - 13:33 Comment #27
Even for a completely new install of Django on a completely new virtual server, the installer sends an invalidly formatted password that causes the install to fail.
As mentioned above, the problem is that it's putting too many quotes.
Also, it still ignores user-specified passwords. Incidentally, for PostgreSQL installs it seems to use the "postgresql" backend rather than "postgresql_psycopg2", which at least once the Django people publicly recommended.
Submitted by JamieCameron on Tue, 05/31/2011 - 14:02 Comment #28
So when you created this domain, did you actually enter a password that has single quotes in it?
Because Virtualmin shouldn't be adding any extra quotes, other than those that happened to be in the password ..
Submitted by bluefluid on Tue, 05/31/2011 - 14:10 Comment #29
There are no quotes in the password itself. When the install script gets the domain password to use for Django, it gets the password itself enclosed in a pair of single quotes. The install script then adds another pair of single quotes.
The extra pair of single quotes cause the install to fail.
Submitted by JamieCameron on Tue, 05/31/2011 - 23:06 Comment #30
Those additional quotes in the password are very surprising, as Virtualmin doesn't add extra quotes when putting the DB password in the django config.
Can you check if Virtualmin is somehow already storing extra quotes for the password? You can do this as follows :
virtualmin list-domains --domain yourdomain.com --id-only
grep pass /etc/webmin/virtual-server/domains/$ID
, where $ID is the unique ID from step 1.Submitted by bluefluid on Tue, 05/31/2011 - 23:16 Comment #31
No quotes in the domain password stored there.
Submitted by JamieCameron on Wed, 06/01/2011 - 17:01 Comment #32
The only method I can think of the debug this further currently would be to actually login to your system myself and try a django install into the same domain, and see what is happening with the password ... let me know if that is possible.