View Full Version : Turbogears and Postgresql
02-19-2006, 10:15 PM
Hopefully there is at least one other person trying to use Turbogears with PostgreSQL that can help me out.
I am trying to complete the infamous wiki20 tutorial for Turbogears and have hit a snag. After going through the regular Turbogears install and fastcgi config, I had to install Psycopg and mxDateTime in order to get Python to interface with Postgres. After getting those two packages installed, I hit the following error when trying to hookup Turbogears to my database using the "tg-admin sql create" command:
psycopg.OperationalError: FATAL: IDENT authentication failed for user "test"
; used connection string 'dbname=mydatabase user=test password=test'
I've done some searching and it looks like it might be a postgres config file problem, which I assume I don't have access to. A clue was found here:
Any ideas from users or bluehost support staff? Thanks.
02-21-2006, 09:35 AM
I decided to fiddle during my lunch break. :)
The first thing I noticed is that you're using 'test' as your username. When I created the postgresql user 'test' (through CPanel) the actual postgresql username became 'winterri_test', where 'winterri' is my bluehost account name...this makes sense so that you don't run into issues when someone else already has a db named whatever name you're trying to use. CPanel added the 'winterri_' part automatically. Usernames work like this for mysql, too.
So, are you certain your postgresql username is 'test' and not '<bh-user>_test'?
Edit: Of course, I wrote the above while installing psycopg and mxdatetime. After I got those installed I ran into the same problem. :) I'll play with it more later.
02-21-2006, 10:30 AM
Yeah, I should have noted that I removed my real info in the inputs. I made sure to include the appropriate prefixed account name in my config files. If you try with using the same input with a MySQL database it should work. The more I think about it, the more I think it is a Postgresql config issue. I'm not sure bluehost would take the time to investigate the issue since they don't officially support Turbogears. I wonder if the same thing happens with Rails. Anyone hook up Rails to a Postgresql database on bluehost yet?
02-21-2006, 10:42 AM
If you use your bluehost account name and password in dev.cfg it works.
02-21-2006, 10:45 AM
Even though it works, do you think that is the proper way it should behave? I'm wondering if there is any kind of security risks associated with using the main account name and password in a plain text file like that.
02-21-2006, 11:02 AM
Even though it works, do you think that is the proper way it should behave?
No, not at all. Of course I don't have much experience with postgresql, but I would expect it to behave like mysql.
From reading this page (http://www.postgresql.org/docs/7.4/interactive/auth-methods.html#AUTH-IDENT) (section 18.104.22.168) of the postgresql admin guide, it looks to me like there aren't any ident maps on our bluehost servers (or the ident map being used is 'sameuser'). That's why we can only access postgresql with our bluehost login.
I think this is something that can be fixed by bluehost (and probably pretty easily, though I'm saying that with zero knowledge of how CPanel works behind-the-scenes).
02-21-2006, 11:30 AM
It sounds like bluehost is using the IDENT authentication option for postgres, which only allows access to users of the system and those manually specified in a config file. I am wondering if bluehost should be using the PASSWORD authentication option instead that allows users of the databases to connect. This would appear how they have MySQL setup since we don't have problems with that. The same page you posted explains this in a different section (link (http://www.postgresql.org/docs/7.4/interactive/auth-methods.html#AUTH-PASSWORD)). Maybe a bluehost admin can chime in here. :)
02-21-2006, 11:54 AM
Yeah, using the password method sounds good, too. Though if they really didn't want to, ident could still work. Remember, in the unix world manual never actually means manual. :) But you're right, instead of messing with the ident config file everytime one of us adds a postgresql username, the password method certainly sounds viable.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.