Forum OpenACS Q&A: Postgres looks down, but it's up!

I've installed aolserver 3.2 (as distributed by the aolserver people), pgsql 7.1beta4, and the pg driver 1.1.0 as distributed here.

Postgres is running with "-i" as well, so it accepts connections on both the Unix domain socket and the TCP/IP socket:

nsadmin@bebox:~$ psql -h localhost real
Welcome to psql, the PostgreSQL interactive terminal.
...

nsadmin@bebox:~$ psql real
Welcome to psql, the PostgreSQL interactive terminal.
....

The database pool definition reads like so:

ns_section "ns/db/pool/main"
ns_param Driver postgres
ns_param Connections 5
ns_param DataSource localhost::real
ns_param User nsadmin
ns_param Password "nsadmin"
ns_param Verbose On
ns_param LogSQLErrors On
ns_param ExtendedTableInfo On

and in the server log:

[14/Feb/2001:13:29:43][6132.1026][-sched-] Error: Ns_PgOpenDb(postgres):  Could not connect to localhost::real:  connectDB() -- connect() failed: No such file or directory
Is the postmaster running at 'localhost' and accepting connections on Unix socket '5432'?

[14/Feb/2001:13:29:43][6132.1026][-sched-] Error: dbdrv: failed to open database 'postgres:localhost::real'
[14/Feb/2001:13:29:43][6132.1026][-sched-] Error: could not allocate 1 handle from pool "main"
could not allocate 1 handle from pool "main"
    while executing
"ns_db gethandle"
    invoked from within

I'm completely baffled.

Does anyone have an idea where to probe?

I'm running a Debian Linux "woody" system.

Collapse
Posted by Ola Hansson on
Hi Stephen,

I'm absolutely not sure, but I vaguely recall that there were to restrictive permissions on /usr/local/pgsql when you install PG 7.1...

See to that nsadmin has read and/or execute permission.

Collapse
Posted by Stephen van Egmond on
That doesn't seem to be it. I'm able to run psql from nsadmin. I'm able to "cd" into /usr/local/pgsql and look around, and read/execute all the binaries and .so's.

In /etc/group:

nsadmin:x:102:nsadmin
web:x:1001:postgres,nsadmin
postgres:x:32:nsadmin
Collapse
Posted by Stephen van Egmond on
I smoked the system, and reinstalled from scratch.

I did the following differently:
* installed postgresql from the Debian packages currently on sid - install packages task-database-pg and postgresql-dev

* installed aolserver from source since the Debian package is hosed for now.

It just works.  My ACS is up! Yay!

Some stuff is busted (I get opaque "internal server errors"), but overall I'm pleased with myself.  I have no idea where to go from here, though.

Collapse
Posted by Roberto Mello on
task-database-pg + postgresql-dev will do the trick. I compiled PG 7.1 and used the goodies from the Debian package to make my compiled PG behave exactly as if I had it installed the package ("apt-get source postgresql*" is beatiful!).

However, the postgres-pl package, that installs the PL/PgSQL language (upon which OpenACS depends) installs the libraries on /usr/lib/postgresql/lib/plpgsql.so and you have to set your www/doc/sql/postgres.sql file to point to that. Read the comments in the beginning of the file and you'll see what you have to modify.

That's most likely the reason why you are getting server errors. Dump the database, recreate it, modify the postgres.sql file, reload the datamodel, and you should be fine.

Collapse
Posted by Ola Hansson on
If you have downloaded and installed OpenACS 3.2.4 from the download section of this site I believe there will occur a few server errors in combination with PG 7.1 due to matters discussed in this thread (unless the tarball has been updated). If you got your copy from CVS at Source Forge, at least the most severe errors (like being able to bootstrap) are fixed.