Forum OpenACS Q&A: xowiki install failed in new OpenACS install

I'm running OpenACS 5.8.1 on NaviServer 4.99.8 with Postgresql 9.3.6

Installation of the xowiki package and its dependencies was reported successful. However, I was unable to use xowiki as I was immediately greeted with errors.
After examining the logs, I discover this:

[26/Jun/2015:15:59:48][41855.7fefdea36700][-conn:openacs:1-] Error: nsdbpg: result status: 7 message: ERROR:  column "title" specified more than once
CONTEXT:  SQL statement "create view xowiki_plain_pagei as select  acs_objects.object_id,
acs_objects.object_type,
acs_objects.title as object_title,
acs_objects.package_id as object_package_id,
acs_objects.context_id,
acs_objects.security_inherit_p,
acs_objects.creation_user,
acs_objects.creation_date,
acs_objects.creation_ip,
acs_objects.last_modified,
acs_objects.modifying_user,
acs_objects.modifying_ip,
acs_objects.tree_sortkey,
acs_objects.max_child_sortkey, cr.revision_id, cr.title, cr.item_id,
    content_revision__get_content(cr.revision_id) as data,
    cr_text.text_data as text,
    cr.description, cr.publish_date, cr.mime_type, cr.nls_language, xowiki_plain_page.*, xowiki_page.* from acs_objects, cr_revisions cr, cr_text, xowiki_plain_page, xowiki_page where
    acs_objects.object_id = cr.revision_id  and acs_objects.object_id = xowiki_plain_page.ppage_id and acs_objects.object_id = xowiki_page.page_id"
PL/pgSQL function content_type__refresh_view(character varying) line 47 at EXECUTE statement
SQL statement "SELECT content_type__refresh_view(create_type__content_type)"
PL/pgSQL function content_type__create_type(character varying,character varying,character varying,character varying,character varying,character varying,character varying) line 39 at PERFORM

There are several variations of this when trying to source several xowiki related tcl files.
Any idea what is causing this?

Collapse
Posted by Gustaf Neumann on
hmm. i installed just for testing a new instance from scratch and everything is working fine. i installed actually twice:

a) installed from cvs from the oacs-5-8 branch

b) installed from the openacs-5.8.1.tar.gz and
installed then xowiki from the repository.

In both cases, no error shows up.
how did you install? what do you see from http://YOURHOST/xotcl/version-numbers?

Where is the duplicate column "title" is coming from? xowiki_plain_page.* and xowiki_page.* should not contain a column "title".

The error above might at a broken acs-content-repository, since content_type__refresh_view() returned an error.

-g

Collapse
Posted by Colin Charbonneau on
Here is the output of /xotcl/version-numbers:

Version Numbers of XOTcl and Related Packages

Database: PostgreSQL 9.3.5 on x86_64-unknown-linux-gnu, compiled by gcc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064], 64-bit
Server: 4.99.8 (NaviServer)
Tcl: 8.5.14
XOTcl: 2.0.0
Tdom: 0.8.3
libthread: /usr/local/myrrh/ns/lib/thread2.7.1/libthread2.7.1.so
Tcllib: /usr/local/myrrh/ns-4.99.8/lib/tcllib1.15
acs-kernel: 2013-09-08, 5.8.1
xotcl-core: 2015-02-11, 0.137
xowiki: 2015-03-23, 0.165

As you can see, NaviServer was not installed using the default directories, so it is a bit of a nonstandard NaviServer install.

OpenACS was extracted from the tar.gz, and xowiki from the repository.

Here is the (several thousand line) snippet from the log that details what happens from the beginning of the xowiki install to the errors: http://pastebin.com/epTfc26X

Collapse
Posted by Colin Charbonneau on
Another thing I've tried:

Installing all of the prerequisite packages (no errors).
Installing xowiki without the data model.
Attempting to source the data model myself into the database. Extremely similar errors occurred.

Collapse
Posted by Colin Charbonneau on
Attempted install using HEAD codebase. Same result.

Could this be the version of postgresql that I'm using causing the issue?

Collapse
Posted by Benjamin Brink on
Hi Colin,

I noticed an error something like this awhile back when I tried using a fresh xowiki install. I haven't tested lately, but my limited experience with most all esoteric xowiki errors are overcome by:

1. restarting naviserver after an install and before doing anything else.

2. waiting an hour (or as much as a day) before using xowiki;

Explanation of #2: There are some critical background xowiki/pg related init processes started when xowiki is installed. Also, some xotcl/xowiki processes apparently return incomplete results if process time is too long. When I install on *very* slow/limited systems, some part of the background init appears to timeout ( and fail silently), subsequently resulting in esoteric errors. This is not necessarily an xowiki specific issue. One time about 14 years ago, something similar was happening to early openacs installations on vm installed in an overloaded server.

Hope that helps.

Collapse
Posted by Gustaf Neumann on
Dear Colin,

the postgres version is not the problem. The problem seems to be that in your installation, xowiki adds the column "title" to xowiki_page, leading later to duplicate columns.

[07/Jul/2015:11:55:18][48366.7fc22953f700][-conn:openacs:0-] Notice: xodb: adding column <alter table xowiki_page add column description  text >
[07/Jul/2015:11:55:18][48366.7fc22953f700][-conn:openacs:0-] Notice: xodb: adding column <alter table xowiki_page add column publish_date  timestamp with time zone >
[07/Jul/2015:11:55:18][48366.7fc22953f700][-conn:openacs:0-] Notice: xodb: adding column <alter table xowiki_page add column title  varchar(1000) >

When one adds the following line

--- xotcl-core/tcl/05-db-procs.tcl	30 Jun 2015 09:20:54 -0000	1.102
+++ xotcl-core/tcl/05-db-procs.tcl	9 Jul 2015 15:10:16 -0000
@@ -706,6 +706,7 @@
   }
 
   require proc table {name definition {populate ""}} {
+    my log "==== require table $name exists: [my exists_table $name]\n$definition"
     if {![my exists_table $name]} {
       set lines {}
       foreach col [dict keys $definition] {lappend lines "$col [dict get $definition $col]"}

one should see at startup
[09/Jul/2015:10:12:07][83047.7fff7bd72300][-main-] Notice: ==== require table xowiki_page exists: 1
page_order { ltree DEFAULT '' } creator { text } page_id { integer REFERENCES cr_revisions(revision_id) ON DELETE CASCADE
        CONSTRAINT xowiki_page_page_id_pk PRIMARY KEY }, ::xo::db::require ->table (0ms, 11ms)
The values are pairs with attribute_names and definitions. Probably, on your site you get "text", "publish_date" and "title" as well.... but why?

hmm... i found something incorrect: a cached value might lead to incorrect results, returning "title" in the table definition - but that should not happen during installs/loading. Do you have some local modification affecting the loading order?

Please try the change below, it should work with oacs-5-8 and the HEAD version. AFIKT, thus change causes no harm. Currently, i am on the move in Mexico (vacation), but i will commit this when possible.

best regards
-gn

--- xotcl-core/tcl/01-debug-procs.tcl	15 Jun 2015 19:28:33 -0000	1.76
+++ xotcl-core/tcl/01-debug-procs.tcl	9 Jul 2015 16:08:54 -0000
@@ -967,7 +967,8 @@
   set newSlot [self]::slot::$name
 
   $slot copy $newSlot
-  $newSlot configure -domain [self] -manager $newSlot -create_acs_attribute false {*}$config
+  $newSlot configure -domain [self] -manager $newSlot -create_acs_attribute false -create_table_attribute false {*}$config
+  my set db_slot($name) $newSlot 
 }
Collapse
Posted by Colin Charbonneau on
I attempted the change at the bottom of your post, but it did not seem to be the cause of my problems. I am doing to drop the DB and re-install again, and try the extra log entry to see what I receive from it.
Collapse
Posted by Colin Charbonneau on
Adding this log message did not seem to make any significant impact on startup... it does not seem to be getting reached.
Collapse
Posted by Gustaf Neumann on
the code leading to the problem checks, if the table has the desired columns, and adds if it these are not there. So, when your database has already the columns "description", "publish_date" and "title" defined for table "xowiki_page", then the problem persists.

If it is a fresh db, i would recommend to drop the db and install new. Otherwise, drop the mentioned columns from "xowiki_page", do a "drop view xowiki_pagei CASCADE" and restart. With the mentioned changes, xowiki will heal itself.

This code in "require table" will be definitely executed, since this is the only place where "alter table ... add column" is executed (as shown from your install error.log). Can it be that you have multiple xotcl-core* directories under packages and you have modified the wrong instance?

I've added the mentioned change to cvs HEAD an to the oacs-5-8 branch. After the next generation of the APM files this night (middle-european time) the change is as well in the .apm file in the OpenACS repository.

-g

Collapse
Posted by Colin Charbonneau on
You're right. OpenACS was loading the wrong code after I'd made the change. This seems to work now.

Thanks for your help, especially while on vacation.

Collapse
Posted by Gustaf Neumann on
Glad, that it helped! -g