Forum OpenACS Development: bug fixes from 4.6 merged to HEAD

Collapse
Posted by Jeff Davis on
Just wanted to let people know that I merged
the bug fixes from 4.6 to the HEAD.  There
might be some glitches since I did not
test much so if you do an install from HEAD and run into problems please post them.  Thanks.
Collapse
Posted by Don Baccus on
That explains the 115 e-mail alerts from CVS in my mailbox this AM ...
Collapse
Posted by Peter Alberer on

OpenACS does not start any longer cause there is a "{" missing:

in file "acs-bootstrap-installer/db-init-checks-postgresql.tcl" line 44
} elseif { [string equal $version "7.3"] } {

Collapse
Posted by Bart Teeuwisse on
I am signed up for CVS notifications but have never received any. Others have reported the same problem. Could some one look into this?

Thanks,
/Bart

Collapse
Posted by Jeff Davis on
I fixed the bootstrap check for 7.3.

Bart, Don's emails are to the openacs-cvs-list email
alias which come from the commit scripts, not the
forums messages.

Collapse
Posted by Roberto Mello on
I am going to look into this, since I'm responsible for the script that puts the CVS logs into the forums.

The problem is taht I didn't realize when I wrote the script, that you have to explicitly call some notifications:: functions to generate the mail.

Now that I know that, I have to figure out a way to call these functions from a non-OpenACS/AOLserver script. My script can get away with putting things into the forums because forums has a PL/pgSQL API, so I just connect to the database and use that API.

No such PL/pgSQL API exists for notifications, which means that I'll have to write it. That's why it has taken some time.

-Roberto

Collapse
Posted by Peter Alberer on

Hmm, i thought the HEAD revision was meant to work with PG7.3. But after the restart i get this:
"PostgreSQL 7.3 is not supported at this moment. Please use 7.2.3."

When is support for PG7.3 planned to be added?

Collapse
Posted by Roberto Mello on
The HEAD version supports 7.3. But I added a check for the 4.6 branch, to check for PG 7.3, and this change got merged to HEAD. We'll fix it.

-Roberto

Collapse
Posted by Bjorn Thor Jonsson on

OpenACS doesn't start for me either, I get this error:

[16/Jan/2003:16:00:02][9311.8192][-main-] Error: Server startup failed: Error during bootstrapping
can't read "db": no such variable
    while executing
"ns_db 0or1row $db "select proname from pg_proc where proname = '__test__' and pronargs = 0""
    (file "/home/efnisvaki/web/openacs-head/packages/acs-bootstrap-installer/db-init-checks-postgresql.tcl" line 1)

This is different from the errors I was getting yesterday.

Collapse
Posted by Peter Alberer on
My post was a solution to the problem:

You have to add a "{" to line 44 in file
"acs-bootstrap-installer/db-init-checks-postgresql.tcl"
} elseif { [string equal $version "7.3"] } {
(the last "{" was missing)

Collapse
Posted by Bjorn Thor Jonsson on

Peter, your solution fixed the startup problem (sorry for not noticing it at first).

But then I still get stuck at the fourth installation screen, "OpenACS Installation: Set System Information", when clicking the "Set System Information ->" button these errors show up in the log:

[16/Jan/2003:17:20:41][9700.57352][-conn4-] Error: Error sourcing /home/efnisvaki/web/openacs-head/packages/acs-bootstrap-installer/installer/site-info-2.tcl:
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")
    while executing
"ns_pg_bind 0or1row nsdb0 {
            select apm__set_value(
                :package_id,
                :parameter,
                :value
        ..."
[snip]

Does noone else get this error?

Collapse
Posted by Jeff Davis on
Can you either get a more recent copy of the postgres driver
or get the real error message from the -error.log file?
"Query was not a statement returning rows." is the generic
error and sort of impossible to fix from that.

That said, it might be related to having removed workflow from the core (I thought lars had fixed that one though).

Collapse
Posted by Bjorn Thor Jonsson on

Is this the real error message?:

[16/Jan/2003:17:31:20][9700.57352][-conn4-] Error: Ns_PgExec: result status: 7 message: ERROR:  -20000: The specified package 639 AND/OR parameter RestrictToSSL do not exist in the system

...it's the line before the lines I posted previously.

Is nspostgres-3.5 the most recent postgres driver? The one I currently use is from Mat's AOLServer distribution.

Thanks.

Collapse
Posted by tammy m on
Hi
I'm running postgres 7.3.1 and OACS that I downloaded from OpenACS.org CVS on 1/14/03.
HEAD of 4.6 development branch.
Downloaded with:
cvs -z3 -d :pserver:mailto:anonymous@openacs.org:/cvsroot co openacs-4

I'm getting lots of errors as well all seeming to be related to the acs-lang package and then the same RestrictToSSL error mentioned as well.

Any help would be most appreciated. I'm trying to use OACS for the first time!

Here go the errors I'm getting:

[16/Jan/2003:17:54:44][2065.6151][-conn3-] Notice: Querying '
      select locale, package_key, message_key, message
      from  lang_messages
      where package_key = acs-templating;'
[16/Jan/2003:17:54:44][2065.6151][-conn3-] Error: Ns_PgExec: result status: 7 message: ERROR:  Attribute "acs" not found

[16/Jan/2003:17:54:44][2065.6151][-conn3-] Error: dbinit: error(myhost.mydomain.com:5432:myserver,ERROR:  Attribute "acs" not found
): '
      select locale, package_key, message_key, message
      from  lang_messages
      where package_key = acs-templating
    '
[16/Jan/2003:17:54:44][2065.6151][-conn3-] Debug: <p>Failed to install ACS Templating, version 4.5.  The following error was generated:
<pre><blockquote>
Database operation &quot;select&quot; failed (exception NSDB, &quot;Query was not a statement returning rows.&quot;)

ERROR:  Attribute &quot;acs&quot; not found

SQL:
      select locale, package_key, message_key, message
      from  lang_messages
      where package_key = acs-templating

</blockquote></pre>

And this occurs later several times:

[16/Jan/2003:18:12:14][2065.3076][-conn0-] Debug: NO FULLQUERY FOR dbqd.acs-bootstrap-installer.installer.site-info-2.main_site_id_select --
<blockquote> using default SQL
</blockquote>
[16/Jan/2003:18:12:14][2065.3076][-conn0-] Notice: Querying '
    select package_id from apm_packages
    where instance_name = 'Main Site';'
[16/Jan/2003:18:12:14][2065.3076][-conn0-] Notice: dbinit: sql(myhost.mydomain.com:5432:myserver): '
    select package_id from apm_packages
    where instance_name = 'Main Site'
'
[16/Jan/2003:18:12:14][2065.3076][-conn0-] Notice: Querying '
            select apm__set_value(
                '641',
                'RestrictToSSL',
                'acs-admin/*'
            );'
[16/Jan/2003:18:12:14][2065.3076][-conn0-] Error: Ns_PgExec: result status: 7 message: ERROR:  -20000: The specified package 641 AND/OR parameter RestrictToSSL do not exist in the system

[16/Jan/2003:18:12:14][2065.3076][-conn0-] Error: dbinit: error(myhost.mydomain.com:5432:myserver,ERROR:  -20000: The specified package 641 AND/OR parameter RestrictToSSL do not exist in the system
): '
            select apm__set_value(
                '641',
                'RestrictToSSL',
                'acs-admin/*'
            );
        '
[16/Jan/2003:18:12:14][2065.3076][-conn0-] Error: Error sourcing /www/nsroot/myserver/packages/acs-bootstrap-installer/installer/site-info-2.tcl:
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR:  -20000: The specified package 641 AND/OR parameter RestrictToSSL do not exist in the system

SQL:
            select apm__set_value(
                '641',
                'RestrictToSSL',
                'acs-admin/*'
            );

    while executing
"ns_pg_bind 0or1row nsdb0 {
            select apm__set_value(
                :package_id,
                :parameter,
                :value
        ..."
    ("uplevel" body line 1)
    invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql"
    invoked from within
"db_exec 0or1row $db $full_statement_name $sql"
    invoked from within
"if {[regexp -nocase -- {^\s*select} $test_sql match]} {
            db_qd_log QDDebug "PLPGSQL: bypassed anon function"
            set selection [db_..."
    ("uplevel" body line 6)
    invoked from within
"uplevel 1 $code_block "
    invoked from within
"db_with_handle db {
        # plsql calls that are simple selects bypass the plpgsql
        # mechanism for creating anonymous functions (OpenACS - ..."
    (procedure "db_exec_plsql" line 13)
    invoked from within
"db_exec_plsql set_parameter_value {}"
    (procedure "parameter::set_value" line 7)
    invoked from within
"parameter::set_value -package_id $package_id -parameter $name -value $set"
    (procedure "ad_parameter" line 4)
    invoked from within
"ad_parameter -set "acs-admin/*" -package_id $main_site_id RestrictToSSL"
    (file "/www/nsroot/myserver/packages/acs-bootstrap-installer/installer/site-info-2.tcl" line 45)
    invoked from within
"source $__file "

And this as well:

[16/Jan/2003:17:54:43][2065.2051][-sched-] Notice: Running scheduled proc lang::catalog::import_from_all_files_and_cache...
[16/Jan/2003:17:54:43][2065.2051][-sched-] Error: invalid command name "lang::catalog::import_from_all_files_and_cache"
invalid command name "lang::catalog::import_from_all_files_and_cache"
    while executing
"lang::catalog::import_from_all_files_and_cache"
    ("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 5 lang::catalog::import_from_all_files_and_cache {} 1042768478 0 t}"

Thanks for any help. This is my first attempt to play with OACS and we hope to use it for a production site!

Collapse
Posted by Lamar Owen on
nspostgres 3.5 as available on the AOLserver SourceForge download site is the latest version.  nspostgres 3.5 is the latest CVS version from OpenACS CVS with very minor edits and a merge into the AOLserver CVS tree.  It is most certainly newer than the one available for download on the OpenACS site.

Any bugs you find should be reported either on these bboards or to the AOLserver listserv, or to me directly.  I have stepped out on a limb and volunteered to maintain the nspostgres driver; bug reports help immensely in maintenance! :-)

Collapse
Posted by Andrei Popov on
More breakages, I suppose:

A recent cvs checkout from -HEAD (just a couple of hours old) throws a whole bunch of errors when installing just about everything.

I've tried upgrading Pg driver to nspostgres-3.5, but it gets recognised as an outdated, with a suggestion to update...

Collapse
Posted by tammy m on
I am using the nspostgres 3.5 from the AOLServer SourceForge site and am having errors (described above in this thread). I doubt it's the driver alone.
Collapse
Posted by Lamar Owen on
I am currently running OpenACS 4.6 final with nspostgres3.5beta1 (virtually identical to the released 35).  I did not receive any instruction to upgrade.

This is with the released 4.6, not with HEAD.  I can try a HEAD install, though.....but only with PostgreSQL 7.2.3.

Did you recompile nspostgres for PostgreSQL 7.3.1? (it should have had other complaints for that error, but it doesn't hurt to ask).

Also, check to make sure the run user for AOLserver has the proper access rights to all tcl files -- improper ownership and modes in the aolserver install directories can cause symptoms similar to this.  That is, if AOLserver is being run as 'nsadmin' then nsadmin should probably own the entire aolserver install tree.  In particular, AOLSERVER_HOME/modules/tcl should be owned by nsadmin. Or grant read and execute to the whole tree (execute to the directories only, IIRC).

This error should have caused an immediate error, though, not just in the fourth page.

Which AOLserver version are you using?

Collapse
Posted by Andrei Popov on
In my case this was -HEAD on FreeBSD 4.7 with PostgreSQL 7.2.3, AOLserver 3.3+ad13 and a full recompile of nspostgres.  The part that (supposedly) throws up the warning is ns_pg_bind -- yet it does not even reach Postgres: I see nothing in the logs with debug level of 4, 8, 10.  I'll try this with AOLserver 3.5.1 -- will se where that gets me...
Collapse
Posted by Andrei Popov on
...and it did not get me anywhere: it still fails, with the same error.  It's also worth noting (albeit this may be a wrong forum) that nssha1 fails to compile under FreeBSD.

Like I said, this is with Pg7.2.3.  Will try upgrading to 7.3.1 and see if that helps.

Collapse
Posted by Jeff Davis on
One thing I would say is that if you are not completely familiar with openacs (to the point of being able to track down these sorts of things yourself) you should stick with the released version (currently 4.6, which can be downloaded as a tarball or checked out with tag oacs-4-6-final).

Also, my mentioning upgrading the db driver was not because there are any bugs which were fixed that might correct the problem, it was because there are some patches in it that have better error reporting.

The bug in Tammy's case is this:

Index: lang-message-procs.tcl
===================================================================
RCS file: /cvsroot/openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl,v
retrieving revision 1.17
diff -r1.17 lang-message-procs.tcl
442c442
<             set package_where_clause "where package_key = $package_key"
---
>             set package_where_clause "where package_key = :package_key"
I committed the fix on HEAD, it did not affect the 4.6 branch since it is i18n related.
Collapse
Posted by Andrei Popov on
Jeff,

My feedback to this thread has not been a "please help it does not work" -- I simply find it interesting that what used to work a dozen times I've installed and configured is not working now.  I am trying to see what causes these breakages and how they can be mitigated, whether it is a praticular combination of OS/db/AOLserver.  Unlike many here, for instance, I prefer to use FreeBSD, not Linux, even though this calls for a bumpier ride -- yet there's no reason while it should not work, is there?

Collapse
Posted by Jeff Davis on
Andrei, I was not trying to single you out there. It's more that a lot of folks download the HEAD when 4.6 would be hugely better as a starting point which is why I said it.

To be honest, I don't know what your problem is since you have not described very concretely. I assume it's something different than what Tammy described but other than that I don't know.

On nssha1, the best place to post something would be the aolserver mailing list (and to submit a bug at aolserver.sourceforge.net).

Collapse
Posted by Andrei Popov on

Fair enough. FWIW, if anybody is having the "You need to update" error -- make sure that you compile nspostgres with ACS=1 as follows:

  $ gmake ACS=1 POSTGRES=/usr/local
...
  $ gmake ACS=1 POSTGRES=/usr/local install

(substitute for just make on Linux).

As far as nssha1 is concerned -- lines 139 and 140 of nssha1.c need to be commented out if you are compiling in FreeBSD (probably it should just be wrapped in to a sensible #ifdef/#endif:

--- nssha1-0.1/nssha1.c.org     Mon Jan 20 00:57:45 2003
+++ nssha1-0.1/nssha1.c Mon Jan 20 00:52:46 2003
@@ -136,8 +136,8 @@
     return NS_OK;
 }

-typedef unsigned int u_int32_t;
-typedef unsigned char u_int8_t;
+/*typedef unsigned int u_int32_t;
+typedef unsigned char u_int8_t;*/

 /*** FROM sha.h: ***/

After these changes all is good with the follwoing setup: FreeBSD 5.0-CURRENT/postgresql-devel (7.3.1) from ports/OpenACS 4.6-final

Collapse
Posted by Andrei Popov on
> After these changes all is good with the follwoing setup:
> FreeBSD 5.0-CURRENT/postgresql-devel (7.3.1) from 
> ports/OpenACS 4.6-final

Should read:

After these changes all is good with the follwoing setup: FreeBSD 5.0-CURRENT/postgresql-devel (7.3.1) from ports/AOLserver 3.5.1/OpenACS 4.6-final

When compiling AOLserver, make sure that you compile Tcl of your choice with --enable-threads (I had to manually alter Makefile).

Collapse
Posted by tammy m on
Hi

Just a note to let everyone know that I got to the final install page of the OACS today. I had only a couple errors in the process. Not sure yet how badly they affect the use of OACS since I'm going to lunch before playing any further. I'm happy about the install now and don't want to bum myself out before lunch!

Anyway, I have the cvs head of the 4.6 branch ( I think! I checked it out with "cvs -z3 -d :pserver:mailto:anonymous@openacs.org/cvsroot co openacs4" this morning (Jan 20).
I'm running postgres 7.3.1 on redhat linux 7.3 (with a later kernel).

The 2 errors I saw in my error log (didn't show up on any of the OACS install screens) were:

This one during the install screens somewhere:
[20/Jan/2003:11:54:51][22490.2051][-sched-] Notice: Running scheduled proc
search_indexer...
[20/Jan/2003:11:54:51][22490.2051][-sched-] Error: invalid command name
"search_indexer"
invalid command name "search_indexer"
    while executing
"search_indexer"
    ("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 f 60 search_indexer {} 1043092011 0 t}"

This one after I restarted the server:
[20/Jan/2003:11:58:26][22552.2051][-sched-] Error:
lang::catalog::import_from_files - The import of file
/www/nsroot/myhost/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml
failed, error message is:

invalid command name "ns_charsets"

stack trace:

invalid command name "ns_charsets"
    while executing
"ns_charsets"
    (procedure "default_charset_if_unsupported" line 2)
    invoked from within
"default_charset_if_unsupported $msg_encoding"
    (procedure "read_file" line 7)
    invoked from within
"read_file $file_path"
    (procedure "import_messages_from_file" line 6)
    invoked from within
"import_messages_from_file $file_path"

This last error occurred for multiple language packages.

Thanks for all the help:)
        t

Collapse
Posted by Lamar Owen on
Tammy: That would be the CVS HEAD you checked out, which is probably going to become 4.7.  To get 4.6 you need to specify the tag on the cvs checkout command line:

(omitting the -d cvsroot location -- add it back in for this to work)
cvs co -r oacs-4-6  (I think that's the right tag, but it may not be)

Without the -r option you get the CVS development HEAD, whatever version that happens to be.

Andrei: Regarding the ACS=1 information.  That is correct; I had not thought of the fact that OpenACS would say 'you need to update' instead of 'your PostgreSQL driver doesn't contain the extra functionality required by OpenACS'.

Collapse
Posted by Andrei Popov on
> Andrei: Regarding the ACS=1 information.  That is correct;
> I had not thought of the fact that OpenACS would say
> 'you need to update' instead of 'your PostgreSQL driver
> doesn't contain the extra functionality required by
> OpenACS'.
So, maybe the following change should be applied, what do you say?
--- packages/acs-bootstrap-installer/db-init-checks-postgresql.tcl.org  2003-01-22 12:11:48.000000000 +0100
+++ packages/acs-bootstrap-installer/db-init-checks-postgresql.tcl      2003-01-22 12:08:56.000000000 +0100
@@ -41,7 +41,7 @@
     }

     if { [catch { ns_pg_bind 1row $db "select count(*) from pg_class" }] } {
-        append my_errors "<li>Your Postgres driver is too old.  You need to update\."
+        append my_errors "<li>Your PostgreSQL driver was not compiled with OpenACS support.  Please recompile it with <tt>ACS=1</tt>.\n"
         set my_error_p 1
     }
Collapse
Posted by Lamar Owen on
I would append "or update to a later version." to your line, which otherwise is fine by me.  Who's going to apply this or approve it to be applied?  Roberto?  Don?