Forum OpenACS Q&A: OpenFTS Request Error

Collapse
Posted by Phillip Kuo on
Hi,

I have installed OpenACS 4.6 with PostgreSQL 7.2.3 with aolserver 3.3.  Everything seems to be working fine with the installation until I made an attempt to install OpenFTS ver 4.6.  I tar -xzf the file, made installed it, and then when I add it to the OpenFTS Driver : Administration : Initialize OpenFTS engine, it gives me a page saying "Request Error".
......
Database operation "dml" failed
  while executing
  "error "$err""
    invoked from within
  "if [catch {
    db_dml create_table "create table $table_name ($(table_id) int not null primary key, path varchar unique, fts_index txti
    invoked from within
  "uplevel {
        ad_page_contract {

  Initialize OpenFTS

  @author Neophytos Demetriou

} {

....

I emailed my problem to Dave Bauer and he suggested removing the OpenFTS driver all together, however I don't have the option to do so.  At least I don't see one in the package manager and it is listed as an installed component.

Any suggestions as to what might be going wrong or how to approach this?

thanks in advance,

Phill

Collapse
Posted by Neophytos Demetriou on
Hi Phillip,

have you installed tsearch (tsearch comes bundled with postgresql, contrib section)? What version? Have you followed the install procedure as outlined in the install file that comes bundled with the package? Also what version of OpenFTS are you using?

I'm in vacation currently but I'll try to be as responsive as possible. I've just noticed that you have just registered. Are you a first-time user or have you used OpenACS before?

Best wishes,
Neophytos

Collapse
Posted by Phillip Kuo on
Hi,

I have installed everything in the Installing ACS on Unix/Linux manual with little problem all the way until Number 16 in the instructions which includes the tsearch which comes with postgresql 7.2.3.  I made a mistake on the OpenFTS version number, it is Search-OpenFTS-tcl-0.3.2

This is my very first time installing OpenACS.

thanks for the fast response.

Phill

Collapse
Posted by Neophytos Demetriou on
You are welcome.
Collapse
Posted by Joel Aufrecht on
There are a couple of common things that can go wrong with OpenFTS. Could you post the exact database error? You can find it in the error log. The location of the error log is specified in the aolserver configuration file. For OpenACS 4.6, the config file is probably /usr/local/aolserver/openacs4.tcl, with this line:
ns_param   serverlog          ${serverroot}/log/error.log

Once you've found the error log, search for some text from the tcl error and look near it for the full SQL error.

(Happily, with 4.6.2 and the new postgres driver the full database error message is right on the web page and you don't have to dig through the log.)

Collapse
Posted by tammy m on
Hi

You might wanna look at these notes I wrote when I installed OpenFTS, Search, Static Pages + General Comments. They have all the actual steps I had to perform in sequential order and some of the gotchas that came up afterward. Good Luck.

Collapse
Posted by Peter Alberer on
Maybe the table does exist already? When you try to initialize the engine and something goes wrong it is probably after the table creation. If you then correct openfts related problems you will still get this error, as the table is already in the db. The initialization code is not very smart.

Openfts easily gets in a status were it is not correctly installed but you cannot remove it. Drop every openfts related table in the db and restart the initialization.

drop table YOUR_INDEX_TABLE; ( txt or fts_fulltext_index )
drop table fts_unknown_lexem;
drop table fts_conf;
-- drop index tables
drop table index[1-10];

Collapse
Posted by Phillip Kuo on
This is what i have in my /log/error.log.  I didn't see where it was available on the administration site itself.

....

[22/Apr/2003:11:34:13][2543.1024][-main-] Notice: Ns_PgOpenDb(postgres):  Openned connection to localhost::itgroup.
[22/Apr/2003:11:34:13][2543.1024][-main-] Notice: dbdrv: opening database 'postgres:localhost::itgroup'
[22/Apr/2003:11:34:13][2543.1024][-main-] Notice: Opening itgroup on localhost
[22/Apr/2003:11:34:13][2543.1024][-main-] Notice: Ns_PgOpenDb(postgres):  Openned connection to localhost::itgroup.
[22/Apr/2003:11:34:13][2543.1024][-main-] Notice: Loading acs-tcl
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/00-database-procs-postgresql.tcl...
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/00-database-procs.tcl...
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/10-charset-compat-procs.tcl...
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/30-xml-utils-procs.tcl...
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/acs-kernel-procs.tcl...
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/acs-permissions-procs.tcl...
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/acs-private-data-procs.tcl...
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/admin-procs.tcl...
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/adp-parser-procs.tcl...
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/aolserver-3-procs.tcl...
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/apm-file-procs.tcl...
[23/Apr/2003:09:06:41][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/apm-install-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/apm-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/apm-xml-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/community-core-2-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/community-core-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/defs-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/deprecated-utilities-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/document-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/exception-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/form-processing-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/membership-rel-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/memoize-procs.tcl...
[23/Apr/2003:09:06:42][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/navigation-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/object-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/object-type-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/openacs-kernel-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/parameter-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/request-processor-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/security-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/server-cluster-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/sql-statement-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/sql-statement-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/sql-statement-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/sql-statement-procs.tcl...
[23/Apr/2003:09:06:43][8472.1024][-main-] Notice: Loading packages/acs-tcl/tcl/table-display-procs.tcl...
[22/Apr/2003:11:34:15][2543.1024][-main-] Notice: Loading packages/acs-tcl/tcl/tcl-documentation-procs.tcl...
[22/Apr/2003:11:34:16][2543.1024][-main-] Warning: apm_boostrap_load_file skipping /home/phill/web/itgroup/packages/acs-tcl/tcl/tcl-documentation-tests.tcl because it isn't either a -procs.tcl or -init.tcl file
[22/Apr/2003:11:34:16][2543.1024][-main-] Notice: Loading packages/acs-tcl/tcl/text-html-procs.tcl...
[22/Apr/2003:11:34:16][2543.1024][-main-] Notice: Loading packages/acs-tcl/tcl/user-extensions-procs.tcl...
[22/Apr/2003:11:34:16][2543.1024][-main-] Notice: Loading packages/acs-tcl/tcl/utilities-procs.tcl...
[22/Apr/2003:11:34:16][2543.1024][-main-] Notice: Loading packages/acs-tcl/tcl/widgets-procs.tcl...
[22/Apr/2003:11:34:16][2543.1024][-main-] Notice: Loading packages/acs-tcl/tcl/xml-0-sgml-procs.tcl...
[22/Apr/2003:11:34:16][2543.1024][-main-] Notice: Loading packages/acs-tcl/tcl/xml-1-dom-procs.tcl...
[22/Apr/2003:11:34:16][2543.1024][-main-] Notice: Loading packages/acs-tcl/tcl/xml-2-procs.tcl...
[22/Apr/2003:11:34:18][2543.1024][-main-] Notice: Multiple definition of util_memoize in /home/phill/web/itgroup/packages/acs-tcl/tcl/memoize-procs.tcl and /home/phill/web/itgroup/packages/acs-bootstrap-installer/bootstrap.tcl
[22/Apr/2003:11:34:18][2543.1024][-main-] Notice: Installation is not complete - sourcing the installer.
[22/Apr/2003:11:34:18][2543.1024][-main-] Notice: Sourcing files for postload...
[22/Apr/2003:11:34:18][2543.1024][-main-] Notice: Done.
[22/Apr/2003:11:34:18][2543.1024][-main-] Notice: Executing initialization code blocks...
[22/Apr/2003:11:34:18][2543.1024][-main-] Notice: tcl: generating interp init script
[22/Apr/2003:11:34:19][2543.1024][-main-] Warning: keepalive: insufficient maxkeepalive 0: keepalive disabled
[22/Apr/2003:11:34:19][2543.1024][-main-] Notice: nsmain: AOLserver/3.3.1+ad13 running
[22/Apr/2003:11:34:19][2543.1024][-main-] Notice: nsmain: security info: uid=1000, euid=1000, gid=1000, egid=1000
[22/Apr/2003:11:34:19][2543.2051][-sched-] Notice: sched: starting
[22/Apr/2003:11:34:19][2543.1024][-main-] Notice: serv: waiting for warmup
[22/Apr/2003:11:34:21][2543.1024][-main-] Notice: serv: warmed up
[22/Apr/2003:11:34:21][2543.1024][-main-] Notice: socks: idle
[22/Apr/2003:11:34:21][2543.1024][-main-] Notice: sched: idle
[22/Apr/2003:11:34:21][2543.1024][-main-] Notice: nssock: listening on 127.0.0.1:8000
[22/Apr/2003:11:34:21][2543.8201][-nssock-] Notice: nssock: starting
[22/Apr/2003:11:34:21][2543.8201][-nssock-] Notice: nssock: accepting connections
[22/Apr/2003:11:35:24][2543.3076][-conn0-] Error: tclop: invalid return code from filter proc '': must be filter_ok, filter_return, or filter_break
[22/Apr/2003:11:35:38][2543.5126][-conn2-] Error: tclop: invalid return code from filter proc '': must be filter_ok, filter_return, or filter_break

Collapse
Posted by Phillip Kuo on
cool deal.. thanks for the url.  I'll be looking into those right now.
Collapse
Posted by Neophytos Demetriou on
Phillip the error you have posted does not have much to do with the openfts-driver (unless I'm missing something obvious here). Are you sure there's nothing more to it?
Collapse
Posted by Phillip Kuo on
I just posted a section of the error.log which is listed in the nsd.tcl file in case it might provide any insight to anyone else.  Is there another error log which is written to by default?  I'm having a hard time trying to find a copy of the Request error I received when I first attempted to initialize the OpenFTS Driver.  All I have right now is a screen shot of it which I originally sent to Dave Bauer however, I somewhat doubt that would be much help at this point. It only displays part of it and I don't see a way to display the jpg on this forum.

as a newbie at this system, I am reluctant to drop the files and the tables for fear of the risk of corrupting the associations in the tables.

Collapse
Posted by Joel Aufrecht on
I think you're looking at the right log. Try trailing the log (with tail -f or with less and then shift-F) and then causing the error again.
Collapse
Posted by Phillip Kuo on
Here is what I have in my error log

[28/Apr/2003:15:14:06][8472.2051][-sched-] Notice: Running scheduled proc search_indexer...
[28/Apr/2003:15:14:06][8472.2051][-sched-] Notice: Done running scheduled proc search_indexer.
[28/Apr/2003:15:14:07][8472.6151][-conn3-] Notice: Security: 1051560847 sec_generate_session_id_cookie setting 403, 2121.
NOTICE:  identifier "apm_package_type__num_parameters" will be truncated to "apm_package_type__num_parameter"
NOTICE:  identifier "apm_package_type__num_parameters" will be truncated to "apm_package_type__num_parameter"
[28/Apr/2003:15:14:24][8472.4101][-conn1-] Error: Ns_PgExec: result status: 7 message: ERROR:  Relation "fts_conf" does not exist

[28/Apr/2003:15:14:36][8472.6151][-conn3-] Notice: ns_getform using encoding iso8859-1 for charset iso-8859-1
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'txt_pkey' for table 'txt'
NOTICE:  CREATE TABLE / UNIQUE will create implicit index 'txt_path_key' for table 'txt'
[28/Apr/2003:15:14:36][8472.6151][-conn3-] Error: Ns_PgExec: result status: 7 message: ERROR:  Relation 'txt' already exists

[28/Apr/2003:15:14:36][8472.6151][-conn3-] Notice: RP (234.3 ms): error in rp_handler: serving POST /openfts/admin/initialize-2
        ad_url "/openfts/admin/initialize-2" maps to file "/home/phill/web/itgroup/packages/openfts-driver/www/admin/initialize-2.tcl"
errmsg is Database operation "dml" failed
[28/Apr/2003:15:14:36][8472.6151][-conn3-] Error: POST http://debianbox.rgmiller.com:8000/openfts/admin/initialize-2?
referred by "http://debianbox.rgmiller.com:8000/openfts/admin/initialize"
Database operation "dml" failed
    while executing
"error "$err""
    invoked from within
"if [catch {
    db_dml create_table "create table $table_name ( ${table_id} int not null primary key, path varchar unique, fts_index txtidx, last_modi..."
    ("uplevel" body line 21)
    invoked from within
"uplevel {
          ad_page_contract {

    Initialize OpenFTS

    @author Neophytos Demetriou

} {
    table_name
    table_id
    dict
    numbergroup..."
    (procedure "code::tcl::/home/phill/web/itgroup/packages/openfts-driver/w..." 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 "
    (procedure "template::adp_parse" line 30)
    invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
    (procedure "adp_parse_ad_conn_file" line 7)
    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/$path""
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
        rp_serve_abstract_file "$root/$path"
        set tcl_url2file([ad_conn url]) [ad_conn file]
        set tcl_url2path_info([ad_conn url]) [ad_conn path_inf..."
[28/Apr/2003:15:15:06][8472.2051][-sched-] Notice: Running scheduled proc search_indexer...
[28/Apr/2003:15:15:06][8472.2051][-sched-] Notice: Done running scheduled proc search_indexer.

Collapse
Posted by Jon Griffin on
search the boards. You have cruft leftover from an aborted install. I put a sql snippet in a post a few months ago.
Collapse
Posted by tammy m on
Peter is right. You have a partial install of OpenFTS and are stuck in a bad loop:( You need to drop all OpenFTS tables so the installer can run from scratch again. It's not that bad, I did it several times before I got mine running the first time.  Try what Peter posted earlier and then startup the AOLServer again.
Collapse
Posted by Neophytos Demetriou on
Phillip, I will be back in my office on Wednesday. Give me a couple of days to settle down and I could guide you step-by-step during the weekend if you do not succeed by then. I hope it's ok.
Collapse
Posted by Phillip Kuo on
Great!  thanks
Collapse
Posted by Jon Griffin on
Phillip,
Since you don't seem to believe you have a partial install, I will post my steps yet again.


drop table fts_unknown_lexem;
drop table txt;
drop table fts_conf;

select relname from pg_class where relname like 'index%';
 relname
-------------
index1
index10
index10_key
index11
index11_key
index12
index12_key
index13
index13_key
index2
index2_key
index3
index3_key
index4
index4_key
etc....

drop all of those index
You need to do this and then reinstall openfts-driver.
Collapse
Posted by Phillip Kuo on
thanks to Neophytos for his help.

He helped me get the openfts installed and running again.  Ended up installing a /etc/shell-mods.sh script which contained the following:

PATH=$PATH:/usr/local/pgsql/bin
export PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH

and reinstalled openacs and reran the installation.

He also helped me point out my "run" script had nsd-postgres instead of "nsd"