Forum OpenACS Development: Re: Errors Upgrading from 5.5 to 5.6 (function apm__register_parameter)

hi Cesareo,

i tried to reconstruct the problem, installed OpenACS 5.5.0 on PG 8.4.1 and redid the steps above. The problem on your installation seems to be the upgrade from OpenACS 5.5* to OpenACS 5.6.0 (so i altered the subject line accordingly).

What I did was in detail:

- install openacs-5.5.0.tgz on pg 8.4.1, using a database named oacs-5-5
- do upgrade from repository
-> offers 5.5.1
-> select all
-> install fine -> we are now at 5.5.1, can check that on acs-admin/apm

The steps above are probably irrelevant for the problem, but repeat, what you described in your posting. Now it becomes more interesting:

- download "OpenACS 5.6.0 Final" and expand to /usr/local/openacs-5.6.0
- changed permission in this dir according to server permissions
- set siteroot of the server startup script using oacs-5-5 DB to /usr/local/openacs-5.6.0
- restart server
- browse to acs-admin/apm/packages-install
- check all boxes -> install

Now data model upgrade will happen. I see then:

Select what data files to load for Kernel 5.6.0

sql/postgresql/upgrade/upgrade-5.6.0d1-5.6.0d2.sql Data model upgrade
sql/postgresql/upgrade/upgrade-5.6.0d2-5.6.0d3.sql Data model upgrade
sql/postgresql/upgrade/upgrade-5.6.0d3-5.6.0d4.sql Data model upgrade
sql/postgresql/upgrade/upgrade-5.6.0d4-5.6.0d5.sql Data model upgrade
sql/postgresql/upgrade/upgrade-5.6.0d5-5.6.0d6.sql Data model upgrade
sql/postgresql/upgrade/upgrade-5.6.0d6-5.6.0d7.sql Data model upgrade
sql/postgresql/upgrade/upgrade-5.6.0d7-5.6.0d8.sql Data model upgrade
sql/postgresql/upgrade/upgrade-5.6.0b1-5.6.0b2.sql Data model upgrade
sql/postgresql/upgrade/upgrade-5.6.0b2-5.6.0b3.sql Data model upgrade

and others. When i click on "install packages", everything works fine. All OpenAcs 5.6.0 packages are installed, including acs-tcl, where you seem to have problem.

When double-checking in the database, i see

% /usr/local/pg841/bin/psql -U nsadmin oacs-5-5
psql (8.4.1)
Type "help" for help.

oacs-5-5=# \df apm__register_parameter
List of functions
Schema | Name | Result data type | Argument data types | Type
--------+-------------------------+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+--------
public | apm__register_parameter | integer | integer, character varying, character varying, character varying, character varying, character varying, character varying, character varying, integer, integer | normal
public | apm__register_parameter | integer | integer, character varying, character varying, character varying, character varying, character varying, character varying, integer, integer | normal
(2 rows)

so, apm__register_parameter/10 is installed correctly, no problems are reported.
The "critical" part is above where the data model upgrade happens. Please check, where our install paths divert.

all the best
-gustaf neumann

Hi Gustaf

It seems to be a problem with my DB. I did what you described:
- Upgrade to 5.5.1 via "Upgrade from Repository" (OK)
- Download 5.6.0 and "file system fresh install" (We differ previously in this step)
Kernel 5.6.0 install FINE (either "file system fresh install" or my previously "overwrite file system") but, definetily apm__register_parameter doesn't install
- And "same problem appears"

I'll check DB and it doesn't appear (I mean, it has to be 2 rows)

openacs-dev=# \df apm__register_parameter;
\df apm__register_parameter;
List of functions
Schema | Name | Result data type | Argument data types | Type
--------+-------------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------+--------
public | apm__register_parameter | integer | integer, character varying, character varying, character varying, character varying, character varying, character varying, integer, integer | normal
(1 row)

So, it has to be something with "my data".

I did also "force" via "manual". I mean:
psql -f $SERVER_ROOT/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d6-5.6.0d7.sql

And it worked:

ALTER TABLE
BEGIN
acs_attribute__create_attribute
---------------------------------
238
(1 row)

COMMIT
DROP FUNCTION
DROP FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION

And apm_register_parameter was installed:

\df apm__register_parameter;
List of functions
Schema | Name | Result data type | Argument data types | Type
--------+-------------------------+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+--------
public | apm__register_parameter | integer | integer, character varying, character varying, character varying, character varying, character varying, character varying, character varying, integer, integer | normal
public | apm__register_parameter | integer | integer, character varying, character varying, character varying, character varying, character varying, character varying, integer, integer | normal
(2 rows)

Now, If I install acs-tcl everything seems to be fine. But I stopped here, to finde a "general solution" as we've seen before.

i repeat the question asked already several times: during the "Kernel 5.6.0 install", does the system load the upgrade scripts? you have not answered this question so far... my guess is, that it does not. but why? can it be that you have during the "upgrade" to 5.6.0 a database that believes that it is on the 5.6 level? what is the version number of the kernel (from acs-admin/apm) before you run the upgrade to 5.6.0?

Of course, the manual upgrade works. this is, what i have already at the begin of the thread [1]

all the best
-gustaf neumann

[1] http://www.openacs.org/forums/message-view?message_id=4100297

oh! Sorry, definitely NOT. As you said It seems to be that was not loaded. I don't know why.

During upgrade from 5.5.1 (I did that without problem via "Upgrade from Repository" to 5.6 (I did that via "overwrite oacs filesystem" and "fresh oacs filesystem" also).

This is my data:

---- Kernel and TCL versions-----
* Now:
Kernel 5.5.0d6
Tcl Library 5.5.0d2

* After "Upgrade From Repository" (acs-admin/install/install?repository_url=...)
Kernel 5.5.1
Tcl Library 5.5.1

* After "overwrite files from 5.6.0 Full Tar File". I mean: cp -r openacs-5.6.0/* myopenacs
acs-kernel Kernel 5.6.0 (Apperently Worked Fine)

---- Data ----



Installing Kernel 5.6.0

Installing data model for Kernel 5.6.0...
Loading data model /Users/cesareox/Documents/openacs-dev/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d1-5.6.0d2.sql...
Loading data model /Users/cesareox/Documents/openacs-dev/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d2-5.6.0d3.sql...
Loading data model /Users/cesareox/Documents/openacs-dev/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d3-5.6.0d4.sql...
Loading data model /Users/cesareox/Documents/openacs-dev/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d4-5.6.0d5.sql...
Loading data model /Users/cesareox/Documents/openacs-dev/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d5-5.6.0d6.sql...
Loading data model /Users/cesareox/Documents/openacs-dev/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d6-5.6.0d7.sql... Apparently was loaded
Loading data model /Users/cesareox/Documents/openacs-dev/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d7-5.6.0d8.sql...
Loading data model /Users/cesareox/Documents/openacs-dev/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0b1-5.6.0b2.sql...
Loading data model /Users/cesareox/Documents/openacs-dev/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0b2-5.6.0b3.sql...
Installed Kernel, version 5.6.0.

Package enabled.


There is a "side-error" I put it here if can affect. When I was checking Kernel Version (from /acs-admin/), page was broken with this error:

Database operation "0or1row" failed
(exception ERROR, "ERROR: column "scope" does not exist
LINE 5: and scope = 'global';
^
")

while executing
"ns_pg_bind 0or1row nsdb1 {
select count(*)
from apm_parameters
where package_key = :package_key
and scope = 'global'
}"
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql]"

This "side-error" dissappear if I "load manually" upgrade-5.6.0d6-5.6.0d7.sql
Finally I couldn't resolve this. The only option I've found was to load the script containing apm__register_parameter "manually". I mean, doing ...
psql -f packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d6-5.6.0d7.sql

After Kernel 5.6 was installed (it seems to be a problem with my data).

What I did:
1. Upgrade from Repository (5.5.0d6 to 5.5.1) (PG 8.4.17 and Aolserver 4.5)
2. Overwrite from openacs-5.6.0 I mean cp -r openacs-5.6.0/ myopenacs (5.5.1 to 5.6.0)
3. Install from acs-admin/apm/packages-install
Firstly Kernel, then TCL/Authentication/Service Contracts then rest of packages
Errors (after Kernerl Install): apm__register_parameter (so I had to load it manually):
psql -f $SERVER_ROOT/openacs-5.6.0/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d6-5.6.0d7.sql

3. Upgrade from Repository (but everything seems fine)
4. Overwrite from openacs-5.7.0 (cp -r ...)
5. Install from acs-admin/apm/packages-install
Errors: none
5. Upgrade from Repository (but everything seems fine)
6. Overwrite from openacs-5.8.0 (cp -r ...)
7. Install from acs-admin/install/
Error: a minor one[1]

Thanks so much Gustaf for your support (and the big effort throught 5.8)


[1]. I had an error installing from acs-admin/apm/packages-install :
" ...
can't read "pvt_home_url": no such variable
while executing
"set pvt_home_url")
... "

Then I used acs-admin/install/ and everything was fine