Permission denied when running trac-admin initenv command.

50 views
Skip to first unread message

Nerses

unread,
Nov 9, 2009, 7:58:49 AM11/9/09
to Agilo for Scrum
Hi,

Trying to setup agilo on Debin 5.
Trac version is 0.11.5.
Using postgreSQL v8.3 as db engine.
created a user in postgre
after running "trac-admin /var/trac/proj initenv" and on database
connection string writing postgres://user:password@localhost/agilo_db?schema=public
i get following error

Creating and Initializing Project
Initenv for '/var/trac/proj' failed.
Failed to create environment.
permission denied for database agilo_db

Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/
admin/console.py", line 578, in do_initenv
options=options)
File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/
env.py", line 204, in __init__
self.create(options)
File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/
env.py", line 334, in create
DatabaseManager(self).init_db()
File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/db/
api.py", line 81, in init_db
connector.init_db(**args)
File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/db/
postgres_backend.py", line 76, in init_db
cursor.execute('CREATE SCHEMA "%s"' % cnx.schema)
File "/usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/db/
util.py", line 60, in execute
return self.cursor.execute(sql)
ProgrammingError: permission denied for database agilo_db

my pg_hba.conf file looks like this

# Database administrative login by UNIX sockets
local all postgres ident sameuser

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all ident sameuser
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5


What am I doing wrong?

Andrea Tomasini

unread,
Nov 9, 2009, 8:25:50 AM11/9/09
to ag...@googlegroups.com

On 9 Nov, 2009, at 13:58 , Nerses wrote:

> Hi,
Hi Narses :-)
May be it is a stupid question, but did you create the User and the
DB, and is the DB owned by that user? more info here: https://agilo.agile42.com/wiki/TracEnvironment

> my pg_hba.conf file looks like this
>
> # Database administrative login by UNIX sockets
> local all postgres ident sameuser
>
> # TYPE DATABASE USER CIDR-ADDRESS METHOD
>
> # "local" is for Unix domain socket connections only
> local all all ident sameuser
> # IPv4 local connections:
> host all all 127.0.0.1/32 md5
> # IPv6 local connections:
> host all all ::1/128 md5
This looks ok, as far as the DB is on the same machine, as you allow
only connection from localhost, or local networks 127.0.0.1/32

> What am I doing wrong?
Check that the DB is there and you can login as username, by running
psql from command line ;-)

HTH
ANdreaT

Nerses

unread,
Nov 9, 2009, 8:54:40 AM11/9/09
to Agilo for Scrum


On Nov 9, 5:25 pm, Andrea Tomasini <andrea.tomas...@agile42.com>
wrote:
Hi Andrea,
Yes I have created all the db and the user there, when I do psql
agilo_db
and then in psql console I wrote

select * from pg_shadow;

I got the user and md5 encrypted password so I assume the user owned
the DB isn't it?

>
> > my pg_hba.conf file looks like this
>
> > # Database administrative login by UNIX sockets
> > local all postgres ident sameuser
>
> > # TYPE DATABASE USER CIDR-ADDRESS METHOD
>
> > # "local" is for Unix domain socket connections only
> > local all all ident sameuser
> > # IPv4 local connections:
> > host all all 127.0.0.1/32 md5
> > # IPv6 local connections:
> > host all all ::1/128 md5
>
> This looks ok, as far as the DB is on the same machine, as you allow
> only connection from localhost, or local networks 127.0.0.1/32

Yes I'm connecting from local machine

>
> > What am I doing wrong?
>
> Check that the DB is there and you can login as username, by running
> psql from command line ;-)
>
can't get connected using command line with my user only can connect
to db by "sudo su postgres -c psql agilo_db". getting psql: FATAL:
Ident authentication failed for user "agilo_user". Can you suggest how
I must write the psql comman. I'm tring with psql -U agilo_user -W
agilo_db

> HTH
> ANdreaT

Andrea Tomasini

unread,
Nov 9, 2009, 9:08:51 AM11/9/09
to ag...@googlegroups.com

On 9 Nov, 2009, at 14:54 , Nerses wrote:

> On Nov 9, 5:25 pm, Andrea Tomasini <andrea.tomas...@agile42.com>
> wrote:
> Hi Andrea,
Hi Narses :-)

> Yes I have created all the db and the user there, when I do psql
> agilo_db
> and then in psql console I wrote
>
> select * from pg_shadow;
>
> I got the user and md5 encrypted password so I assume the user owned
> the DB isn't it?
Right, you might have problems in the md5 exchange, if that is the
problem, can you try to replace the line below as follows?

>>> my pg_hba.conf file looks like this
>>
>>> # Database administrative login by UNIX sockets
>>> local all postgres ident sameuser
>>
>>> # TYPE DATABASE USER CIDR-ADDRESS METHOD
>>
>>> # "local" is for Unix domain socket connections only
>>> local all all ident sameuser
>>> # IPv4 local connections:
>>> host all all 127.0.0.1/32 md5
host all all 127.0.0.1/32 trust

This will trust all connection coming from the local machine, without
requiring to challenge in md5...

HTH
ANdreaT

Nerses

unread,
Nov 9, 2009, 9:36:23 AM11/9/09
to Agilo for Scrum
Tried changing both ip4 and ip6 for local connections from md5 to
trust, restarted postgre server

no help the same error is there. :(

On Nov 9, 6:08 pm, Andrea Tomasini <andrea.tomas...@agile42.com>

Martin Häcker

unread,
Nov 11, 2009, 7:35:09 AM11/11/09
to ag...@googlegroups.com
Hi Nerses,

On 09.11.09 15:36, Nerses wrote:
> Tried changing both ip4 and ip6 for local connections from md5 to
> trust, restarted postgre server

I don't have much experience with postgress so I can't be of much help
there - but till you get this working, you could use an sqlite database
- that support is very well supported and also very fast.

That might at least work around the problem till you have found the
propper way to set up postgress to accept connections from localhost.

HTH

Martin
Reply all
Reply to author
Forward
0 new messages