Forum OpenACS Development: forums is broken

Collapse
Posted by Rafael Calvo on
Hi
in oacs-4-6, on PG7.2, AOLServer 3.3.1+ad13
Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")
    while executing
"ns_pg_bind 0or1row nsdb0 {
      
	select site_node__url(node_id) 
          from site_nodes 
         where object_id = :package_id
    
      }"
    ("uplevel" body line 1)
    invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql"
    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 db {
	set selection [db_exec 0or1row $db $full_name $sql]
    }"
    (procedure "db_string" line 7)
    invoked from within
"db_string apm_package_url_from_id {
	select site_node.url(node_id) 
          from site_nodes 
         where object_id = :package_id
    } -default "..."
    (procedure "apm_package_url_from_id_mem" line 2)
    invoked from within
"apm_package_url_from_id_mem 0"
    ("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_id_mem $package_id""
    (procedure "apm_package_url_from_id" line 2)
    invoked from within
"apm_package_url_from_id $package_id"
    (procedure "apm_package_url_from_key_mem" line 3)
    invoked from within
"apm_package_url_from_key_mem notifications"
    ("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 [notification::package_key"
    (procedure "subscribe_url" line 5)
    invoked from within
"subscribe_url -type $type -object_id $object_id -url $url -user_id $user_id -pretty_name $pretty_name"
    (procedure "notification::display::request_widget" line 17)
    invoked from within
"notification::display::request_widget  -type forums_forum_notif  -object_id $forum_id  -pretty_name $forum(name)  -url [ad_conn url]?forum_id=$forum_i..."
    invoked from within
"set notification_chunk [notification::display::request_widget  -type forums_forum_notif  -object_id $forum_id  -pretty_name $forum(name)  -url [ad_con..."
    ("uplevel" body line 65)
    invoked from within
Collapse
2: Re: forums is broken (response to 1)
Posted by Jeff Davis on
Lots of problems here:
  1. notifications does not seem to be mounted (which is why "apm_package_url_from_key_mem notifications" returns 0).
  2. There are two site_nodes with package_id 0 (there probably shouldn't be any, probably some sort of bug in the dotLRN install).
  3. apm_package_url_from_id does not handle multiple nodes very gracefully. There isn't any constraint on having a package mounted at two urls so I think apm_package_url_from_id should handle it properly.
Can you do the following in psql: "select * from site_nodes;" and post the results. It should help us track down what is inserting packages with object_id's of 0.
Collapse
3: Re: forums is broken (response to 2)
Posted by Rafael Calvo on
Davb: You were right about the first one, I added notifications and attachments after running your select statement. I hope it helps:
rafa=# select * from site_nodes;
 node_id | parent_id |               name                | directory_p | pattern_p | object_id |                           tr
ee_sortkey                           
---------+-----------+-----------------------------------+-------------+-----------+-----------+-----------------------------
-------------------------------------
    2603 |           |                                   | t           | t         |      2576 | 00000000
    2604 |      2603 | acs-admin                         | t           | t         |       370 | 0000000000000000
    2605 |      2603 | acs-service-contract              | t           | t         |       514 | 0000000000000001
    2606 |      2603 | acs-content-repository            | t           | t         |      1066 | 0000000000000010
    2607 |      2603 | acs-workflow                      | t           | t         |      2547 | 0000000000000011
    2608 |      2603 | doc                               | t           | t         |      1354 | 0000000000000100
    2609 |      2603 | api-doc                           | t           | t         |       409 | 0000000000000101
    4897 |      2603 | dotlrn                            | t           | t         |      4899 | 0000000000000110
    4936 |      2603 | portal                            | t           | t         |      4937 | 0000000000000111
    4948 |      4897 | applets                           | t           | t         |           | 000000000000011000000000
    4950 |      4897 | file-storage                      | t           | t         |      4951 | 000000000000011000000001
    4959 |      4948 | fs                                | t           | t         |      4580 | 0000000000000110000000000000
0000
    4960 |      4897 | calendar                          | t           | t         |      4961 | 000000000000011000000010
    4966 |      4948 | forums                            | t           | t         |      4870 | 0000000000000110000000000000
0001
    4969 |      4948 | static-portlet                    | t           | t         |      4970 | 0000000000000110000000000000
0010
    5235 |      4897 | classes                           | t           | t         |      5236 | 000000000000011000000011
    5359 |      4897 | clubs                             | t           | t         |      5360 | 000000000000011000000100
    5462 |      5235 | eie                               | t           | t         |      5463 | 0000000000000110000000110000
0000
    5498 |      5462 | e-commerce-application-frameworks | t           | t         |      5499 | 0000000000000110000000110000
000000000000
    5648 |      5498 | e-commerce-application-frameworks | t           | t         |      5649 | 0000000000000110000000110000
00000000000000000000
00000000000000000000
    5690 |      5648 | file-storage                      | t           | t         |      5691 | 0000000000000110000000110000
0000000000000000000000000000
    5713 |      5648 | forums                            | t           | t         |      5714 | 0000000000000110000000110000
0000000000000000000000000001
    5718 |      5713 |                                   | t           | t         |         0 | 0000000000000110000000110000
000000000000000000000000000100000000
    5726 |      5648 | calendar                          | t           | t         |      5727 | 0000000000000110000000110000
0000000000000000000000000010
    5728 |      5726 |                                   | t           | t         |         0 | 0000000000000110000000110000
000000000000000000000000001000000000
    5739 |      5648 | faq                               | t           | t         |      5740 | 0000000000000110000000110000
0000000000000000000000000011
    5748 |      5648 | news                              | t           | t         |      5749 | 0000000000000110000000110000
0000000000000000000000000100
    5884 |      5359 | e-learning                        | t           | t         |      5885 | 0000000000000110000001000000
0000
    5926 |      5884 | file-storage                      | t           | t         |      5927 | 0000000000000110000001000000
000000000000
    5944 |      5884 | forums                            | t           | t         |      5945 | 0000000000000110000001000000
000000000001
    5949 |      5944 |                                   | t           | t         |         0 | 0000000000000110000001000000
00000000000100000000
    5957 |      5884 | calendar                          | t           | t         |      5958 | 0000000000000110000001000000
000000000010
    5959 |      5957 |                                   | t           | t         |         0 | 0000000000000110000001000000
00000000001000000000
    5970 |      5884 | faq                               | t           | t         |      5971 | 0000000000000110000001000000
000000000011
    5979 |      5884 | news                              | t           | t         |      5980 | 0000000000000110000001000000
000000000100
   6346 |      5359 | itev                              | t           | t         |      6347 | 0000000000000110000001000000
0001
    6388 |      6346 | file-storage                      | t           | t         |      6389 | 0000000000000110000001000000
000100000000
    6406 |      6346 | forums                            | t           | t         |      6407 | 0000000000000110000001000000
000100000001
    6411 |      6406 |                                   | t           | t         |         0 | 0000000000000110000001000000
00010000000100000000
    6419 |      6346 | calendar                          | t           | t         |      6420 | 0000000000000110000001000000
000100000010
    6421 |      6419 |                                   | t           | t         |         0 | 0000000000000110000001000000
00010000001000000000
    6432 |      6346 | faq                               | t           | t         |      6433 | 0000000000000110000001000000
000100000011
    6441 |      6346 | news                              | t           | t         |      6442 | 0000000000000110000001000000
000100000100
    6601 |      5359 | chass                             | t           | t         |      6602 | 0000000000000110000001000000
0010
    6643 |      6601 | file-storage                      | t           | t         |      6644 | 0000000000000110000001000000
001000000000
    6661 |      6601 | forums                            | t           | t         |      6662 | 0000000000000110000001000000
001000000001
    6666 |      6661 |                                   | t           | t         |         0 | 0000000000000110000001000000
00100000000100000000
    6674 |      6601 | calendar                          | t           | t         |      6675 | 0000000000000110000001000000
001000000010
    6676 |      6674 |                                   | t           | t         |         0 | 0000000000000110000001000000
00100000001000000000
    6687 |      6601 | faq                               | t           | t         |      6688 | 0000000000000110000001000000
001000000011
  6941 |      6846 | news                              | t           | t         |      6942 | 0000000000000110000001000000
001100000100
    7024 |      2603 | static                            | t           | t         |      6094 | 0000000000001001
    7028 |      2603 | forums                            | t           | t         |      7030 | 0000000000001010
Collapse
4: Re: forums is broken (response to 1)
Posted by Rafael Calvo on
Sorry, I meant Jeff
Collapse
5: Re: forums is broken (response to 1)
Posted by Rafael Calvo on
Jeff,

I deleted all rows with object_id=0 and the forums seem to work again.
Let me know if you want me to do anything to track the error that creted them in the first place.

Collapse
6: Re: forums is broken (response to 5)
Posted by Jeff Davis on
Having the query results you posted should be plenty to track
down what is causing the error in the first place.  Thanks.