Forum OpenACS Development: unable to access

Collapse
Posted by Iuri Sampaio on
I tried to change the template of mainsite to the old tabbed and now i am not able to access any page because of an API error.

I see 2 solutions. Those are very critical

1. do a new fresh install and never select old tabbed anymore.

2. use the latest database dump. set down aolserver, dropdb, createdb, import db "psql -f..." and restart aolserver.

3. go through the code "ARRRGGG" and fix the problem.

How do i fix it?

[06/May/2009:18:33:42][19682.3040766896][-conn:openacs::0] Error: rp_report_error: Error rendering error page (!)
invalid command name "subsite::portal_navbar"
while executing
"subsite::portal_navbar"
invoked from within
"set navbar [subsite::portal_navbar]"
("uplevel" body line 156)
invoked from within
"uplevel {
# Expects properties:
# doc(title)
# focus
# head
# section
# subnavbar_link
#
# Allowed properties
# skip_link, href of link to..."
(procedure "code::tcl::/web/openacs/packages/acs-subsite/www/group-maste..." 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"
invoked from within
"template::adp_parse $__adp_master [concat [list __adp_slave $__adp_output] [array get __adp_properties]]"
invoked from within
"template::adp_parse /web/openacs/packages/acs-tcl/lib/page-error {stacktrace invalid\ command\ name\ \"subsite::portal_navbar\"\n\ \ \ \ while\ execut..."
("uplevel" body line 1)
invoked from within
"uplevel [list template::adp_parse [template::util::url_to_file $template [ad_conn file]] $template_params]"
(procedure "ad_parse_template" line 15)
invoked from within
"ad_parse_template -params $params "/packages/acs-tcl/lib/page-error""
invoked from within
"set rendered_page [ad_parse_template -params $params "/packages/acs-tcl/lib/page-error"]"
("uplevel" body line 2)
invoked from within
"uplevel $body "

Collapse
2: Re: unable to access (response to 1)
Posted by Iuri Sampaio on
someone left trash code in the current cvs repo

go to packages/acs-subsite/www/group-master.tcl
and coment out very last line

#set navbar [subsite::portal_navbar]

Collapse
3: Re: unable to access (response to 2)
Posted by Iuri Sampaio on
the same happened when i tried to add an element in the parameters of mainsite and wrongly put a extra space char

Now i can not access any page of the site

how do i fix that?

[06/May/2009:18:57:21][19682.3038661552][-conn:openacs::2] Error: rp_report_error: Error rendering error page (!)
list must have an even number of elements
while executing
"array set section_a $section_spec"
(procedure "subsite_navigation::define_pageflow" line 25)
invoked from within
"subsite_navigation::define_pageflow -navigation_multirow navigation -group main -subgroup sub -show_applications_p [parameter::get -package_id [ad_co..."
("uplevel" body line 4)
invoked from within
"uplevel {
# Set the tabs then use the plain master to render the page.

subsite_navigation::define_pageflow -navigation_multirow navigation -group mai..."
(procedure "code::tcl::/web/openacs/packages/openacs-default-theme/lib/t..." 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"
invoked from within
"template::adp_parse $__adp_master [concat [list __adp_slave $__adp_output] [array get __adp_properties]]"
invoked from within
"template::adp_parse /web/openacs/packages/acs-tcl/lib/page-error {stacktrace list\ must\ have\ an\ even\ number\ of\ elements\n\ \ \ \ while\ executin..."
("uplevel" body line 1)
invoked from within
"uplevel [list template::adp_parse [template::util::url_to_file $template [ad_conn file]] $template_params]"
(procedure "ad_parse_template" line 15)
invoked from within
"ad_parse_template -params $params "/packages/acs-tcl/lib/page-error""
invoked from within
"set rendered_page [ad_parse_template -params $params "/packages/acs-tcl/lib/page-error"]"
("uplevel" body line 2)
invoked from within
"uplevel $body "
[06/May/2009:18:57:21][19682.3038661552][-conn:openacs::2] Error: GET http://iurix.com:8090/?
referred by "http://iurix.com:8090/admin/configure";
list must have an even number of elements
while executing
"array set section_a $section_spec"
(procedure "subsite_navigation::define_pageflow" line 25)
invoked from within
"subsite_navigation::define_pageflow -navigation_multirow navigation -group main -subgroup sub -show_applications_p [parameter::get -package_id [ad_co..."
("uplevel" body line 4)
invoked from within
"uplevel {
# Set the tabs then use the plain master to render the page.

subsite_navigation::define_pageflow -navigation_multirow navigation -group mai..."
(procedure "code::tcl::/web/openacs/packages/openacs-default-theme/lib/t..." 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"
invoked from within
"template::adp_parse $__adp_master [concat [list __adp_slave $__adp_output] [array get __adp_properties]]"
invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
(procedure "adp_parse_ad_conn_file" line 6)
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/[ad_conn extra_url]""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
rp_serve_abstract_file "$root/[ad_conn extra_url]"
set tcl_url2file([ad_conn url]) [ad_conn file]
set tcl..."

Collapse
4: Re: unable to access (response to 1)
Posted by Dave Bauer on
You always have the option to use psql to edit the parameters directly in the database, then restart AOLserver. Much less drastic than reinstalling.
Collapse
5: Re: unable to access (response to 4)
Posted by Iuri Sampaio on
Thanks dave,

I found my way out debugging the API related.

file /packages/acs-subsite/tcl/subsite-navigation-procs.tcl
line 79. there was an assignment:

array set section_a $section_spec

i just put an if statement and the TCL command lrange does the magic

if { [llength $section_spec] eq 3 } {
set section_spec [lrange $section_spec 0 end-1]
}

Then i got back access to the pages. Change the mistyped space. and then of course removed the paliative code.

To use psql i should know very good openacs core datamodel. otherwise i would be lost looking for where that parameter is storaged. One day i will know it, from the top of my head!!

thanks

Collapse
6: Re: unable to access (response to 1)
Posted by Dave Bauer on
Your fix shows that the code is not tolerant of an error in the parameter, but hard coding a "3" in there doesn't help anyone who makes a slightly different mistake.

I am not sure of the exact code that would handle any errors, perhaps Don can take a look.

Collapse
7: Re: unable to access (response to 6)
Posted by Iuri Sampaio on
Yes i know!
as i said what i did was a paliative to solve my specific problem. get access to the system.

Even more, when i was coding i put many "ns_log Notice" and i realized that the API is called many times not only to read that specific mainsite parameter.

But the thing is all the times that the API is called the list has to be even size. That's why my if statement fix the problem and didn't affect other situations and contexts. It fix errors in the list with odd elements

for reference, if Don wants to find the bug it is located at:

file /packages/acs-subsite/tcl/subsite-navigation-procs.tcl
line 70