Forum OpenACS Q&A: trackack cuases weblogger to crash

Collapse
Posted by Ben Koot on
After default install, weblogger does not accept any postingings, all I get is this error message (OACS 5.03)

Any I idea whaqt's happening?

Thnaks
Ben

Request Error
Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")

SQL:
    select package_id from apm_packages where package_key = 'trackback'

    while executing
"ns_pg_bind 0or1row nsdb0 {
    select package_id from apm_packages where package_key = :package_key
    }"
    ("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_name $sql"
    invoked from within
"set selection [db_exec 0or1row $db $full_name $sql]"
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $code_block "
    invoked from within
"db_with_handle -dbn $dbn db {
        set selection [db_exec 0or1row $db $full_name $sql]
    }"
    (procedure "db_string" line 8)
    invoked from within
"db_string apm_package_id_from_key {
    select package_id from apm_packages where package_key = :package_key
    } -default 0"
    (procedure "apm_package_id_from_key_mem" line 2)
    invoked from within
"apm_package_id_from_key_mem trackback"
    ("eval" body line 1)
    invoked from within
"eval $script"
    invoked from within
"ns_cache eval util_memoize $script {
        list $current_time [eval $script]
    }"
    (procedure "util_memoize" line 20)
    invoked from within
"util_memoize "apm_package_id_from_key_mem $package_key""
    (procedure "apm_package_id_from_key" line 2)
    invoked from within
"apm_package_id_from_key $package_key"
    (procedure "apm_package_url_from_key_mem" line 2)
    invoked from within
"apm_package_url_from_key_mem trackback"
    ("eval" body line 1)
    invoked from within
"eval $script"
    invoked from within
"ns_cache eval util_memoize $script {
        list $current_time [eval $script]
    }"
    (procedure "util_memoize" line 20)
    invoked from within
"util_memoize "apm_package_url_from_key_mem $package_key""
    (procedure "apm_package_url_from_key" line 2)
    invoked from within
"apm_package_url_from_key "trackback""
    (procedure "trackback::package_url" line 2)
    invoked from within
"trackback::package_url"
    (procedure "trackback::object_url" line 4)
    invoked from within
"trackback::object_url -object_id $object_id"
    invoked from within
"set trackback_url [trackback::object_url -object_id $object_id]"
    ("uplevel" body line 9)
    invoked from within
"uplevel {
          # /packages/lars-blogger/www/trackback-chunk.tcl
# generates rdf fragment to indentify trackback URL for a weblog entry
# @param url ..."
    (procedure "code::tcl::/var/lib/aolserver/service0/packages/trackback/li..." 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 [template::util::url_to_file "/packages/trackback/lib/trackback-chunk" "$__adp_stub"] [list url "[ad_quotehtml $blog(entry_archive..."
    invoked from within
"append __adp_output [template::adp_parse [template::util::url_to_file "/packages/trackback/lib/trackback-chunk" "$__adp_stub"] [list url "[ad_quotehtm..."
    ("uplevel" body line 3)
    invoked from within
"uplevel {
          set __adp_output ""
append __adp_output [template::adp_parse [template::util::url_to_file "/packages/trackback/lib/trackback-chunk" "..."
    (procedure "template::code::adp::/var/lib/aolserver/service0/packages/la..." line 2)
    invoked from within
"template::code::${template_extension}::$__adp_stub"
    (procedure "template::adp_parse" line 68)
    invoked from within
"template::adp_parse [template::util::url_to_file "entry-chunk" "$__adp_stub"] [list & "blog" show_comments_p "t" screen_name "[ad_quotehtml ${screen_n..."
    invoked from within
"append __adp_output [template::adp_parse [template::util::url_to_file "entry-chunk" "$__adp_stub"] [list & "blog" show_comments_p "t" screen_name "[ad..."
    ("uplevel" body line 23)
    invoked from within
"uplevel {
          set __adp_output ""

    set __adp_master [template::util::url_to_file "[ad_parameter -package_id [ad_conn subsite_id] DefaultMaster ..."
    (procedure "template::code::adp::/var/lib/aolserver/service0/packages/la..." line 2)
    invoked from within
"template::code::${template_extension}::$__adp_stub"
    (procedure "template::adp_parse" line 68)
    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..."

--------------------------------------------------------------------------------

mailto:ben@timedesk.nl
AOLserver/3.3.1+ad13 on http://timedesk.blogdns.com

Collapse
Posted by Joel Aufrecht on
It looks like you have trackback installed more than once:

Request Error
Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")

SQL:
    select package_id from apm_packages where package_key = 'trackback'

and the code in weblogger expects trackback to be installed only once.

If that's the problem, one possible fix would be to remove extra installations of trackback.
Another, which would be a nice thing to do in the toolkit, would be to make the apm functions that work on singletons produce non-crashing results when packages are installed more than once.

Collapse
Posted by Ben Koot on
Joel.

...make the apm functions that work on singletons produce non-crashing results when packages are installed more than once. this would make life a lotter easier.

I tried your suggestion and deleted the extra trackback module, but alas, no diference. I removed all blogger insatnces also , restarted the system, but still it doesn't work. Any thoughts what could be te problem? could it be that some snippet of code remaisn behind , even after unmounting and deleting? I know it's not windblows, but still 😉

Maybe it it's an idea to make trackback optional. From an end user point of view it would create a less confusing set up. Trackback may be nice for experts, but to convicne Joe user to use a blogger service, the less techno tricks, the easier the sell.

Thanks
Ben

Collapse
Posted by Lars Pind on
I changed trackback to be a singleton. That means there can only be one instance.

I think it might still break if you mount that single instance more than once, though.

/Lars

Collapse
Posted by Hans Gaasenbeek on
I´m trying to help Ben with this OpenAcs instance, but after removing and reinstalling lars-blogger, it still produces errors. In the end, I resorted tot use all sql-drop-scripts, and after that installing the last version including all packages it depends on.

Now, the error we get is:

Request Error
Database operation "select" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR:  Relation "category_tree_map" does not exist

SQL:
  select c.category_id as sw_category_id, c.tree_id
    from categories c, category_tree_map ctm
  where ctm.tree_id = c.tree_id
    and ctm.object_id = '8371'
    while executing
"ns_pg_bind select nsdb0 {
  select c.category_id as sw_category_id, c.tree_id
    from categories c, category_tree_map ctm
  where ctm.tree_id = c.tr..."
    ("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 select $db $full_statement_name $sql"
    invoked from within
"set selection [db_exec select $db $full_statement_name $sql]"
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $code_block "
    invoked from within
"db_with_handle -dbn $dbn db {
        set selection [db_exec select $db $full_statement_name $sql]
        set local_counter 0

        # Make sure 'n..."
    (procedure "db_multirow" line 40)
    invoked from within
"db_multirow -unclobber -extend {sw_category_name tree_name}  sw_categories sw_categories {
  select c.category_id as sw_category_id, c.tree_id
    fro..."
    ("uplevel" body line 174)
    invoked from within
"uplevel {
          ad_page_contract {
    The Weblogger index page.

(etc.)

So, maybe I have to manually run an sql script to provide the necessary relation? Which script is that (if there is any chance of succcess)?

Collapse
Posted by Hans Gaasenbeek on
I manually ran this:
service0@CP14105-A:/var/lib/aolserver/service0/packages/lars-blogger/sql/postgresql$ psql -f lars-blogger-categories-create.sql service0

This created:

psql:lars-blogger-categories-create.sql:21: WARNING:  Error occurred while executing PL/pgSQL function acs_object_type__create_type
psql:lars-blogger-categories-create.sql:21: WARNING:  line 37 at SQL statement
psql:lars-blogger-categories-create.sql:21: ERROR:  Cannot insert a duplicate key into unique index acs_object_types_pk
psql:lars-blogger-categories-create.sql:34: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'pinds_blog_categories_pk' for table 'pinds_blog_categories'
psql:lars-blogger-categories-create.sql:34: NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
psql:lars-blogger-categories-create.sql:34: ERROR:  Relation 'pinds_blog_categories' already exists
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION

Collapse
Posted by Hans Gaasenbeek on
Some information about this system:

CP14105-A:~# uname -a
Linux CP14105-A 2.4.24-1-386 #1 Wed Feb 18 19:44:56 EST 2004 i686 GNU/Linux

Debian Sarge (testing) - up-to-date

CP14105-A:~# psql --version
psql (PostgreSQL) 7.3.4
contains support for command-line editing

Postgresql installed with apt-get as per the instructions in the OpenACS-5 docs.

Collapse
Posted by Hans Gaasenbeek on
Anybody have an idea what to do next?

Installing a new instance from the next "release" is not an option, as there is quite of lot of data in the db. Inserting the existing database in a new instance seems impossible. So that means we hava a broken instance, with no means to export data.

My guess is that "upgrading" went wrong (trackback was instead installed twice), upgrading the package lars-blogger also went wrong.
It seems it is impossible to really cleanly remove a package and after that reinstall it.

I wonder when it is wise to actually use OpenACS. Which release would be mature enough? 5.1? And after that not upgrading any packages would probably be the best option.

Collapse
Posted by Jeff Davis on
the message about category_tree_map probably means the
categories package is not installed (lars-blogger
now requires this but did not in older versions).
Collapse
10: Categories (response to 1)
Posted by Hans Gaasenbeek on
Thank you for this suggestion! Sadly, Categories IS installed... Maybe reinstalling is an option? It says - when I want to delete it -

WARNING

The following packages depend on package categories that you are about to delete:
project-manager
lars-blogger

Proceeding with the deletion of the package may render the system in a broken state.

Deleting a package removes all record of it from the APM's database.

We recommend sourcing all of the drop scripts for the package. Be aware that this will erase all data associated with this package from the database.  sql/postgresql/categories-drop.sql

Collapse
11: Re: Categories (response to 10)
Posted by Jeff Davis on
If this is on postgres could you try:
 \dt categ*
which on my install shows:
                   List of relations
 Schema |            Name            | Type  |  Owner  
--------+----------------------------+-------+---------
 public | categories                 | table | nsadmin
 public | category_links             | table | nsadmin
 public | category_object_map        | table | nsadmin
 public | category_search            | table | nsadmin
 public | category_search_index      | table | nsadmin
 public | category_search_results    | table | nsadmin
 public | category_synonym_index     | table | nsadmin
 public | category_synonyms          | table | nsadmin
 public | category_temp              | table | nsadmin
 public | category_translations      | table | nsadmin
 public | category_tree_map          | table | nsadmin
 public | category_tree_translations | table | nsadmin
 public | category_trees             | table | nsadmin
(13 rows)
Collapse
Posted by Ben Koot on
Hi folks,

I havn't tried the settings above, but now get this error messaging after unmounting categories, and reinstalling.
any thoughts?

Thanks
Ben

Request Error
Unknown command sort in template::multirow.
      Must be create, extend, append, backup, get, set, size, upvar, or foreach.
    while executing
"error "Unknown command $command in template::multirow.
      Must be create, extend, append, backup, get, set, size, upvar, or foreach.""
    ("default" arm line 2)
    invoked from within
"switch -exact $command {

    create {
      upvar $multirow_level_up $name:rowcount rowcount $name:columns columns
      set rowcount 0
      set col..."
    (procedure "template::multirow" line 9)
    invoked from within
"template::multirow sort trees -dictionary tree_name"
    ("uplevel" body line 34)
    invoked from within
"uplevel {
          ad_page_contract {

    The index page to browse category trees.

    @author Timo Hentschel (mailto:timo@timohentschel.de)
    @cvs-id $Id:..."
    (procedure "code::tcl::/var/lib/aolserver/service0/packages/categories/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..."