6.0.0-beta6
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
4/10/26
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#8435] lots of "DB Error: unknown error: INSERT INTO" when Horde_Cache is enabled
*
Your Email Address
*
Spam protection
Enter the letters below:
\ /.__ . . ..__. >< [__)| |\/|[__] / \| \|___| || |
Comment
> If we change Horde_Cache_sql->set() method to get backtrace: > > > > horde/lib/Horde/Cache/sql.php > > > > function set($key, $data, $lifetime = null) > > { > > ... > > $result = $this->_write_db->query($query, $values); > > if (is_a($result, 'PEAR_Error')) { > > // debug > > debug_print_backtrace(); > > print "<br>\n********$data#######<br>\n"; > > //debug > > Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR); > > return false; > > } > > > > return true; > > } > > > > we'll find for these type of errors: > > > > [imp] DB Error: unknown error: > > INSERT INTO horde_cache (cache_id, cache_timestamp, cache_expiration, > cache_data) > > VALUES ('8c2efd26a50e2900dc587d3922519a65', 1249954083, 1250040483, FALSE) > > [nativecode=ERROR: column "cache_data" is of type text but > expression is of type boolean HINT: You will need to rewrite or cast > the expression.] > > [pid 4142 on line 226 of > "/var/www/localhost/htdocs/horde/lib/Horde/Cache/sql.php"] > > > > backtraces like these: > > > > #0 Horde_Cache_sql->set(perm_exists_imp:create_folders, ) called at > [/var/www/horde_test/htdocs/horde/lib/Horde/Perms/datatree.php:202] > > #1 Perms_datatree->exists(imp:create_folders) called at > [/var/www/horde_test/htdocs/horde/imp/lib/IMP.php:876] > > #2 IMP::hasPermission(create_folders) called at > [/var/www/horde_test/htdocs/horde/imp/lib/IMP.php:588] > > #3 IMP::flistSelect(Messages to, 1, Array (), , 1, 1, , 1) called at > [/var/www/horde_test/htdocs/horde/imp/mailbox.php:304] > > ********####### > > #0 Horde_Cache_sql->set(perm_exists_imp:max_folders, ) called at > [/var/www/horde_test/htdocs/horde/lib/Horde/Perms/datatree.php:202] > > #1 Perms_datatree->exists(imp:max_folders) called at > [/var/www/horde_test/htdocs/horde/imp/lib/IMP.php:876] > > #2 IMP::hasPermission(max_folders) called at > [/var/www/horde_test/htdocs/horde/imp/lib/IMP.php:589] > > #3 IMP::flistSelect(Messages to, 1, Array (), , 1, 1, , 1) called at > [/var/www/horde_test/htdocs/horde/imp/mailbox.php:304] > > ********####### > > > > There are two ways to storage permissions: datatree and sql. > > If we change backend for permissions to sql, then errors will disappear. > > > > If we compare code for "Perms_[datatree/sql]->set()": > > > > horde/lib/Horde/Perms/sql.php > > ------------------ > > function exists($permission) > > { > > $key = 'perm_exists_' . $permission; > > $exists = $this->_cache->get($key, > $GLOBALS['conf']['cache']['default_lifetime']); > > if ($exists === false) { > > $this->_connect(); > > $query = 'SELECT COUNT(*) FROM horde_perms WHERE perm_name = ?'; > > $exists = $this->_db->getOne($query, array($permission)); > > if (is_a($exists, 'PEAR_Error')) { > > return $exists; > > } > > > > $this->_cache->set($key, $exists); > > } > > > > return (bool)$exists; > > } > > > > horde/lib/Horde/Perms/datatree.php > > ------------------- > > function exists($permission) > > { > > $key = 'perm_exists_' . $permission; > > $exists = $this->_cache->get($key, > $GLOBALS['conf']['cache']['default_lifetime']); > > if ($exists === false) { > > $exists = $this->_datatree->exists($permission); > > $this->_cache->set($key, $exists); > > } > > > > return (bool)$exists; > > } > > > > It seems that reason for errors is lack of return value check in > horde/lib/Horde/Perms/datatree.php > > after "$exists = $this->_datatree->exists($permission)" call before > "_cache->set()" like in Perms/sql.php backend. > > > > Simple workaround. > > Change backend for permission from datatree to SQL , login to the > horde to create entries for create_folders, max_folders, change > driver back to datatree.
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers