Invalid SQL: DELETE FROM active_sessions....

Lynn Schaper schaper@Colorado.EDU
Mon, 13 Nov 2000 16:36:40 -0700 (MST)


We occasionally see this error in the top frame on the login page, or in
the top frame once logged in, or (less often) in the frame listing the
mail once logged in:

  Database error (HordeDB): Invalid SQL: DELETE FROM active_sessions WHERE
  changed < '20001109092758' AND name = 'HordeSession'

It appears that this error shows up any time garbage collection is
attempted on active_sessions.  Our database is not getting cleaned out.

We've followed the install instructions with horde and imp, and have not
made modifications to the recommended settings.  Based on questions and
comments I've seen on this list, garbage collection works for some
people, and does not work for others -- even when they use the default
and recommended configurations.

The relevant variables seem to be $gc_time and $gc_probability, which
I find in these files:

/usr/local/apache/php/session.inc:
  var $gc_time  = 1440;    // Purge all session data older than 1440 minutes.
  var $gc_probability = 1;  // Garbage collect probability in percent

/usr/local/apache/php/local.inc:
  var $gc_probability = 5;

/usr/local/lib/php.ini
session.gc_probability    = 1       ; percentual probability that the 
                                    ; 'garbage collection' process is started
                                    ; on every session initialization
session.gc_maxlifetime    = 1440    ; after this number of seconds, stored
                                    ; data will be seen as 'garbage' and
                                    ; cleaned up by the gc process



Other people have reported this problem on the list:

Subject:  [imp] Re: Yet another HordeDB Invalid SQL error (not freeze problem)
Date:     2000-09-08 3:19:56
From:     Raul Alvarez Venegas <rav@tecoman.ucol.mx>

Subject:  [imp] Strange Error
From:     Patrick Bryan <patrickbryan@swedishamerican.org>
Date:     2000-08-28 14:20:55

I've also found other instances from earlier this year.  The answers
have either been:
- it's a phplib problem; reinstall
- you're probably not using the phplib that comes with horde
- no response


We are running:
horde-1.2.3-cvs
imp-2.2.3-cvs
Sun Solaris 8
apache_1.3.12
mysql-3.22.32
PHP/4.0.3
Horde-specific phplib; $Author: bjn; $Revision: 1.2.2.9


Questions:

- Does anyone have an idea of what is going on?

- Which of the settings from the 3 different files (above) takes
  precedence?

- How do we turn off garbage collection?  $gc_probability = 0 ?

- If you're doing gc outside of imp, how often do you clean up
  active_sessions?

- Why is this error coming to the screen instead of the log file?
  from php.ini:
    display_errors  =  Off ; Print out errors (as a part of the output)

- Can we run the failing command by hand on our production system without
  adverse affects?

Thanks,

Lynn
-- 
    Lynn Schaper                        Schaper@colorado.edu
    Information Technology Services     Central and Unix Services     
    University of Colorado at Boulder   303-492-3872