Forum OpenACS Development: Re: 5.0 upgrade process requires Tcl Calls

Collapse
Posted by Hazi Gharagozlou on
While upgrading a 4.6.3 oracle site to 5.0b4 I found the following ordre of upgrade scripts work best.
-- kernel

@acs-kernel/sql/oracle/upgrade/upgrade-4.6.3-4.6.4.sql;
@acs-kernel/sql/oracle/upgrade/upgrade-4.6.4-4.6.5.sql;
@acs-kernel/sql/oracle/upgrade/upgrade-4.6.5-4.6.6.sql;
@acs-kernel/sql/oracle/upgrade/upgrade-4.7d-4.7.2d.sql;
@acs-kernel/sql/oracle/upgrade/upgrade-4.7.2d-5.0d.sql;
@acs-kernel/sql/oracle/upgrade/upgrade-5.0d-5.0d2.sql;
@acs-kernel/sql/oracle/upgrade/upgrade-5.0d2-5.0d3.sql;
@acs-kernel/sql/oracle/upgrade/upgrade-5.0d6-5.0d7.sql;
@acs-kernel/sql/oracle/upgrade/upgrade-5.0d7-5.0d9.sql;
@acs-kernel/sql/oracle/upgrade/upgrade-5.0d9-5.0d13.sql
@acs-kernel/sql/oracle/upgrade/upgrade-5.0.0b1-5.0.0b2.sql;
@acs-kernel/sql/oracle/upgrade/upgrade-5.0.0b2-5.0.0b3.sql;
@acs-kernel/sql/oracle/upgrade/upgrade-5.0.0b3-5.0.0b4.sql;

-- Service Contract

@acs-service-contract/sql/oracle/upgrade/upgrade-4.5-4.5.1.sql;
@acs-service-contract/sql/oracle/upgrade/upgrade-4.5.1-4.6.sql
@acs-service-contract/sql/oracle/upgrade/upgrade-4.7d2-4.7d3.sql;
@acs-service-contract/sql/oracle/upgrade/upgrade-4.7d3-5.0d1.sql;

-- Acs Authentication

@acs-authentication/sql/oracle/acs-authentication-create.sql

-- Acs Lang
@acs-lang/sql/oracle/acs-lang-create.sql

Collapse
Posted by Vinod Kurup on
Hazi,

Did you also load upgrade-5.0.0a1-5.0.0a2.sql? It's important, as mentioned in my post above, but it can be loaded out-of-order, if needed.

Collapse
Posted by Joel Aufrecht on
I renamed this thread to be more accurate.
Collapse
Posted by Joel Aufrecht on
I put in another 20 hours this weekend, and managed to get my personal site to a workably 5.0 condition.  A fair amount of that time was wrestling with CVS branches and merging and whatnot.  In the two months that I've been working on it, I've repeated some steps of the process up to 20 or 30 times, so I finally caved and wrote up a script to make trial and error debugging easier.  I put it in /contrib/misc - it does most of the steps that I'm aware of in a basic upgrade.  http://cvs.openacs.org/cvs/openacs-4/contrib/misc/upgrade_4.6_to_5.0.sh?only_with_tag=HEAD
Collapse
Posted by Carl Robert Blesius on

I put some time aside this weekend to do the 4.6.3 -> 5.0.0 upgrade on my peronal site. I got pretty far (note to anyone else atempting this: look at and use the script -> upgrade with documentation alone does not work at all).

Was able to get through a lot of errors, but not this one: When I try to login (step 8: If you can login, visit /acs-admin/apm and upgrade acs-kernel and acs-service-contract and uncheck the data model scripts) I get a request error and this is was the error.log says:

[21/Mar/2004:09:04:39][30040.5126][-conn2-] Error: GET http://blesius.org/register/?return%5furl=%2f
referred by "http://blesius.org/"
no value given for parameter "key" to "_"
    while executing
"_ acs-subsite.Log_In"
    invoked from within
"list [_ acs-subsite.Log_In] ok"
    invoked from within
"list [list [_ acs-subsite.Log_In] ok]"
    invoked from within
"set login_button [list [list [_ acs-subsite.Log_In] ok]]"
    ("uplevel" body line 77)
    invoked from within
"uplevel {
          # Present a login box
#
# Expects:
#   subsite_id - optional, defaults to nearest subsite
#   return_url - optional, defaults to Your..."
    (procedure "code::tcl::/web/crb/packages/acs-subsite/lib/login" line 2)
    invoked from within
"code::tcl::$__adp_stub"
    invoked from within
"if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init tcl $__adp_stub
..."
    ("uplevel" body line 3)
    invoked from within
"uplevel {

    if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init t..."
    (procedure "adp_prepare" line 2)
    invoked from within
"adp_prepare "
    (procedure "template::adp_parse" line 30)
    invoked from within
"template::adp_parse [template::util::url_to_file "/packages/acs-subsite/lib/login" "$__adp_stub"] [list return_url "${return_url}" no_frame_p "1" auth..."
    invoked from within
"append __adp_output [template::adp_parse [template::util::url_to_file "/packages/acs-subsite/lib/login" "$__adp_stub"] [list return_url "${return_url}..."
    ("uplevel" body line 17)
    invoked from within
"uplevel {
          set __adp_output ""

    set __adp_master [template::util::url_to_file "[ad_parameter -package_id [ad_conn subsite_id] DefaultMaster ..."
    (procedure "template::code::adp::/web/crb/packages/acs-subsite/www/regis..." line 2)
    invoked from within
"template::code::${template_extension}::$__adp_stub"
    (procedure "template::adp_parse" line 68)
    invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
    (procedure "adp_parse_ad_conn_file" line 7)
    invoked from within
"$handler"
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
                $handler
            } ad_script_abort val {
                # do nothing
            }"
    invoked from within
"rp_serve_concrete_file [ad_conn file]"
    (procedure "rp_serve_abstract_file" line 60)
    invoked from within
"rp_serve_abstract_file "$root/$path""
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
        rp_serve_abstract_file "$root/$path"
        set tcl_url2file([ad_conn url]) [ad_conn file]
        set tcl_url2path_info([ad_conn url]) [ad_conn path_inf..."

Suggestions?

Collapse
Posted by Malte Sussdorff on
This looks like an acs-lang problem. Visit http://yoursite.com/acs-lang/admin/load-catalog-files before loging in for the first time to load the keys.
Collapse
Posted by Carl Robert Blesius on

It is hard to visit /acs-lang/admin/load-catalog-files when I can not login.

I already tried what Robert mentioned above (loading /foo.tcl with lang::catalog::import -locales [list "en_US"] in it).

Just to make sure I removed the "-locales [list "en_US"]" part so it more closely resembles /acs-lang/admin/load-catalog-files and tried it again. No luck, same error on registration.

Collapse
Posted by Jeff Davis on
you could do something like this
rename _ original_
proc _ {{key {}}} {
  if {[string is space $key]} { 
     return NULL_KEY
  }
  return [original_ $key]
}
in a file like SERVERROOT/tcl/zz-hack.tcl. That should allow you to at least log in.
Collapse
Posted by Jeff Davis on
actually, I guess you would have to handle the substitution variables as well (I should have looked at the proc before I
wrote that I guess).
Collapse
Posted by Malte Sussdorff on
I know this is a horible security risk, but find out your user_id and login using a page which uses "ad_user_login -forever=0 $user_id" to log you into the system. Maybe this can help your loging in problem.
Collapse
Posted by Carl Robert Blesius on

Thanks, but I aborted the upgrade and restored from backups.

Going to put the two postgres versions up on different ports in parallel so I can tool with it as I have time.

Here is an improved script from Jeff (for posterity)

rename _ original_
proc _ {{key {}} {vars {}}} {
  if {[string is space $key]} {
    return NULL_KEY
  }
    return [uplevel [list original_ $key $vars]]
}

Round two, coming soon to a forum near you.