Forum OpenACS Q&A: ns_db is not enabled

Collapse
Posted by sue ryu on
i am running postgres 7.0, aolserver 3.0, lastest acspg
(7-acspg-3.2.2.b3.tar.gz to be exact). i am following greg mcmullan's
installation guide. well, the problem is i am getting the following
error msg when i start the aol server in the error log file:

Error: nsd.tcl: command "ns_db" is not enabled
command "ns_db" is not enabled
    while executing
"ns_db gethandle"
    invoked from within
"set db [ns_db gethandle]..."
    (procedure "ug_init_serve_group_pages" line 2)
    invoked from within
"ug_init_serve_group_pages"
    ("eval" body line 1)
    invoked from within
"eval [concat [list $proc] $args]"
    (procedure "ad_run_scheduled_proc" line 43)
    invoked from within
"ad_run_scheduled_proc {f t 1 ug_init_serve_group_pages {} 957045492 0
t}"
[29/Apr/2000:17:58:15][3079.1026][-sched-] Notice: Running scheduled
proc ad_partner_initialize...
[29/Apr/2000:17:58:15][3079.1026][-sched-] Notice: ad-partner: Can't
get db handle. Using list_of_cookies to register cookies
[29/Apr/2000:17:58:15][3079.1026][-sched-] Notice: Done running
scheduled proc ad_partner_initialize.
[29/Apr/2000:17:58:15][3079.1026][-sched-] Error: nsd.tcl: expected
boolean value but got ""
expected boolean value but got ""

any ideas?????

your help will be greatly appreciated!

sue

Collapse
Posted by Ben Adida on
oops, very clearly it's time to add an FAQ. This is a common problem. It means your Postgres driver is not being loaded. Did you compile and install the Postgres driver correctly? Did you plop it in /home/nsadmin/bin/ (or wherever your AOLserver bin is)? Did you set up your .ini file to load up the driver as a DB driver? Check your logs for "loading postgres.so"
Collapse
Posted by sue ryu on
ben,
i checked what you suggested. i installed the driver correctly and
i copied greg's book.ini file and then convert it to
*.tcl file. anyhow, it has the following section for the db section:

ns_section "ns/db/drivers"

ns_param postgres    "postgres.so"

ns_section "ns/db/driver/postgres"

ns_param datestyle    "iso"

but, i don't see loading postgres.so in the error log file.
question: i started the server with -t option, do i still have the
*.ini file in the /www/hostname/www/parameters directory?

thanks again!

sue

Collapse
Posted by sue ryu on
well, i got further. i am writing this for the benefit of others.
since, i had posgres 6-5 and need it for other reasons, i installed
the new version 7.0 into /opt directory. i compiled the driver and
also aol server to point to the correct place.
now, the problem was that when the driver was loading it was looking
at the /usr/local/pgsql directory instead of /opt/usr/local/pgsql...
i created the softlink to this and the driver is loaded.

another thing i did wrong, i did not have the full version of *.ini
file. i copied from gres's guide, but it is missing the section like
servername and stuff. he probably meant to add more stuff into *.ini
file or whatever. it is becoming to be a big challenge for me to
set this aolserver with acs and stuff.

i can't give up now.... right?  esp., when i am working on this on
saturday.....

well, i have another problem now. i am having problem with nsssle.so.
i can't build it. i don't want to build it now. i will do it after
i get the taste of aolserver. so, i do not have this in my *.tcl file
to bring up the nsd but it wants to bring it it. what is wrong?

by the way, which one do i suppose to use? nsd76 or nsd8x???

thanks for anyone reading this msg and more thanks to anyone responding to me!

sue

Collapse
Posted by Don Baccus on
  • If you just use nsd, it will use nsd76. The AOLserver folks claim that nsd83 is a lot slower but I've been unable to pin them down as to why. I have an idea as to why, but won't bother you with details. Just use nsd for now.

  • The secure sockets layer stuff can be gotten from the binary, they can't distribute source to it at this point. This means that you need to download both the binary and source in order to build our version of the ACS at the moment if you also want https support. You're on the right track, i.e. ignore it for now until you've got stuff running and feel more comfortable with it. If it's trying to load it you must have a reference to nssl somewhere in your .tcl file. I know because I commented it out of mine and there are no errors. You can just ignore the error anyway, things should still work
Collapse
Posted by Brent Fulgham on
Please check where your libpq.so library is stored.  If you are
using PostgreSQL 7.0, you have a "libpq.so.2.1", but no "libpq.so.2.0".
The problem is that most AOLserver builds are against PostgreSQL
6.5.3, which means your binary is looking for "libpq.so.2.0".

Solution?  Simply link libpq.so.2.0 to libpq.so.2.1

Collapse
Posted by Don Baccus on
Hmmm...AOLserver itself doesn't reference libpq, just the driver which is dynamically loaded.  She shouldn't need to do a link as you suggest, she just needs to make sure she's got the  right library path set in .bash_profile and the latest version of the  makefile and driver source.

If she's using RedHat and installed PG originally as a package, she might still be pointed to the 6.5.3 libpq 'cause the RPM puts stuff in  different place than a normal PG build.

Collapse
8: libpq (response to 1)
Posted by Roberto Mello on
Well, I had PG installed as a package, but after removing it and installing PG from source, I set my library path right, did a ldconfig, compiled the driver and AOLserver/PG Driver were still asking for libpq 2.0. I then made a link from the 2.1 libpq to the 2.0 and everything worked fine.

I even included this in the documentation, and that's probably why Brent suggested it. So if this is wrong, it's my fault 😊

Collapse
Posted by Brent Fulgham on
I'm not sure if this problem is specific to Linux, or is true for all SysV-ELF style systems.  However, I observed the following when working with PostgreSQL 6.5.3 and 7.0:

1.  Many pre-compiled versions of AOLserver will have been built against PostgreSQL 6.5.3, since Postgres 7.0 was still in Beta at the time.  From a binary compatibility standpoint this is no problem since the API is identical.  However...

2.  The linking commands cause nspostgres.so to seek the library "libpq.so.2.0".  I tried every combination of linker command I could think of to change it to "libpq.so.2" to no avail.  The linker must pull the soname from the binary and use it for its searching routines.

3.  PostgreSQL 7.0 has a "libpq.so.2.1".  If you install Postgres 7, and your AOlserver was built against PostgreSQL 6.5.3, you will get an error when attempting to load the nspostgres.so driver because it is searching for libpq.so.2.0.  Therefore, creating the symlink allows the program to load.

Collapse
Posted by sue ryu on
Unfortunately, I am still having a problem. I get the login page and then when it tries to connect to the db, it tries and then fails to register the new user due to the DB connection. as for the AOL server log file goes, i do see that it is loading postgres.so. before it says it is loading i got the following error:

[01/May/2000:21:28:21][3743.1024][-main-] Error: nsd.db: no 
driver
defined for pool: nscp

but, right after this line it said it is loading... and 
loaded...
[01/May/2000:21:28:21][3743.1024][-main-] Notice: loading:
/home/nsadmin/bin/postgres.so
[01/May/2000:21:28:21][3743.1024][-main-] Notice: 
PostgreSQL loaded.

i also had other errors like:
Error: nsd.tcl: 
invalid set id: ""
    while executing
"ns_set size $all_the_redirects"
    invoked from within
"if !$ad_redirects_installed_p {
    # we haven't done this already
    set ad_redirects_installed_p 1

    # we could use ad_parameter_section (define..."

should i b
Collapse
Posted by Don Baccus on
This latest error makes me wonder if you've correctly configured the initialization file in the /parameters directory?

Also, your post was cut off so I can't see what the actual question was after the snippet from the log file...

Collapse
Posted by sue ryu on
Dear Don, I have a feeling that i did not set up the ini file in the /web/servername/parameter directory as well. my question was that in the log file i had the error saying

      [01/May/2000:21:28:21][3743.1024][-main-] Error: nsd.db: no 
      driver defined for pool: nscp
      [01/May/2000:21:28:21][3743.1024][-main-] Notice: loading:
      /home/nsadmin/bin/postgres.so
      [01/May/2000:21:28:21][3743.1024][-main-] Notice: 
      PostgreSQL loaded.
but, it looks like PostgreSql was loaded.
i posted the tcl file used to bring up the aolserver, but it was cut off. i tried 3 more times to post the same message but the site was having a problem inserting the message. anyhow, i am posting my tcl file and parameter ini file here. as for the ini file in the parameter, i did not include everything from ad.ini file. i did not want to include anything that i did not need. i am not sure if this caused the problem. currently, the test1 site brings up the login screen to register a new user, and then it brings up the second page asking more info and then it fails when it is connecting to DB. it says "Connecting ..." and then it says it is trying ... and then it fails... ..... thanks for your response. i am still having problem even posting a message here today. so, i am not including tcl file and ini file here. what should be looking in the ini file for this problem. thanks, sue
Collapse
Posted by Don Baccus on
</pre>
You probably haven't set the pools up properly.

Please read the most recent thread on "ns_db not enabled" problems.  Someone posted their entire nsd.tcl file there, and there was more discussion about these problems.

Also, you should include the full ad.ini (or even better, source the ad.tcl version in your nsd.tcl, because you only have to change your server name, etc once at the top of the file).  There are places that will break with bad queries if they can't find the parameter they're looking for.  Won't cause the error you're seeing, but will cause further problems down the line.