Forum OpenACS Q&A: acs-subsite upgrade (4.6.2->5.2)

I am trying to get a crusty 4.6.2 site running on the 5.2 branch and I am close after a lot of trial, a bunch of errors, and a bit of help (thanks daveb).

Now I am having an issue with acs-subsite (4.6.3) upgrade to 5.2.0a5 using the APM (relevant error log snip pasted below). After the APM upgrade failed I was able to load the sql files by hand without error and deactivated them on the second upgrade attempt in the APM (that reflex was hard to hold back after manually going through 44 content repository data model upgrades to get past errors I had using the APM -- a wonderful way to get a feel for the painful path from 4.6.x to 5.2 btw)

Any tips?
This seems to be the core of the problem (based on the error message):
"Selection did not return a value, and no default was provided"?

=========================================
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: <h3>Installing Subsite 5.2.0a5</h3>
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/apm-callback-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/apm-callback-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/application-group-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/application-group-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/approval-expiration-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/approval-expiration-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/attribute-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/attribute-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/callback-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/callback-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/email-image-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/email-image-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/group-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/group-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/group-type-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/group-type-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/package-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/package-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/party-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/party-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/plpgsql-utility-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/plpgsql-utility-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/plsql-utility-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/plsql-utility-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/rel-segments-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/rel-segments-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/rel-types-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/rel-types-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/relation-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/relation-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/subsite-callback-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/subsite-callback-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loading packages/acs-subsite/tcl/subsite-procs.tcl...
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: Loaded packages/acs-subsite/tcl/subsite-procs.tcl.
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Notice: apm_invoke_callback_proc: invoking callback before-upgrade with command subsite::before_upgrade -from_version_name 4.6.3 -to_version_name 5.2.0a5
[17/Oct/2005:03:14:45][8820.98311][-conn:crb::3] Error: apm_package_install: Error installing Subsite version 5.2.0a5: Selection did not return a value, and no default was provided
Selection did not return a value, and no default was provided
while executing
"db_string select_parameter_id {
select parameter_id
from apm_parameters
where package_key = :package_key
..."
(procedure "apm_parameter_unregister" line 4)
invoked from within
"apm_parameter_unregister -package_key acs-subsite -parameter ApprovalExpirationDays {}"
("uplevel" body line 12)
invoked from within
"uplevel $chunks($key)"
(procedure "apm_upgrade_logic" line 19)
invoked from within
"apm_upgrade_logic -from_version_name $from_version_name -to_version_name $to_version_name -spec {
5.0d3 5.0d4 {
array s..."
(procedure "subsite::before_upgrade" line 3)
invoked from within
"subsite::before_upgrade -from_version_name 4.6.3 -to_version_name 5.2.0a5"
("eval" body line 1)
invoked from within
"eval $command"
(procedure "apm_invoke_callback_proc" line 37)
invoked from within
"apm_invoke_callback_proc -proc_name $callbacks(before-upgrade) -version_id $version_id -type before-upgrade -arg_list [list from_version_name $upg..."
invoked from within
"if {$upgrade_p} {
# Run before-upgrade
if {[info exists callbacks(before-upgrade)]} {
apm_invoke_callback_proc..."
("uplevel" body line 41)
invoked from within
"uplevel $body "
==================================

Collapse
Posted by Dave Bauer on
Carl,

This code in subsite-procs.tcl is the problem


apm_parameter_unregister \
-package_key acs-subsite \
-parameter ApprovalExpirationDays \
{}

apm_parameter_unregister \
-package_key acs-subsite \
-parameter PasswordExpirationDays \
{}
}

I would comment out those to calls in the before_upgrade procedure. Its trying to remove those parameters which must have been added after 4.6.2. Since they don't exist in 5.2.0 the APM never created them for subsite.

I'll look into fixing this upgrade script to only try to remove the parameters if they actually exist, possibly changing apm_parameter_unregister to not fail with a database error if the parameter does not exist.

Collapse
Posted by Carl Robert Blesius on
That worked like a charm Dave. Thanks. This completes acs-core upgrade (phew). The quest continues one package at a time...
Collapse
Posted by Don Baccus on
You could probably just surround the calls in "catch" statements ... dirty but works.