Forum OpenACS Q&A: OpenACS 3.2.5 broken in CVS?

Collapse
Posted by Ola Hansson on
I just got a server error on the index page. When I checked "datamodel.txt" from loading the datamodel I found this:
...

psql:bboard.sql:152: NOTICE:  CREATE TABLE/PRIMARY KEY will create
implicit index 'bboard_pkey' for table 'bboard'
psql:bboard.sql:152: NOTICE:  CREATE TABLE will create implicit
trigger(s) for FOREIGN KEY check(s)
psql:bboard.sql:152: ERROR:  Unable to identify an operator '=' for
types 'bpchar' and 'varchar'
        You will have to retype this query using an explicit cast
psql:bboard.sql:156: ERROR:  DefineIndex: relation "bboard" not found
psql:bboard.sql:168: ERROR:  DefineIndex: relation "bboard" not found
psql:bboard.sql:179: ERROR:  DefineIndex: relation "bboard" not found
psql:bboard.sql:185: ERROR:  DefineIndex: relation "bboard" not found
psql:bboard.sql:191: ERROR:  DefineIndex: relation "bboard" not found
psql:bboard.sql:195: ERROR:  DefineIndex: relation "bboard" not found
psql:bboard.sql:219: ERROR:  Relation 'bboard' does not exist
psql:bboard.sql:260: NOTICE:  CREATE TABLE will create implicit
trigger(s) for FOREIGN KEY check(s)

...

openacs3=# select version();
                            version                             
----------------------------------------------------------------
 PostgreSQL 7.2devel on i586-pc-linux-gnu, compiled by GCC 2.96
(1 row)
I just checked PG 7.2 devel and OpenACS 3.2.5 out from cvs and I'm running 3.3ad13. It's only when AOLserver is being run from /etc/inittab it happens...
as:2345:respawn:/home/nsadmin/bin/nsd -it /home/nsadmin/openacs3.tcl -u nsadmin -g nsadmin

When the server is running in the foreground, started from the command line like this:
/home/nsadmin/bin/nsd -ft /home/nsadmin/openacs3.tcl -u nsadmin -g nsadmin ...I don't get the error. However, there's an message from the ACS in either case when I visit /bboard; "Server is Having Trouble" (I agree). This is what the server log says:
[root@localhost log]# tail -n 40 server.log 
[13/Aug/2001:18:58:58][2255.2051][-sched-] Notice: Running scheduled
proc flag_interrupted_spams...
[13/Aug/2001:18:58:58][2255.2051][-sched-] Error: command "ns_db" is
not enabledcommand "ns_db" is not enabled
    while executing
"ns_db gethandle"
    (procedure "flag_interrupted_spams" line 2)
    invoked from within
"flag_interrupted_spams"
    ("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 10 flag_interrupted_spams {} 997721928 0
t}"
[13/Aug/2001:18:59:59][2255.5126][-conn0-] Error: command "ns_db" is
not enabledcommand "ns_db" is not enabled
    while executing
"ns_db gethandle"
    invoked from within
"set db [ns_db gethandle]"
    (file "/web/openacs3/www/index.tcl" line 57)
    invoked from within
"source $ad_conn(file)"
    (procedure "ad_handle_abstract_url" line 67)
    invoked from within
"ad_handle_abstract_url cns0 {}"
[13/Aug/2001:19:00:02][2255.7176][-sched:41-] Error: command "ns_db"
is not enabled
command "ns_db" is not enabled
    while executing
"ns_db gethandle subquery"
    (procedure "user_send_notifications" line 2)
    invoked from within
"user_send_notifications hourly"
[13/Aug/2001:19:00:02][2255.6151][-sched:68-] Error: command "ns_db"
is not enabled
command "ns_db" is not enabled
    while executing
"ns_db gethandle subquery"
    (procedure "sdm_send_notifications" line 2)
    invoked from within
"sdm_send_notifications hourly"
Anyone got a clue?
Collapse
Posted by Roberto Mello on
Hi Ola,

If you checked it out of CVS, it's not 3.2.5. It's 3.2.6 in the making. Please download the tarball from openacs.org

You're running a development version of PostgreSQL 7.2. I haven't tested it on 7.2 and I haven't of anyone who has, so you could be our tester on that. Would you grab the 3.2.5 tarball and try to load it on 7.2 and let us know how it goes please?

Collapse
Posted by Ola Hansson on
Thanks Roberto,

Sure, I'll do that and be back in a flash!

Collapse
Posted by Don Baccus on
Uhhh...let's not get too excited if it fails on PG 7.2 devel, at least
not if it installs fine on PG 7.1.

You may've exposed a PG 7.2devel bug, after all.  If it installs on PG 7.1 but not PG 7.2 let someone over in PG land know so they can fix the bug.

Of course if it fails under PG 7.1 then we've got a problem we need to fix.

Collapse
Posted by Jonathan Marsden on
When I have seen it, "ns_db not enabled" seemed to mean that AOLserver can't talk to the database.  At all.  So, check earlier in your server.log for issues when AOLserver tried to load postgresql.so and you may find the reason.

The datamodel issue may be a separate issue relating to PG 7.2devel.

It's a total guess, but I don't think much has changed in OpenACS 3.2.5 CVS since the 3.2.5 release anyway, whereas PG 7.2devel sounds... well, like development code.  Perhaps PG 7.2devel is not ready for prime time yet, and/or it needs a modified AOLserver driver module compared to PG 7.1?

You could test these guesses by switching to the released OpenACS 3.2.5 and seeing if that helps, and then by switching to the latest released PG (7.1.2) and see if that helps... if you still get the problem then... blame AOLserver 3.3+ad13?  Or your postgresql.so driver module?

Collapse
Posted by Don Baccus on
I didn't read past the datamodel error, actually ...

The two are unrelated.  The last two posts put together pretty much cover all the bases, though ...

Collapse
Posted by Ola Hansson on
Well, PG 7.2devel works equally bad with the 3.2.5 tarball. The behaviour is precisely the same as with 3.2.6 CVS sources.

With the PG 7.1.2 tarball four more relations gets loaded than is the case with 7.2 (amongst them bboard).

The error on the index page ('command "ns_db" is not enabled') is still around with 7.1.2 if I start AOLserver 3.3 from inittab. My next step will be to try with 3.2ad12. I think the pgdriver 2.0 is compiled correctly.

Interestingly enough I get redirected to /register upon submission..!?
Maybe I'missing something really simple, but I've tried two or three times.
I will give it another go a bit later...

thanks,

Collapse
Posted by Roberto Mello on
You have a misconfiguration problem somewhere. Probably with regards to PL/pgSQL. Try creating in on the "template0" database before procedding to creating the 3.2.5 datamodel.
createlang plpgsql template0

Then comment the PL/pgSQL lines in www/doc/sql/postgres.sql and load the datamodel.

I tested all this before release, but I re-loaded the CVS datamodel just in case, with no errors whatsoever.

325test=# select version();
                            version                            
---------------------------------------------------------------
 PostgreSQL 7.1.2 on i686-pc-linux-gnu, compiled by GCC 2.95.4
(1 row)

325test=# select count(*) from pg_tables;
 count 
-------
   386
(1 row)
Collapse
Posted by Ola Hansson on
Roberto,

As almost always, you're right😊!

A "createlang plpgsql template1" was what was missing. I don't recall ever having to do like that any time before, though...

So, it looks like PG 7.1.2 and 3.2.6 is fine. Sorry if it sounded like I raised the suspicion that it wasn't! But I still think it's weird that 3.3ad13 misbehaves from inittab. I will try 3.2ad12 with the same driver tomorrow.

PG 7.2 definitely have a bug at the moment, the way I see it and maybe someone being a member of the postgres mailing lists (as opposed to myself) will be nice and inform them, if it really is a bug that is?

Collapse
Posted by Don Baccus on
PL/pgSQL isn't created by default.  In the past you've probably done the createlang on your individual database.

Roberto's suggestion will result in all databases you create afterwards having PL/pgSQL pre-defined (template0 is copied when you make a new database).  This saves you the step of having to remember to do it each time you create a new database to hold a new OpenACS instance.

Collapse
Posted by Ola Hansson on
The same thing happens with 3.2ad12 ('command "ns_db"
      is not enabled', that is) so I can't blame 3.3ad13. The driver is the 2.0.0 pgdriver from the openacs.org software section. I don't think it has been modified in a while and we should have heard loud and clear if something was wrong with it. On the other hand, ahem, I may've compiled it wrong.

I have RH 7.1 and these are my pgdriver makefile params:

INSTALL=/home/nsadmin

PGLIB=/usr/local/pgsql/lib

PGINC=/usr/local/pgsql/include

NSHOME=/home/nsadmin

CC=gcc

COPTS=-Wall -fpic -shared -I/usr/local/pgsql/include -I/home/nsadmin/include -I-/usr/include

nscache, nsrewrite, nssha and nsxml are also compiled and installed. (Not that it should have anything to do with this matter).

There is also a new fresh line at the end of /etc/inittab...

If the above seem correct I guess the only suspect left is my nsd config file.

(Oh well, I could swear that the same setup worked in RH 6.2)

Collapse
Posted by Jonathan Marsden on
Ola, I'm not sure if you're still having trouble or not... if you are,
you could try out PG 7.1.2 + AOLserver 3.3+ad13 + OpenACS 3.2.5 from my RPMs and see whether they work for you.

I've not made my RH 7.1 aolserver-3.3+ad13 RPMs public yet but they exist and work for me, though admittedly I start nsd using a Red Hat init script and not from inittab.  If you want to be a victim^H^H^H^H^H^Htester for these RPMs under RH 7.1, let me know.  It's about time I made this stuff available anyway 😊

Collapse
Posted by Ola Hansson on
Don, I think you may be wrong - Plpgsql is created "on the fly" in 3.x (from /www/doc/sql/postgres.sql) but *not* when you install 4.0. Maybe that's what confused things, eh?

Jonathan, there's still the index page issue when I start AOLserver 3.2ad2 or 3.3ad13 from inittab and I'll look deeper into that. I tested the RPMs a week ago and they work very nice, thank you! (Using them kinda makes me wonder why I keep compiling from source)

Roberto, during this "install fest" I tripped upon a few things that could use a little overhaul in the "Simple PostgreSQL install guide" at least. I wouldn't mind attempting to update it a bit, if you'd let me. I have DocBook installed and everything you know...😉

Collapse
Posted by Roberto Mello on
Ola, be my guest in updating whatever documentation you come across. /me loves good documentation. The source sgml is available from the  sourceforge.net CVS.
Collapse
Posted by Don Baccus on
What I meant was that PL/pgSQL isn't installed by default by Postgres.  You are right that the 3.x postgres.sql has the commands in it to do so.

"createlang" is easy and clean and by not trying to do the create in our sql scripts we avoid the noise error messages that are given when they're
run by the large number of folks who install PL/pgSQL in their databases by default when they create them.

Our docs have reflected this, at least I wrote something to this effect
in a "getting started" piece I did a year or so ago.