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

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.