Forum OpenACS Development: Can't login after upgrading to 5.5

Hi,

I guess it's related to TIP #125 (http://www.openacs.org/forums/message-view?message_id=1839775).

I've upgraded the files from 5.4 to 5.5 on my dev server then went to the browser to upgrade the packages but I wasn't logged in and got an error when redirected to the login page:

[23/Oct/2008:13:16:13][17933.2954899456][-conn:openacs-head::0] Error: Error in include template "/var/www/openacs-head/packages/acs-subsite/lib/login": Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR: column "search_impl_id" does not exist
LINE 7: search_impl_id,
^

SQL:
select help_contact_text,
help_contact_text_format,
get_doc_impl_id,
change_pwd_url,
register_impl_id,
search_impl_id,
forgotten_pwd_url,
batch_sync_enabled_p,
register_url,
short_name,
pretty_name,
pwd_impl_id,
process_doc_impl_id,
enabled_p,
sort_order,
allow_user_entered_info_p,
authority_id,
user_info_impl_id,
auth_impl_id,
(select impl_pretty_name from acs_sc_impls where impl_id = auth_impl_id) as auth_impl_name,
(select impl_pretty_name from acs_sc_impls where impl_id = pwd_impl_id) as pwd_impl_name,
(select impl_pretty_name from acs_sc_impls where impl_id = register_impl_id) as register_impl_name,
(select impl_pretty_name from acs_sc_impls where impl_id = user_info_impl_id) as user_info_impl_name,
(select impl_pretty_name from acs_sc_impls where impl_id = search_impl_id) as search_impl_name,
(select impl_pretty_name from acs_sc_impls where impl_id = get_doc_impl_id) as get_doc_impl_name,
(select impl_pretty_name from acs_sc_impls where impl_id = process_doc_impl_id) as process_doc_impl_name
from auth_authorities
where authority_id = '9'

while executing
"ns_pg_bind 0or1row nsdb0 {
select help_contact_text,
help_contact_text_format,
get_doc_impl_id,
..."
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql]"
("postgresql" arm line 2)
invoked from within
"switch $driverkey {
oracle {
return [uplevel $ulevel [list ns_ora $type $db $sql] $args]
}
..."
invoked from within
"db_exec 0or1row $db $full_statement_name $sql"
invoked from within
"set selection [db_exec 0or1row $db $full_statement_name $sql]"
("uplevel" body line 2)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle -dbn $dbn db {
set selection [db_exec 0or1row $db $full_statement_name $sql]
}"
(procedure "db_0or1row" line 50)
invoked from within
"db_0or1row select_authority {
select help_contact_text,
help_contact_text_format,
get_doc_impl_id,
..."
("uplevel" body line 1)
invoked from within
"uplevel db_0or1row $args"
(procedure "db_1row" line 2)
invoked from within
"db_1row select_authority "
select [join $columns ",\n "]
from auth_authorities
where authorit..."
(procedure "auth::authority::get_not_cached" line 12)
invoked from within
"auth::authority::get_not_cached 9"
("eval" body line 1)
invoked from within
"eval $script"
invoked from within
"ns_cache eval util_memoize $script {
list $current_time [eval $script]
}"
(procedure "util_memoize" line 20)
invoked from within
"util_memoize [list auth::authority::get_not_cached $authority_id]"
(procedure "auth::authority::get" line 5)
invoked from within
"auth::authority::get -authority_id $authority_id -array authority"
(procedure "auth::get_register_authority" line 10)
invoked from within
"auth::get_register_authority"
("uplevel" body line 1)
(procedure "code::tcl::/var/www/openacs-head/packages/acs-subs..." line 1)
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"
invoked from within
"template::adp_parse [template::util::url_to_file "[ad_quotehtml [lang::util::localize ${login_template}]]" "$__adp_stub"] [list return_url "[lang::uti..."

Collapse
Posted by Dave Bauer on
Cool :)

This happens anytime we modify acs-auth. Its fundamentally broken. I guess we need some sort of init file or something that upgrades it for you.

Anyone have a better idea?

Collapse
Posted by Don Baccus on
Why can't you write a proper APM upgrade file to add the column to the table and fill it in?
Collapse
Posted by Don Baccus on
I see, you're not logged in so can't upgrade.

So a smart init file makes sense, I guess.

We can't release with it in the current state, though, that's for sure.

Collapse
Posted by Emmanuelle Raffenne on
Dave,

I have no better idea. An init file is the only option I can think of.

Collapse
Posted by Gustaf Neumann on
Another option is to make the query (queries) version dependent. This means to have both the old- and new-style queries in the code and use the right one depending on the version. Hopefully, apm does not think it as already upgraded; in the worst case, one has to check the db schema whether the column exists already.