Forum OpenACS Development: Problems installing OpenACS 4.x from scratch

Hi,

  Yesterday I downloaded the latest openacs-4 from the CVS. I had a
quite old version (pre-beta, about a month ago) already installed with
postgres running on another server. I copied the newly downloaded
version 'in stead of' the old to my /web/xxxx directory and started
nsd. I got connected, but had a 'dead' 'Next ->' key. I then adopted
Vinod's openacl-4.tcl.txt file (from old_server, it didn't make it to
the new file-storage as well as his nice install description!). After
restarting nsd I still could get connected, but again with a dead next
key. I noticed here a problem with sysdate being unknown. So I search
for sysdate in both *.sql's and *.tcl's. Couldn't find any creations.
Then I tried a 'select sysdate;' in psql - not found. Then I tried a
'select sysdate from dual;' - great, I got the date. But this really
didn't help me.

  Then I took the big step and started from scratch. Doing dropdb ..,
createdb .., createlang .. .., and then restarted nsd. Now I got a
page telling me I got PostgreSQL driver installed correctly (I think I
already had that in my previous attempts) and needed to install the
datamodel, great. Pushing 'Next ->' gave me the new page: Now
installing the ACS kernel data model... Good, but that's all nothing
happend. Looking in the log, I got:

[16/May/2001:13:51:22][2056.5125][-conn1-] Error: dbinit:
error(ljserv.local.leifjensen.com::leifjensen,ERROR:  Relation
'apm_package_db_types' does not exist
): '
    select case when count(*) = 0 then 0 else 1 end from
apm_package_db_types'
[16/May/2001:13:51:22][2056.5125][-conn1-] Error: Error sourcing
/web/leifjensen/packages/acs-bootstrap-installer/installer/install-data-model.tcl:
Database operation "0or1row" failed (exception NSDB, "Query was not a
statement returning rows.")
    while executing
"ns_pg_bind 0or1row nsdb0 {
    select case when count(*) = 0 then 0 else 1 end from
apm_package_db_types}"
    ("uplevel" body line 1)
    invoked from within
"uplevel 2 [list ns_pg_bind $type $db $sql] $args"
    invoked from within
"db_exec 0or1row $db $full_name $sql"
    invoked from within
"set selection [db_exec 0or1row $db $full_name $sql]"
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $code_block "
    invoked from within
"db_with_handle db {
        set selection [db_exec 0or1row $db $full_name $sql]
    }"
    (procedure "db_string" line 7)
    invoked from within
"db_string db_types_exists "
    select case when count(*) = 0 then 0 else 1 end from
apm_package_db_types""
    invoked from within
"set apm_db_types_exists [db_string db_types_exists "
    select case when count(*) = 0 then 0 else 1 end from
apm_package_db_types"]"
    (file
"/web/leifjensen/packages/acs-bootstrap-installer/installer/install-data-model.tcl"
line 40)
    invoked from within
"source $__file "

  A d in psql gives me 'no relations found'.

  Any ideas ?

Collapse
Posted by hafeez bana on
G'Day,

I have a feeling your installer either can't run psql or that psql needs a password to be used. Go back further in the log file...you may find some other errors.

However in case it is what I suspect - here is the solution -
In sample openacs4-nsd.tcl conf file uncomment the section under /driver/postgres and set pgbin to the relevant directory (I installed postgres in a non standard dir and had to do this as it wasn't in my path). Also if you need to use a password to use psql then you will have to modify the proc, db_source_file, or change postgres access settings in pg_hba_conf to allow you to access pg withouth a password.

Cheers,
Hafeez

Collapse
Posted by Don Baccus on
Yes, currently you can't have password protection on your PG database used for OpenACS 4.  PG's password mechanism and AOLserver's Tcl API don't play well together.

If you just remove the pgbin path as suggested, the copy of PSQL found  on your PATH will be used, so if the PATH is set correctly you'll be in great shape.

I just did a fresh install yesterday with the latest CVS repository contents so I think Hafeez is on the right track.

Collapse
Posted by Leif Jensen on
Yes, thanks it was psql not being able to find the database, which is on another machine. Setting various PGHOST, PGDATABASE, PGxxx fixed that.

  But, alas, it didn't quite finish 😟. After a lot of CREATE and single rows, I got 'Failed to install ACS kernel, version 4.2. ..'. TI have been running on a late PostgreSQL 7.1beta, so I installed the latest 7.1.1 and started all over. This didn't change anything and the log shows:

NOTICE:  identifier "__exec_2_apm_package_version_enable" will be truncated to "__exec_2_apm_package
_version_en"
[16/May/2001:20:38:37][4212.4101][-conn0-] Notice: dbinit: sql(ljserv.local.leifjensen.com::leifjens
en): 'create function __exec_2_apm_package_version_enable () returns varchar as '

        begin
          apm_package_version.enable(
            version_id => ''0''
          );
        end;

                      ' language 'plpgsql''
[16/May/2001:20:38:37][4212.4101][-conn0-] Notice: Querying 'select __exec_2_apm_package_version_ena
ble ();'
NOTICE:  identifier "__exec_2_apm_package_version_enable" will be truncated to "__exec_2_apm_package
_version_en"
[16/May/2001:20:38:37][4212.4101][-conn0-] Error: Ns_PgExec: result status: 7 message: ERROR:  parse
r: parse error at or near "apm_package_version"

[16/May/2001:20:38:37][4212.4101][-conn0-] Error: dbinit: error(ljserv.local.leifjensen.com::leifjen
sen,ERROR:  parser: parse error at or near "apm_package_version"
): 'select __exec_2_apm_package_version_enable ()'
[16/May/2001:20:38:37][4212.4101][-conn0-] Notice: Querying 'drop function __exec_2_apm_package_vers
ion_enable ();'
NOTICE:  identifier "__exec_2_apm_package_version_enable" will be truncated to "__exec_2_apm_package
_version_en"
[16/May/2001:20:38:37][4212.4101][-conn0-] Notice: dbinit: sql(ljserv.local.leifjensen.com::leifjens
en): 'drop function __exec_2_apm_package_version_enable ()'
[16/May/2001:20:38:37][4212.4101][-conn0-] Error: Error sourcing /web/leifjensen/packages/acs-bootst
rap-installer/installer/install-data-model.tcl:
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")
    while executing
"ns_db 0or1row $db "select $function_name ()""
    invoked from within
"db_exec_plpgsql $db $full_statement_name $sql  $statement_name"
    invoked from within
"if {[regexp -nocase -- {^s*select} $test_sql match]} {
            ns_log Notice "PLPGSQL: bypassed anon function"
            set selection [db_exec..."
    ("uplevel" body line 5)
    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 apm_package_version_enable {
        begin
          apm_package_version.enable(
            version_id => :version_id
          );
        end;
    }"
    (procedure "apm_version_enable" line 3)
    invoked from within
"apm_version_enable -callback apm_ns_write_callback [apm_package_install -callback apm_ns_write_call
back "[file join [acs_root_dir] packages acs-kernel..."
    (file "/web/leifjensen/packages/acs-bootstrap-installer/installer/install-data-model.tcl" line 6
3)
    invoked from within
"source $__file "

  Greetings,

Collapse
Posted by Don Baccus on
Does the file packages/acs-tcl/tcl/apm-install-procs-postgresql.xql exist and if so is it up to date?

I assume you have nsxml installed to be getting as far as you are...

Collapse
Posted by hafeez bana on
Just to be sure you may want to check that you have added the plpgsql language to the db. Cheers,Hafeez
Collapse
Posted by Don Baccus on
The "create function" would've failed if plpgsql wasn't created ... I think, at least!

Actually, you can see that the PG version of the OpenACS 4 database API is creating the function with the wrong (Oracle) contents, which is why I know that the query dispatcher is hosed.  Either the .xql files aren't being parsed correctly (thus my nsxml comment) or the .xql files aren't there.

Or ???  I'm out of guesses at the moment.

Collapse
Posted by Leif Jensen on
<blockquote> Does the file packages/acs-tcl/tcl/apm-install-procs-postgresql.xql > exist and
if so is it up to date?
</blockquote>

  Yes, it does exists and I suppose it is up to date since I downloaded it from the CVS just the day before yesterday.

<blockquote> I assume you have nsxml installed to be getting as far as you are...
</blockquote>

  Yes, but I haven't updated it resently. (From where I got it, it was named ns_xml.so !!??)

  I do have plpgsql installed, and yes Don I wouldn't have gotten this far, I forgot it in one of my previous attempts 😟.

  I had a look back in the log and verified that PostgreSQL was loaded OK, Module nsxml was loaded OK. But I also noticed:
[16/May/2001:14:33:38][2080.1024][-main-] Notice: Loading packages/acs-tcl/tcl/00-database-procs-pos
tgresql.tcl...
[16/May/2001:14:33:38][2080.1024][-main-] Notice: Loading packages/acs-tcl/tcl/00-database-procs.tcl
...
[16/May/2001:14:33:38][2080.1024][-main-] Notice: Loading packages/acs-tcl/tcl/00-proc-procs.tcl...
[16/May/2001:14:33:38][2080.1024][-main-] Notice: Multiple definition of proc_doc in /web/leifjensen
/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl and /web/leifjensen/packages/acs-tcl/tcl/00-
proc-procs.tcl
[16/May/2001:14:33:38][2080.1024][-main-] Notice: Multiple definition of ad_proc in /web/leifjensen/
packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl and /web/leifjensen/packages/acs-tcl/tcl/00-p
roc-procs.tcl
[16/May/2001:14:33:38][2080.1024][-main-] Notice: Multiple definition of ad_arg_parser in /web/leifj
ensen/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl and /web/leifjensen/packages/acs-tcl/tc
l/00-proc-procs.tcl

  which goes on and on. What does this mean?

  I had a look in the database and there was no apm_package_... functions nor tables!

  Any ideas,

Collapse
Posted by Don Baccus on
Well, if the apm package table's not there you're not going to end up with a running system.  I thought you said that PSQL successfully ran and created everything???  Are you sure you're doing this all in the same database?
Collapse
Posted by Leif Jensen on
That's the only one I have after installing PostgreSQL 7.1.1 !