Forum OpenACS Q&A: Errors running static-pages package

Collapse
Posted by Walter Smith on
Hi. I'm trying to install and run the static-pages package on OpenACS 5.2.0b9/Postgres. The package installs, seemingly without any errors, but when I try to visit the user/admin pages I get an error.

It seems to me that there's a problem with one of the PL/pgSQL procedures, possibly a minor one, but unfortunately I'm not familiar enough with the syntax to figure it out on my own. I reinstalled a couple times on separate OACS instances and tried a couple code edits, all with the same results.

Here's the error I'm getting:

Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR:  function content_folder__new(character varying, character varying, text, integer, integer, integer, timestamp with time zone, integer, character varying, "unknown") is not unique
HINT:  Could not choose a best candidate function. You may need to add explicit type casts.
CONTEXT:  PL/pgSQL function "static_page__new_folder" line 30 at assignment
PL/pgSQL function "static_page__get_root_folder" line 17 at assignment

SQL: 
                select static_page__get_root_folder('562');
      
    while executing
"ns_pg_bind 0or1row nsdb0 {
                select static_page__get_root_folder(:package_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
"if {[regexp -nocase -- {^\s*select} $test_sql match]} {
                # ns_log Debug "PLPGSQL: bypassed anon function"
                set selection..."
    ("uplevel" body line 6)
    invoked from within
"uplevel 1 $code_block "
    invoked from within
"db_with_handle -dbn $dbn db {
            # plsql calls that are simple selects bypass the plpgsql 
            # mechanism for creating anonymous fun..."
    (procedure "db_exec_plsql" line 57)
    invoked from within
"db_exec_plsql get_root_folder_id {
	begin
	    :1 := static_page.get_root_folder(:package_id);
	end;
    }"
    (procedure "sp_root_folder_id" line 5)
    invoked from within
"sp_root_folder_id [ad_conn package_id]"
    invoked from within
"set root_folder_id [sp_root_folder_id [ad_conn package_id]]"
    ("uplevel" body line 18)
    invoked from within
"uplevel {
    	  # packages/static-pages/www/admin/index.tcl
ad_page_contract {
    Main admin page for static-pages.

There's more error text, but I thought that covered the relevant portion. Please let me know if it would help to see the rest of the message.

Thanks!!
Walter

Collapse
Posted by Malte Sussdorff on
If you did this through an upgrade make sure to upgrade to the absolutely latest content-repository, alternatively reload in SQL the sql/postgresql/content-item.sql and sql/postgresql/content-folder.sql
Collapse
Posted by Walter Smith on
Thanks, Malte. This is based on a fresh install of recent code.

On one of the instances I'm using OpenACS 5.2.0b9 taken from HEAD on 12/02/2005, and on the other I'm using the tarball for "OpenACS 5.2.0 Release Candidate 3" downloaded on 12/06/2005. Is that current enough, or is it possible that I need to refresh?

From what I can decipher of the error message it seems to me as though the PL/pgSQL function "static_page__new_folder" is defined multiple times and that the call to it results in an ambiguous reference. I wish I knew PL/pgSQL better.

Collapse
Posted by Malte Sussdorff on
Out of my league, ask DaveB :). I only realized that some content_folder__new version where missing in an upgrade.
Collapse
Posted by Dave Bauer on
There are two 10 parameter versions of content_folder__new.

I changed the call in static_folder__new to specify boolean as the datatype of the 10th parameter to help postgresql pick the right function.

New static-page-pb.sql and upgrade script added on oacs-5-2 branch.

Collapse
Posted by Walter Smith on
Got it. Thanks.