Forum .LRN Q&A: Re: Forums in dotLRN broken?

Collapse
Posted by Jeff Davis on
you should be working with a cvs checkout from the dotlrn-1-0
branch and the oacs-4-6 branch.  Don Baccus, Dave Bauer, and
I have fixed a dozen or so bugs in forums but the fixes are
only checked in on the 4.6 branch right now (and the
not-allowed page is also checked in there).
Collapse
Posted by Jarkko Laine on
Thanks, it seems to work now. However, day summary portlet in personal portal throws the following error:
You have found a bug in our code. 

Please notify the webmaster and include the following text. Thank You.


*** portal::render_element show callback Error! ***

 Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")
Collapse
Posted by Jeff Davis on
I think you are seeing the bug Rafael Calvo ran into
here https://openacs.org/forums/message-view?message_id=60280

You might try deleting the entries in site_nodes where the
package_id is 0.

Collapse
Posted by Jarkko Laine on
Jeff,

I assume you mean object_id. However, this time it seems not to be the case, i.e. no rows with object_id 0, just applets without object_id:

dotlrn-test=# select * from site_nodes;
 node_id | parent_id |            name             | directory_p | pattern_p | o
bject_id |                           tree_sortkey                           
---------+-----------+-----------------------------+-------------+-----------+--
---------+------------------------------------------------------------------
    2603 |           |                             | t           | t         |  
    2576 | 00000000
    2604 |      2603 | acs-admin                   | t           | t         |  
     372 | 0000000000000000
    2605 |      2603 | acs-service-contract        | t           | t         |  
     516 | 0000000000000001
    2606 |      2603 | acs-content-repository      | t           | t         |  
    1068 | 0000000000000010
    2607 |      2603 | acs-workflow                | t           | t         |  
    2547 | 0000000000000011
    2608 |      2603 | doc                         | t           | t         |  
    1356 | 0000000000000100
    2609 |      2603 | api-doc                     | t           | t         |  
     411 | 0000000000000101
    4825 |      2603 | dotlrn                      | t           | t         |  
    4827 | 0000000000000110
    4862 |      2603 | attachments                 | t           | t         |  
    4864 | 0000000000001000
    4861 |      2603 | notifications               | t           | t         |  
    4868 | 0000000000000111
    4872 |      2603 | portal                      | t           | t         |  
    4873 | 0000000000001001
    4884 |      4825 | attach                      | t           | t         |  
    4864 | 000000000000011000000000
    4885 |      4825 | applets                     | t           | t         |  
         | 000000000000011000000001
    4887 |      4825 | file-storage                | t           | t         |  
    4888 | 000000000000011000000010
    4896 |      4885 | fs                          | t           | t         |  
    4508 | 00000000000001100000000100000000
    4897 |      4825 | calendar                    | t           | t         |  
    4898 | 000000000000011000000011
    4903 |      4885 | forums                      | t           | t         |  
    4798 | 00000000000001100000000100000001
    4906 |      4885 | static-portlet              | t           | t         |  
    4907 | 00000000000001100000000100000010
    5172 |      4825 | classes                     | t           | t         |  
    5173 | 000000000000011000000100
    5296 |      4825 | clubs                       | t           | t         |  
    5297 | 000000000000011000000101
    5467 |      5172 | tiedonhallinta              | t           | t         |  
    5468 | 00000000000001100000010000000000
    5504 |      5467 | software-business           | t           | t         |  
    5505 | 0000000000000110000001000000000000000000
    5654 |      5504 | software-business           | t           | t         |  
    5655 | 000000000000011000000100000000000000000000000000
    5696 |      5654 | file-storage                | t           | t         |  
    5697 | 00000000000001100000010000000000000000000000000000000000
    5719 |      5654 | forums                      | t           | t         |  
    5720 | 00000000000001100000010000000000000000000000000000000001
    5724 |      5719 | attach                      | t           | t         |  
    4864 | 0000000000000110000001000000000000000000000000000000000100000000
    5732 |      5654 | calendar                    | t           | t         |  
    5733 | 00000000000001100000010000000000000000000000000000000010
    5734 |      5732 | attach                      | t           | t         |  
    4864 | 0000000000000110000001000000000000000000000000000000001000000000
    5745 |      5654 | faq                         | t           | t         |  
    5746 | 00000000000001100000010000000000000000000000000000000011
    5754 |      5654 | news                        | t           | t         |  
    5755 | 00000000000001100000010000000000000000000000000000000100
    5813 |      5467 | tiedonhallinnan-peruskurssi | t           | t         |  
    5814 | 0000000000000110000001000000000000000001
    5963 |      5813 | tiedonhallinnan-peruskurssi | t           | t         |  
    5964 | 000000000000011000000100000000000000000100000000
    6005 |      5963 | file-storage                | t           | t         |  
    6006 | 00000000000001100000010000000000000000010000000000000000
    6028 |      5963 | forums                      | t           | t         |  
    6029 | 00000000000001100000010000000000000000010000000000000001
    6033 |      6028 | attach                      | t           | t         |  
    4864 | 0000000000000110000001000000000000000001000000000000000100000000
    6041 |      5963 | calendar                    | t           | t         |  
    6042 | 00000000000001100000010000000000000000010000000000000010
    6043 |      6041 | attach                      | t           | t         |  
    4864 | 0000000000000110000001000000000000000001000000000000001000000000
    6054 |      5963 | faq                         | t           | t         |  
    6055 | 00000000000001100000010000000000000000010000000000000011
    6063 |      5963 | news                        | t           | t         |  
    6064 | 00000000000001100000010000000000000000010000000000000100
(39 rows)
Collapse
Posted by Jeff Davis on
Jarkko, you should look in the server error log to figure out
what query it was that is actually failing.  Also, I think
if you install the newer postgres driver you will get the
offending query in your error message.

The site_nodes stuff do look fine.

Collapse
Posted by Jarkko Laine on
Jeff,

Here's the snippet from server log. I'm not quite sure if the error refers to the query that's before or after it, but I think before, because it gives three rows and the latter just one when run from psql shell.

[03/Dec/2002:13:49:18][10942.4101][-conn1-] Notice: Querying '
    select    calendar_id
    from      calendars
    where     owner_id = '2610'
    and       private_p = 't';'
[03/Dec/2002:13:49:18][10942.4101][-conn1-] Notice: dbinit: sql(localhost::dotlrn-test): '
    select    calendar_id
    from      calendars
    where     owner_id = '2610'
    and       private_p = 't'
    '
[03/Dec/2002:13:49:18][10942.4101][-conn1-] Error: *** portal::render_element show callback Error! ***

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


[03/Dec/2002:13:49:18][10942.4101][-conn1-] Debug: NO FULLQUERY FOR dbqd.dotlrn.tcl.dotlrn-security-procs.dotlrn::user_p.select_count --> using default SQL
[03/Dec/2002:13:49:18][10942.4101][-conn1-] Debug: PgBindCmd: sql = 
            select count(*)
            from dual
            where exists (select 1
                          from dotlrn_users
                          where user_id = :user_id)
        
[03/Dec/2002:13:49:18][10942.4101][-conn1-] Debug: PgBindCmd: bind var: user_id = 2610
[03/Dec/2002:13:49:18][10942.4101][-conn1-] Debug: PgBindCmd: query with bind variables substituted = 
            select count(*)
            from dual
            where exists (select 1
                          from dotlrn_users
                          where user_id = '2610')
Collapse
Posted by Jarkko Laine on
OK, the reason seems to be that somehow this user 2610 (me, site-wide admin) has three personal calendars in the calendars table:
dotlrn-test=# select * from calendars;
 calendar_id |        calendar_name        | owner_id | package_id | private_p 
-------------+-----------------------------+----------+------------+-----------
        5396 | Personal                    |     2610 |       4898 | t
        5465 | Personal                    |     5397 |       4898 | t
        5735 | Software Business           |     2610 |       5733 | f
        5809 | Personal                    |     2610 |       5733 | t
        6044 | Tiedonhallinnan peruskurssi |     2610 |       6042 | f
        6177 | Personal                    |     6109 |       4898 | t
        6247 | Personal                    |     6179 |       4898 | t
        6293 | Personal                    |     2610 |       6042 | t
(8 rows)
When I deleted the rows 5809 and 6293, the calendar started working ok again. The question remains, how these extra calendars got to exist in the first place. I certainly didn't create them explicitly (or at least, on purpose). It seems that every time you create a class and implicitly a calendar for it, you get a new personal calendar, too.