Forum OpenACS Development: Database error

Collapse
Posted by Iuri Sampaio on
I'm stuck at a database error.
Postgresql is running and i have all psql commands, which means the server is running locally and accepting conections

conaje@conaje:~$ psql -l
List of databases
Name | Owner | Encoding
-----------+-----------+-----------
conaje | conaje | UNICODE
conajedev | conajedev | UNICODE
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
(4 rows)

and aolserver's runing as well

8646 ? S 0:00 /usr/lib/postgresql/7.4/bin/postmaster -D /var/lib/postgresql/7.4/main
8647 ? S 0:00 \_ postgres: stats buffer process
8648 ? S 0:00 \_ postgres: stats collector process
8662 ? Ss 0:00 /usr/lib/postgresql/7.4/bin/pg_autovacuum -p 5440 -H /var/run/postgresql -L /var/log/postgresql/pg_autovacuum-7.4-main.log
8726 pts/0 S 0:00 /usr/lib/aolserver4/bin/nsd -it /home/conaje/conaje/etc/config.tcl -u conaje -s conaje -g web -b 72.249.38.150:80
8727 pts/0 S 0:00 \_ /usr/lib/aolserver4/bin/nsd -it /home/conaje/conaje/etc/config.tcl -u conaje -s conaje -g web -b 72.249.38.150:80
8728 pts/0 S 0:00 \_ /usr/lib/aolserver4/bin/nsd -it /home/conaje/conaje/etc/config.tcl -u conaje -s conaje -g web -b 72.249.38.150:80
8729 pts/0 S 0:00 \_ /usr/lib/aolserver4/bin/nsd -it /home/conaje/conaje/etc/config.tcl -u conaje -s conaje -g web -b 72.249.38.150:80
8730 pts/0 S 0:00 \_ /usr/lib/aolserver4/bin/nsd -it /home/conaje/conaje/etc/config.tcl -u conaje -s conaje -g web -b 72.249.38.150:80
8731 pts/0 S 0:00 \_ /usr/lib/aolserver4/bin/nsd -it /home/conaje/conaje/etc/config.tcl -u conaje -s conaje -g web -b 72.249.38.150:80

Any ideas about what is happening on this situation?
I already restarted both services, even created a clean db:
conaje@conaje:~$ dropdb conaje
DROP DATABASE
conaje@conaje:~$ createdb -E UNICODE conaje
CREATE DATABASE
conaje@conaje:~$

http://72.249.38.150/

the error.log file

************************************************
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: nsmain: AOLserver/4.0.10 starting
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: nsmain: security info: uid=1000, euid=1000, gid=104, egid=104
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: nsmain: max files: FD_SETSIZE = 1024, rl_cur = 1024, rl_max = 1024
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: adp[conaje]: mapped /*.adp
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: modload: loading '/usr/lib/aolserver4/bin/nssock.so'
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: modload: loading '/usr/lib/aolserver4/bin/nslog.so'
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: nslog: opened '/home/conaje/conaje/log/conaje.log'
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: modload: loading '/usr/lib/aolserver4/bin/nssha1.so'
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: modload: loading '/usr/lib/aolserver4/bin/nscache.so'
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: nscache module version 1.4 server: conaje
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: modload: loading '/usr/lib/aolserver4/bin/nsdb.so'
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: modload: loading '/usr/lib/aolserver4/bin/nspostgres.so'
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: PostgreSQL loaded.
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: conf: [ns/server/conaje]enabletclpages = 0
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Loading OpenACS, rooted at /home/conaje/conaje
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Sourcing /home/conaje/conaje/packages/acs-bootstrap-installer/bootstrap.tcl
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Bootstrap: sourcing /home/conaje/conaje/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Bootstrap: sourcing /home/conaje/conaje/packages/acs-bootstrap-installer/tcl/10-utilities-procs.tcl
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Bootstrap: sourcing /home/conaje/conaje/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Bootstrap: sourcing /home/conaje/conaje/packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Bootstrap: sourcing /home/conaje/conaje/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.
tcl
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Database API: Default database (dbn) is: 'default'
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Database API: Using ALL database pools for OpenACS.
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Database API: The following pools are available for OpenACS: pool2 pool3 pool1
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: dbdrv: opening database 'postgres:localhost::conaje'
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Opening conaje on localhost
[19/Feb/2007:19:58:24][8726.16384][-main-] Error: Ns_PgOpenDb(postgres): Could not connect to localhost::conaje: could not connect to server: No such file
or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

[19/Feb/2007:19:58:24][8726.16384][-main-] Error: dbdrv: failed to open database 'postgres:localhost::conaje'
[19/Feb/2007:19:58:24][8726.16384][-main-] Warning: Database API: couldn't allocate a handle from database pool "pool2".
[19/Feb/2007:19:58:24][8726.16384][-main-] Error: Database API: RDBMS type could not be determined for any pool.
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Bootstrap: Loading acs-tcl
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Loading acs-tcl/tcl/00-database-procs.tcl
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Loading acs-tcl/tcl/10-charset-compat-procs.tcl
[19/Feb/2007:19:58:24][8726.16384][-main-] Notice: Loading acs-tcl/tcl/30-xml-utils-procs.tcl

The message error:
OpenACS Installation: Error

--------------------------------------------------------------------------------
Thank you for installing the Open Architecture Community System (OpenACS), a suite of fully-integrated enterprise-class solutions for collaborative commerce. This is the OpenACS Installer which performs all the steps necessary to get the OpenACS Community System running on your server.
Please read the Release Notes before proceeding to better understand what is contained in this release.

The following database pools generated errors:

OpenACS could not allocate a handle from database pool "pool2".
Possible causes might include:

The database is not running.
The database driver has not been correctly installed.
The datasource or database user/password are incorrect.
You didn't define any database pools.

The first step involved in setting up your OpenACS installation is to configure your RDBMS, correctly install a database driver, and configure AOLserver to use it. You can download and install the latest version of the AOLserver Oracle and PostgreSQL drivers from the OpenACS.org Software Page.

Once you're sure everything is installed and configured correctly, restart AOLserver.

Collapse
2: Re: Database error (response to 1)
Posted by Orzenil Silva Junior on
Iuri,

Take a look at /var/run/postgresql directory and see if Unix domain socket file .s.PGSQL.5432 is there. If not, try /tmp. Maybe a symlink could resolve this issue (ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/)

Anyway, it seems nspostgres was compiled with another postgresql version instead this running version you describe. See that aolserver could not locate unix domain socket file from nspostgres driver info at service startup.

Try compile nspostgres again and be sure you are running it against your running aolserver and postgresql version.

Collapse
3: Re: Database error (response to 2)
Posted by Iuri Sampaio on
Orzenil,

Under /var/runpostgresql is .s.PGSQL.5440
because the server's listening postgres on port 5440.

I re-installed aolserver4-nspostgres and It seems the error is fixed.

Thanks a lot.