Forum OpenACS Development: Error upgrading XoWiki to 5.9.0

Collapse
Posted by Frank Bergmann on
Hi (Gustaf)!

FYI: We upgraded XoWiki from 0.136 to 5.9.0, and got the following error. We're probably going to stick with 0.136 if possible because we did some customizations and upgrade later.

Cheers,
Frank

<h3>Upgrading xowiki 5.9.0</h3>

Upgraded xowiki, version 5.9.0.

Package enabled.Error: Database operation "dml" failed (exception ERROR, "ERROR: column o.tree_sortkey does not exist
LINE 7: ....last_modified, o.modifying_user, o.modifying_ip, o.tree_sor...
^
HINT: Perhaps you meant to reference the column "ci.tree_sortkey".
")

ERROR: column o.tree_sortkey does not exist
LINE 7: ....last_modified, o.modifying_user, o.modifying_ip, o.tree_sor...
^
HINT: Perhaps you meant to reference the column "ci.tree_sortkey".

SQL: create view xowiki_form_instance_item_view AS
SELECT
xi.package_id, xi.parent_id, xi.name,
xi.publish_status, xi.assignee, xi.state, xi.page_template, xi.item_id,
o.object_id, o.object_type, o.title AS object_title, o.context_id,
o.security_inherit_p, o.creation_user, o.creation_date, o.creation_ip,
o.last_modified, o.modifying_user, o.modifying_ip, o.tree_sortkey, o.max_child_sortkey,
cr.revision_id, cr.title, content_revision__get_content(cr.revision_id) AS text,
cr.description, cr.publish_date, cr.mime_type, cr.nls_language,
xowiki_form_page.xowiki_form_page_id,
xowiki_page_instance.page_instance_id,
xowiki_page_instance.instance_attributes,
xowiki_page.page_id,
xowiki_page.page_order,
xowiki_page.creator
FROM
xowiki_form_instance_item_index xi
left join cr_items ci on (ci.item_id = xi.item_id)
left join cr_revisions cr on (cr.revision_id = ci.live_revision)
left join acs_objects o on (o.object_id = ci.live_revision)
left join xowiki_page on (o.object_id = xowiki_page.page_id)
left join xowiki_page_instance on (o.object_id = xowiki_page_instance.page_instance_id)
left join xowiki_form_page on (o.object_id = xowiki_form_page.xowiki_form_page_id)

Database operation &#34;dml&#34; failed (exception ERROR, &#34;ERROR: column o.tree_sortkey does not exist
LINE 7: ....last_modified, o.modifying_user, o.modifying_ip, o.tree_sor...
^
HINT: Perhaps you meant to reference the column &#34;ci.tree_sortkey&#34;.
&#34;)

ERROR: column o.tree_sortkey does not exist
LINE 7: ....last_modified, o.modifying_user, o.modifying_ip, o.tree_sor...
^
HINT: Perhaps you meant to reference the column &#34;ci.tree_sortkey&#34;.

SQL: create view xowiki_form_instance_item_view AS
SELECT
xi.package_id, xi.parent_id, xi.name,
xi.publish_status, xi.assignee, xi.state, xi.page_template, xi.item_id,
o.object_id, o.object_type, o.title AS object_title, o.context_id,
o.security_inherit_p, o.creation_user, o.creation_date, o.creation_ip,
o.last_modified, o.modifying_user, o.modifying_ip, o.tree_sortkey, o.max_child_sortkey,
cr.revision_id, cr.title, content_revision__get_content(cr.revision_id) AS text,
cr.description, cr.publish_date, cr.mime_type, cr.nls_language,
xowiki_form_page.xowiki_form_page_id,
xowiki_page_instance.page_instance_id,
xowiki_page_instance.instance_attributes,
xowiki_page.page_id,
xowiki_page.page_order,
xowiki_page.creator
FROM
xowiki_form_instance_item_index xi
left join cr_items ci on (ci.item_id = xi.item_id)
left join cr_revisions cr on (cr.revision_id = ci.live_revision)
left join acs_objects o on (o.object_id = ci.live_revision)
left join xowiki_page on (o.object_id = xowiki_page.page_id)
left join xowiki_page_instance on (o.object_id = xowiki_page_instance.page_instance_id)
left join xowiki_form_page on (o.object_id = xowiki_form_page.xowiki_form_page_id)

while executing
&#34;ns_pg_bind dml nsdb0 {create view xowiki_form_instance_item_view AS
SELECT
xi.package_id, xi.parent_id, xi.name,
xi.publish_st...&#34;
(&#34;uplevel&#34; body line 1)
invoked from within
&#34;uplevel $ulevel [list ns_pg_bind $type $db $sql]&#34;
invoked from within
&#34;db_exec dml $db $full_statement_name $sql&#34;
(&#34;uplevel&#34; body line 2)
invoked from within
&#34;uplevel 1 $code_block &#34;
invoked from within
&#34;db_with_handle -dbn $dbn db {
db_exec dml $db $full_statement_name $sql
}&#34;
(procedure &#34;::nsf::procs::db_dml&#34; line 99)
invoked from within
&#34;::db_dml {dbqd.view xowiki_form_instance_item_view {
SELECT
xi.package_id, xi.parent_id, xi.name,
xi.publish_status, xi.assigne...&#34;
(&#34;uplevel&#34; body line 1)
invoked from within
&#34;uplevel [list ::db_dml [uplevel [list [self] qn $qn]] $sql {*}$bindOpt]&#34;
(procedure &#34;dml&#34; line 3)
::xo::dc ::xo::db::DB-&gt;dml
invoked from within
&#34;::xo::dc dml create-view-$name &#34;create view $name AS $definition&#34;&#34;
(procedure &#34;view&#34; line 4)
::xo::db::require-&gt;view
invoked from within
&#34;::xo::db::require view xowiki_form_instance_item_view [subst {
SELECT
xi.package_id, xi.parent_id, xi.name,
$hkey_in_view xi.pub...&#34;
(procedure &#34;__upgrade&#34; line 537)
invoked from within
&#34;__upgrade $from_version_name $to_version_name&#34;
(procedure &#34;::nsf::procs::xowiki::upgrade_callback&#34; line 11)
invoked from within
&#34;{*}$command&#34;
(procedure &#34;::nsf::procs::apm_invoke_callback_proc&#34; line 36)
invoked from within
&#34;apm_invoke_callback_proc -version_id $version_id -type after-upgrade -arg_list [list from_version_name $upgrade_from_version_name to_version_name $ve...&#34;
(procedure &#34;::nsf::procs::apm_package_install&#34; line 212)
invoked from within
&#34;apm_package_install -enable=$enable_p -package_path $package_path -callback apm_ns_write_callback -load_data_model -data_model_files $data_model_...&#34;

Collapse
Posted by Gustaf Neumann on
Hi Frank

It looks to me, that you are not installing xowiki as released with OpenACS 5.9.0, but some other version. As you can see in [1], in the version tagged with openacs-5-9-0-final the line 330 starts with the SQL comment marker "--" , whereas in your version, it seems as if lines 329 and 330 are joined together and someone has removed the "--".

Maybe, this is the "customization" you are talking about....
-gn

[1] https://github.com/openacs/xowiki/blob/openacs-5-9-0-final/tcl/xowiki-procs.tcl#L309

Collapse
Posted by Antonio Pisano on
Dear Frank,

acs_objects.tree_sortkey errors ring a loud bell, as this column has been removed in the passage to 5.9.0

http://www.openacs.org/xowiki/openacs-todo

This was needed to build a hierarchy for objects in days before Postgres 8.4 and recursive queries.

This is another pointer of version mismatch during the upgrade.

All the best