6.0.0-git
2019-04-21

[#9027] Invalid db resources after rewrite
Summary Invalid db resources after rewrite
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners slusarz (at) horde (dot) org
Requester jan (at) horde (dot) org
Created 2010-05-14 (3264 days ago)
Due
Updated 2010-06-15 (3232 days ago)
Assigned 2010-05-14 (3264 days ago)
Resolved 2010-06-15 (3232 days ago)
Milestone
Patch No

History
2010-06-15 15:22:25 Jan Schneider Comment #10
State ⇒ Resolved
Reply to this comment
Looks like this has been fixed along the way.
2010-05-20 17:18:11 Michael Slusarz Comment #9 Reply to this comment
There's progress, the error comes from a different place now, and is 
no longer fatal :)
I can create the calendars just fine now, but in the logs I see:

2010-05-19T14:22:52+02:00 ERR: HEADHORDE [kronolith] Failed checking 
prefs for jan: DB Error: no database selected [pid 30003 on line 191 
of "/home/jan/horde-git/framework/Prefs/lib/Horde/Prefs/Sql.php"]
Prefs is still using PEAR DB.

FWIW, I don't see any of these errors when using stuff that relies on 
the PEAR DB binder.  I am using Postgres though, so this might solely 
be a Mysql issue.
2010-05-19 12:25:18 Jan Schneider Comment #8 Reply to this comment
There's progress, the error comes from a different place now, and is 
no longer fatal :)
I can create the calendars just fine now, but in the logs I see:

2010-05-19T14:22:52+02:00 ERR: HEADHORDE [kronolith] Failed checking 
prefs for jan: DB Error: no database selected [pid 30003 on line 191 
of "/home/jan/horde-git/framework/Prefs/lib/Horde/Prefs/Sql.php"]
2010-05-18 17:29:25 Michael Slusarz Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

Use Horde_Db
Bug #9027: Possible fix to Horde_Alarm SQL issue
Avoiding PEAR DB debugging by simply converting to Horde_Db.  Maybe 
this will work?
2010-05-18 17:17:14 Git Commit Comment #6 Reply to this comment
Changes have been made in Git for this ticket:

Use Horde_Db
Bug #9027: Possible fix to Horde_Alarm SQL issue

http://git.horde.org/diff.php/framework/Alarm/lib/Horde/Alarm/Sql.php?rt=horde-git&r1=b4ba6ed538947767af0304941d7c9fc93caad90d&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Alarm/package.xml?rt=horde-git&r1=a348a83b40a5653c565640fce45976a7c8d41cac&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Cache/lib/Horde/Cache/Sql.php?rt=horde-git&r1=b4ba6ed538947767af0304941d7c9fc93caad90d&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Cache/package.xml?rt=horde-git&r1=40e6e5beecbd4b69b590afaecbde1adf662ea3dc&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Alarm.php?rt=horde-git&r1=c185c64bc1d178d54ef2c22de3d7a806677f5b03&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Cache.php?rt=horde-git&r1=c185c64bc1d178d54ef2c22de3d7a806677f5b03&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Lock.php?rt=horde-git&r1=c185c64bc1d178d54ef2c22de3d7a806677f5b03&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Perms.php?rt=horde-git&r1=c185c64bc1d178d54ef2c22de3d7a806677f5b03&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Token.php?rt=horde-git&r1=c185c64bc1d178d54ef2c22de3d7a806677f5b03&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Db/lib/Horde/Db/Adapter/Base.php?rt=horde-git&r1=5d6be5721093385fbe36f81ab7b6053ad0a5a042&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Db/lib/Horde/Db/Adapter/Pdo/Oci.php?rt=horde-git&r1=1a310b2de34193b3f984e4506d87b32de412a65e&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Lock/lib/Horde/Lock/Sql.php?rt=horde-git&r1=b4ba6ed538947767af0304941d7c9fc93caad90d&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Lock/package.xml?rt=horde-git&r1=7994594b3db35ca7478d608131d8faa214900fb5&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Perms/lib/Horde/Perms/Permission/SqlObject.php?rt=horde-git&r1=6f08cdbb1653c8c573e823589f7d83652e8cc739&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Perms/lib/Horde/Perms/Sql.php?rt=horde-git&r1=b4ba6ed538947767af0304941d7c9fc93caad90d&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Token/lib/Horde/Token/Sql.php?rt=horde-git&r1=4e98bb8db00f25a81403f912c2ca515c85a3c598&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/framework/Token/package.xml?rt=horde-git&r1=69d631396c9c6560805bd0aadf8f775797a45f2d&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/imp/lib/Injector/Binder/Sentmail.php?rt=horde-git&r1=f92994a77d09b7d2badebcf5d55404a74820b7ca&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
http://git.horde.org/diff.php/imp/lib/Sentmail/Sql.php?rt=horde-git&r1=8763512795317061d4cef961637aeb2df6bcd6f4&r2=c5a17f712a86e81377a1f81a28c3d2c38597d869
2010-05-14 21:48:38 Jan Schneider Comment #5 Reply to this comment
Unfortunately not.
2010-05-14 19:03:17 Michael Slusarz Comment #4
State ⇒ Feedback
Reply to this comment
Any chance this fixes things?
2010-05-14 19:02:51 Git Commit Comment #3 Reply to this comment
Changes have been made in Git for this ticket:

Bug #9027: Use Horde_Db_Pear binder to get DB objects

  delete mode 100644 framework/Core/lib/Horde/Core/Binder/Common.php
  create mode 100644 framework/Core/lib/Horde/Core/Binder/DbPear.php
  create mode 100644 framework/Core/lib/Horde/Core/Factory/DbPear.php
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Alarm.php?rt=horde-git&r1=9aab052c54d35a272e7c2799042243990ef60fbb&r2=c185c64bc1d178d54ef2c22de3d7a806677f5b03
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Cache.php?rt=horde-git&r1=40e6e5beecbd4b69b590afaecbde1adf662ea3dc&r2=c185c64bc1d178d54ef2c22de3d7a806677f5b03
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Common.php?rt=horde-git&r1=ff69ab061e00228d254232bc0049828415bfebef&r2=c185c64bc1d178d54ef2c22de3d7a806677f5b03
http://git.horde.org/co.php/framework/Core/lib/Horde/Core/Binder/DbPear.php?rt=horde-git&r=c185c64bc1d178d54ef2c22de3d7a806677f5b03
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Lock.php?rt=horde-git&r1=9aab052c54d35a272e7c2799042243990ef60fbb&r2=c185c64bc1d178d54ef2c22de3d7a806677f5b03
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Perms.php?rt=horde-git&r1=9aab052c54d35a272e7c2799042243990ef60fbb&r2=c185c64bc1d178d54ef2c22de3d7a806677f5b03
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/SessionHandler.php?rt=horde-git&r1=9aab052c54d35a272e7c2799042243990ef60fbb&r2=c185c64bc1d178d54ef2c22de3d7a806677f5b03
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Token.php?rt=horde-git&r1=9aab052c54d35a272e7c2799042243990ef60fbb&r2=c185c64bc1d178d54ef2c22de3d7a806677f5b03
http://git.horde.org/co.php/framework/Core/lib/Horde/Core/Factory/DbPear.php?rt=horde-git&r=c185c64bc1d178d54ef2c22de3d7a806677f5b03
http://git.horde.org/diff.php/framework/Core/lib/Horde/Registry.php?rt=horde-git&r1=fd6f247c888a218953c7c19fe6cfe0d15aa69540&r2=c185c64bc1d178d54ef2c22de3d7a806677f5b03
http://git.horde.org/diff.php/framework/Core/package.xml?rt=horde-git&r1=9aab052c54d35a272e7c2799042243990ef60fbb&r2=c185c64bc1d178d54ef2c22de3d7a806677f5b03
2010-05-14 17:57:58 Jan Schneider Comment #2 Reply to this comment
The error message is misleading, because the real error is:
Warning: mysql_select_db(): 90 is not a valid MySQL-Link resource in 
/usr/local/apache/php/lib/php/DB/mysql.php on line 307
2010-05-14 17:57:20 Jan Schneider Comment #1
Type ⇒ Bug
State ⇒ Assigned
Priority ⇒ 2. Medium
Summary ⇒ Invalid db resources after rewrite
Queue ⇒ Horde Framework Packages
Assigned to Michael Slusarz
Milestone ⇒
Patch ⇒ No
Reply to this comment
Since the recent DB rewrite including Horde_Core_Binder_Common, I get 
some problems with invalid db link resources. This happens for example 
when creating new calendars through the ajax interface, when the 
alarm's listAlarms() is triggered. Here's a full backtrace:

DB Error: no database selected

[Zeile 104 von /home/jan/sapo/horde/framework/Alarm/lib/Horde/Alarm/Sql.php]
Details:
The full error message is logged in Horde's log file, and is shown 
below only to administrators. Non-administrative users will not see 
error details.

Horde_Alarm_Exception Object
(
     [message:protected] => DB Error: no database selected
     [string:Exception:private] =>
     [code:protected] => -14
     [file:protected] => 
/home/jan/sapo/horde/framework/Alarm/lib/Horde/Alarm/Sql.php
     [line:protected] => 104
     [trace:Exception:private] => Array
         (
             [0] => Array
                 (
                     [file] => 
/home/jan/sapo/horde/framework/Alarm/lib/Horde/Alarm.php
                     [line] => 180
                     [function] => _list
                     [class] => Horde_Alarm_Sql
                     [type] => ->
                     [args] => Array
                         (
                             [0] => jan
                             [1] => Horde_Date Object
                                 (
                                     [_year:protected] => 2010
                                     [_month:protected] => 5
                                     [_mday:protected] => 14
                                     [_hour:protected] => 17
                                     [_min:protected] => 53
                                     [_sec:protected] => 17
                                     [_timezone:protected] => UTC
                                     [_defaultFormat:protected] => Y-m-d H:i:s
                                     [_formatCache:protected] => Array
                                         (
                                             [Y-m-d\TH:i:s] => 
2010-05-14T17:53:17
                                         )

                                 )

                         )

                 )

             [1] => Array
                 (
                     [file] => 
/home/jan/sapo/horde/framework/Alarm/lib/Horde/Alarm.php
                     [line] => 457
                     [function] => listAlarms
                     [class] => Horde_Alarm
                     [type] => ->
                     [args] => Array
                         (
                             [0] => jan
                             [1] =>
                             [2] => 1
                             [3] => 1
                         )

                 )

             [2] => Array
                 (
                     [file] => 
/home/jan/sapo/horde/framework/Notification/lib/Horde/Notification/Handler/Decorator/Alarm.php
                     [line] => 54
                     [function] => notify
                     [class] => Horde_Alarm
                     [type] => ->
                     [args] => Array
                         (
                             [0] => jan
                         )

                 )

             [3] => Array
                 (
                     [file] => 
/home/jan/sapo/horde/framework/Notification/lib/Horde/Notification/Handler.php
                     [line] => 284
                     [function] => notify
                     [class] => Horde_Notification_Handler_Decorator_Alarm
                     [type] => ->
                     [args] => Array
                         (
                             [0] => Array
                                 (
                                     [listeners] => Array
                                         (
                                             [0] => status
                                         )

                                     [raw] => 1
                                 )

                         )

                 )

             [4] => Array
                 (
                     [file] => 
/home/jan/sapo/horde/framework/Core/lib/Horde.php
                     [line] => 510
                     [function] => notify
                     [class] => Horde_Notification_Handler
                     [type] => ->
                     [args] => Array
                         (
                             [0] => Array
                                 (
                                     [listeners] => status
                                     [raw] => 1
                                 )

                         )

                 )

             [5] => Array
                 (
                     [file] => /home/jan/sapo/horde/horde/services/ajax.php
                     [line] => 68
                     [function] => prepareResponse
                     [class] => Horde
                     [type] => ::
                     [args] => Array
                         (
                             [0] => stdClass Object
                                 (
                                     [perms] => Array
                                         (
                                             [users] => Array
                                                 (
                                                 )

                                             [type] => matrix
                                             [default] => 0
                                             [guest] => 0
                                             [creator] => 0
                                             [groups] => Array
                                                 (
                                                 )

                                         )

                                     [calendar] => 
6d8e0e1e4810603bfa69b50e2740e48c
                                     [saved] => 1
                                     [color] => #000
                                 )

                             [1] => 1
                         )

                 )

         )

     [previous:Exception:private] =>
     [xdebug_message] => <tr><th align='left' bgcolor='#f57900' 
colspan="5"><span style='background-color: #cc0000; color: #fce94f; 
font-size: x-large;'>( ! )</span> Horde_Alarm_Exception: DB Error: no 
database selected in 
/home/jan/sapo/horde/framework/Alarm/lib/Horde/Alarm/Sql.php on line 
<i>104</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' 
bgcolor='#eeeeec'>Time</th><th align='left' 
bgcolor='#eeeeec'>Memory</th><th align='left' 
bgcolor='#eeeeec'>Function</th><th align='left' 
bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' 
align='center'>0,0004</td><td bgcolor='#eeeeec' 
align='right'>350316</td><td bgcolor='#eeeeec'>{main}(  )</td><td 
title='/home/jan/sapo/horde/horde/services/ajax.php' 
bgcolor='#eeeeec'>../ajax.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' 
align='center'>0,3945</td><td bgcolor='#eeeeec' 
align='right'>14406472</td><td 
bgcolor='#eeeeec'>Horde::prepareResponse(  )</td><td 
title='/home/jan/sapo/horde/horde/services/ajax.php' 
bgcolor='#eeeeec'>../ajax.php<b>:</b>68</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' 
align='center'>0,3945</td><td bgcolor='#eeeeec' 
align='right'>14406952</td><td 
bgcolor='#eeeeec'>Horde_Notification_Handler->notify(  )</td><td 
title='/home/jan/sapo/horde/framework/Core/lib/Horde.php' 
bgcolor='#eeeeec'>../Horde.php<b>:</b>510</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' 
align='center'>0,3946</td><td bgcolor='#eeeeec' 
align='right'>14407332</td><td 
bgcolor='#eeeeec'>Horde_Notification_Handler_Decorator_Alarm->notify(   
)</td><td 
title='/home/jan/sapo/horde/framework/Notification/lib/Horde/Notification/Handler.php' 
bgcolor='#eeeeec'>../Handler.php<b>:</b>284</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' 
align='center'>0,3946</td><td bgcolor='#eeeeec' 
align='right'>14407332</td><td bgcolor='#eeeeec'>Horde_Alarm->notify(   
)</td><td 
title='/home/jan/sapo/horde/framework/Notification/lib/Horde/Notification/Handler/Decorator/Alarm.php' 
bgcolor='#eeeeec'>../Alarm.php<b>:</b>54</td></tr>

)

Saved Queries