6.0.0-alpha12
6/12/25

[#9151] Kronolith, Nag, Mnemo, Turba don't work with Oracle DB
Summary Kronolith, Nag, Mnemo, Turba don't work with Oracle DB
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Not A Bug
Priority 2. Medium
Owners Horde Developers (at) , jan (at) horde (dot) org, mrubinsk (at) horde (dot) org
Requester robert (at) databee (dot) org
Created 07/27/2010 (5434 days ago)
Due
Updated 12/12/2011 (4931 days ago)
Assigned 02/20/2011 (5226 days ago)
Resolved 12/12/2011 (4931 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/12/2011 04:42:31 PM Jan Schneider Comment #29
State ⇒ Not A Bug
Reply to this comment
Oracle support has been removed for Horde 4 for now.
02/20/2011 01:56:22 AM Chuck Hagenbuch Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
08/18/2010 06:12:57 PM robert (at) databee (dot) org Comment #28 Reply to this comment
I spent the whole day debugging and trying out stuff...
The following is as far as I got with the Problem:

All Database-Connections except one work fine.
It narrows done to the function _connect() in file 
horde-webmail-1.2.6/lib/Horde/Share/sql.php

I added the following check:
         $query  = 'select sysdate from dual';
         $result = $this->_write_db->query($query);
         if (is_a($result, 'PEAR_Error')) {
             Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
             Horde::logMessage(sprintf('RMZ: Error _write_db %s', 
print_r($this->_write_db, true)), __FILE__, __LINE__, PEAR_LOG_NOTICE);
             return $result;
         }

and it always fails at this point.

I positive example is the  function &listShares in the same file 
(roughly line 450..)
This one always works.

I'm not sure, what's failing, but the main functionality - adding, 
modfiying and viewing addresses, events and memos - is available.
So the connection does work most of the time.

I added a print_r($this->_write_db, true) for both - a working 
connection and a failing, but there is not much of a difference...

If I have to guess, I would say, that there is one more of these 
thingies missing:

             switch ($this->_write_db->phptype) {
             case 'oci8':
                 $this->_write_db->setOption('emulate_database', false);
                 break;

But I have no idea where.

So for your debúgging-pleasure, here is a extract from my log, first 
working, then failing:
I do use this connect-information: 
horde/HORDE@dwo/dbrmz.robbienet.local, where horde is the user, HORDE 
the password, dwo the host and dbrmz.robbienet.local the database 
service name.

-------------------------------------------------------------------------------------------
Working Connection:
cat error-db.txt
Aug 18 18:44:36 HORDE [notice] [kronolith] RMZ: Working _db 
MDB2_Driver_oci8 Object
(
     [string_quoting] => Array
         (
             [start] => '
             [end] => '
             [escape] => '
             [escape_pattern] => @
         )

     [identifier_quoting] => Array
         (
             [start] => "
             [end] => "
             [escape] => "
         )

     [uncommitedqueries] => 0
     [db_index] => 1
     [dsn] => Array
         (
             [phptype] => oci8
             [dbsyntax] => oci8
             [username] => horde
             [password] => HORDE
             [protocol] =>
             [hostspec] =>
             [port] =>
             [socket] =>
             [database] =>
             [mode] =>
             [persistent] =>
         )

     [connected_dsn] => Array
         (
             [phptype] => oci8
             [dbsyntax] => oci8
             [username] => horde
             [password] => HORDE
             [protocol] =>
             [hostspec] =>
             [port] =>
             [socket] =>
             [database] =>
             [mode] =>
             [persistent] =>
         )

     [connection] => Resource id #34
     [opened_persistent] =>
     [database_name] => dwo/dbrmz.robbienet.local
     [connected_database_name] =>
     [connected_server_info] =>
     [supported] => Array
         (
             [sequences] => 1
             [indexes] => 1
             [affected_rows] => 1
             [summary_functions] => 1
             [order_by_text] => 1
             [transactions] => 1
             [savepoints] => 1
             [current_id] => 1
             [limit_queries] => 1
             [LOBs] => 1
             [replace] => emulated
             [sub_selects] => 1
             [triggers] => 1
             [auto_increment] =>
             [primary_key] => 1
             [result_introspection] => 1
             [prepared_statements] => 1
             [identifier_quoting] => 1
             [pattern_escaping] => 1
             [new_link] => 1
         )

     [options] => Array
         (
             [ssl] =>
             [field_case] => 0
             [disable_query] =>
             [result_class] => MDB2_Result_%s
             [buffered_result_class] => MDB2_BufferedResult_%s
             [result_wrap_class] =>
             [result_buffering] => 1
             [fetch_class] => stdClass
             [persistent] =>
             [debug] => 1
             [debug_handler] => Array
                 (
                     [0] => Horde_Share_sql Object
                         (
                             [_db] => MDB2_Driver_oci8 Object
  *RECURSION*
                             [_write_db] => MDB2_Driver_oci8 Object
  *RECURSION*
                             [_params] => Array
                                 (
                                     [persistent] =>
                                     [username] => horde
                                     [password] => HORDE
                                     [database] => dwo/dbrmz.robbienet.local
                                     [charset] => utf-8
                                     [phptype] => oci8
                                     [hostspec] =>
                                 )

                             [_table] => kronolith_shares
                             [_shareObject] => Horde_Share_Object_sql
                             [_app] => kronolith
                             [_root] =>
                             [_cache] => Array
                                 (
                                 )

                             [_shareMap] => Array
                                 (
                                 )

                             [_listcache] => Array
                                 (
                                 )

                             [_sortList] =>
                         )

                     [1] => _selectDB
                 )

             [debug_expanded_output] =>
             [default_text_field_length] => 2000
             [lob_buffer_length] => 8192
             [log_line_break] =>

             [idxname_format] => %s_idx
             [seqname_format] => %s_seq
             [savepoint_format] => MDB2_SAVEPOINT_%s
             [statement_format] => MDB2_STATEMENT_%1$s_%2$s
             [seqcol_name] => id
             [quote_identifier] =>
             [use_transactions] => 1
             [decimal_places] => 2
             [portability] => 81
             [modules] => Array
                 (
                     [ex] => Extended
                     [dt] => Datatype
                     [mg] => Manager
                     [rv] => Reverse
                     [na] => Native
                     [fc] => Function
                 )

             [emulate_prepared] =>
             [datatype_map] => Array
                 (
                 )

             [datatype_map_callback] => Array
                 (
                 )

             [nativetype_map_callback] => Array
                 (
                 )

             [lob_allow_url_include] =>
             [bindname_format] => (?:\d+)|(?:[a-zA-Z][a-zA-Z0-9_]*)
             [max_identifiers_length] => 30
             [default_fk_action_onupdate] => RESTRICT
             [default_fk_action_ondelete] => RESTRICT
             [DBA_username] =>
             [DBA_password] =>
             [database_name_prefix] =>
             [emulate_database] =>
             [default_tablespace] =>
             [result_prefetching] =>
         )

     [sql_comments] => Array
         (
             [0] => Array
                 (
                     [start] => --
                     [end] =>

                     [escape] =>
                 )

             [1] => Array
                 (
                     [start] => /*
                     [end] => */
                     [escape] =>
                 )

         )

     [wildcards] => Array
         (
             [0] => %
             [1] => _
         )

     [as_keyword] =>  AS
     [warnings] => Array
         (
         )

     [debug_output] =>
     [in_transaction] =>
     [nested_transaction_counter] =>
     [has_transaction_error] =>
     [offset] => 0
     [limit] => 0
     [phptype] => oci8
     [dbsyntax] => oci8
     [last_query] => SELECT DISTINCT s.*  FROM kronolith_shares s   
LEFT JOIN kronolith_shares_users u ON u.share_id = s.share_id WHERE 
s.share_owner = 'rmarz' OR (bitand(s.perm_creator, 2) = 2) OR 
(bitand(s.perm_default, 2) = 2) OR ( u.user_uid = 'rmarz' AND 
(bitand(u.perm, 2) = 2)) ORDER BY s.attribute_name ASC
     [fetchmode] => 1
     [modules] => Array
         (
             [Datatype] => MDB2_Driver_Datatype_oci8 Object
                 (
                     [valid_default_values] => Array
                         (
                             [text] =>
                             [boolean] => 1
                             [integer] => 0
                             [decimal] => 0
                             [float] => 0
                             [timestamp] => 1970-01-01 00:00:00
                             [time] => 00:00:00
                             [date] => 1970-01-01
                             [clob] =>
                             [blob] =>
                         )

                     [lobs] => Array
                         (
                         )

                     [db_index] => 1
                 )

         )

     [destructor_registered] => 1
     [_debug] =>
     [_default_error_mode] =>
     [_default_error_options] =>
     [_default_error_handler] =>
     [_error_class] => PEAR_Error
     [_expected_errors] => Array
         (
         )

     [datatype] => MDB2_Driver_Datatype_oci8 Object
         (
             [valid_default_values] => Array
                 (
                     [text] =>
                     [boolean] => 1
                     [integer] => 0
                     [decimal] => 0
                     [float] => 0
                     [timestamp] => 1970-01-01 00:00:00
                     [time] => 00:00:00
                     [date] => 1970-01-01
                     [clob] =>
                     [blob] =>
                 )

             [lobs] => Array
                 (
                 )

             [db_index] => 1
         )

     [loaded_version_modules] => Array
         (
             [0] => datatype
         )

)
  [pid 17321 on line 479 of 
"/home/horde/horde-webmail-1.2.6/lib/Horde/Share/sql.php"]

---------------------------------------------------------------------------------------
Failing connection:
cat error-db.txt
Aug 18 18:44:36 HORDE [error] [kronolith] MDB2 Error: not found: 
[Error message: Could not select the database: 
dwo/dbrmz.robbienet.local]
  [pid 17321 on line 835 of 
"/home/horde/horde-webmail-1.2.6/lib/Horde/Share/sql.php"]
Aug 18 18:44:36 HORDE [notice] [kronolith] RMZ: Error _write_db 
MDB2_Driver_oci8 Object
(
     [string_quoting] => Array
         (
             [start] => '
             [end] => '
             [escape] => '
             [escape_pattern] => @
         )

     [identifier_quoting] => Array
         (
             [start] => "
             [end] => "
             [escape] => "
         )

     [uncommitedqueries] => 0
     [db_index] => 1
     [dsn] => Array
         (
             [phptype] => oci8
             [dbsyntax] => oci8
             [username] => horde
             [password] => HORDE
             [protocol] =>
             [hostspec] =>
             [port] =>
             [socket] =>
             [database] =>
             [mode] =>
             [persistent] =>
         )

     [connected_dsn] => Array
         (
             [phptype] => oci8
             [dbsyntax] => oci8
             [username] => horde
             [password] => HORDE
             [protocol] =>
             [hostspec] =>
             [port] =>
             [socket] =>
             [database] =>
             [mode] =>
             [persistent] =>
         )

     [connection] => Resource id #34
     [opened_persistent] =>
     [database_name] => dwo/dbrmz.robbienet.local
     [connected_database_name] =>
     [connected_server_info] =>
     [supported] => Array
         (
             [sequences] => 1
             [indexes] => 1
             [affected_rows] => 1
             [summary_functions] => 1
             [order_by_text] => 1
             [transactions] => 1
             [savepoints] => 1
             [current_id] => 1
             [limit_queries] => 1
             [LOBs] => 1
             [replace] => emulated
             [sub_selects] => 1
             [triggers] => 1
             [auto_increment] =>
             [primary_key] => 1
             [result_introspection] => 1
             [prepared_statements] => 1
             [identifier_quoting] => 1
             [pattern_escaping] => 1
             [new_link] => 1
         )

     [options] => Array
         (
             [ssl] =>
             [field_case] => 0
             [disable_query] =>
             [result_class] => MDB2_Result_%s
             [buffered_result_class] => MDB2_BufferedResult_%s
             [result_wrap_class] =>
             [result_buffering] => 1
             [fetch_class] => stdClass
             [persistent] =>
             [debug] => 1
             [debug_handler] => Array
                 (
                     [0] => Horde_Share_sql Object
                         (
                             [_db] => MDB2_Driver_oci8 Object
  *RECURSION*
                             [_write_db] => MDB2_Driver_oci8 Object
  *RECURSION*
                             [_params] => Array
                                 (
                                     [persistent] =>
                                     [username] => horde
                                     [password] => HORDE
                                     [database] => dwo/dbrmz.robbienet.local
                                     [charset] => utf-8
                                     [phptype] => oci8
                                     [hostspec] =>
                                 )

                             [_table] => kronolith_shares
                             [_shareObject] => Horde_Share_Object_sql
                             [_app] => kronolith
                             [_root] =>
                             [_cache] => Array
                                 (
                                 )

                             [_shareMap] => Array
                                 (
                                 )

                             [_listcache] => Array
                                 (
                                 )

                             [_sortList] =>
                         )

                     [1] => _selectDB
                 )

             [debug_expanded_output] =>
             [default_text_field_length] => 2000
             [lob_buffer_length] => 8192
             [log_line_break] =>

             [idxname_format] => %s_idx
             [seqname_format] => %s_seq
             [savepoint_format] => MDB2_SAVEPOINT_%s
             [statement_format] => MDB2_STATEMENT_%1$s_%2$s
             [seqcol_name] => id
             [quote_identifier] =>
             [use_transactions] => 1
             [decimal_places] => 2
             [portability] => 81
             [modules] => Array
                 (
                     [ex] => Extended
                     [dt] => Datatype
                     [mg] => Manager
                     [rv] => Reverse
                     [na] => Native
                     [fc] => Function
                 )

             [emulate_prepared] =>
             [datatype_map] => Array
                 (
                 )

             [datatype_map_callback] => Array
                 (
                 )

             [nativetype_map_callback] => Array
                 (
                 )

             [lob_allow_url_include] =>
             [bindname_format] => (?:\d+)|(?:[a-zA-Z][a-zA-Z0-9_]*)
             [max_identifiers_length] => 30
             [default_fk_action_onupdate] => RESTRICT
             [default_fk_action_ondelete] => RESTRICT
             [DBA_username] =>
             [DBA_password] =>
             [database_name_prefix] =>
             [emulate_database] =>
             [default_tablespace] =>
             [result_prefetching] =>
         )

     [sql_comments] => Array
         (
             [0] => Array
                 (
                     [start] => --
                     [end] =>

                     [escape] =>
                 )

             [1] => Array
                 (
                     [start] => /*
                     [end] => */
                     [escape] =>
                 )

         )

     [wildcards] => Array
         (
             [0] => %
             [1] => _
         )

     [as_keyword] =>  AS
     [warnings] => Array
         (
         )

     [debug_output] =>
     [in_transaction] =>
     [nested_transaction_counter] =>
     [has_transaction_error] =>
     [offset] => 0
     [limit] => 0
     [phptype] => oci8
     [dbsyntax] => oci8
     [last_query] => ALTER SESSION SET CURRENT_SCHEMA = 
"DWO/DBRMZ.ROBBIENET.LOCAL"
     [fetchmode] => 1
     [modules] => Array
         (
         )

     [destructor_registered] => 1
     [_debug] =>
     [_default_error_mode] =>
     [_default_error_options] =>
     [_default_error_handler] =>
     [_error_class] => PEAR_Error
     [_expected_errors] => Array
         (
         )

)
  [pid 17321 on line 836 of 
"/home/horde/horde-webmail-1.2.6/lib/Horde/Share/sql.php"]


08/15/2010 04:08:58 PM Michael Rubinsky Comment #27 Reply to this comment
via email:

Hi,

I'm trying to update the ticket, but the website won't let me - always 
complaining about the wrong captcha...

anyway, her goes the text:

Problem is still there, but my workaround fixes it for me.
Unfortunatly I've been very busy in my job for the last 2 weeks and 
still not through with it...

Oracle released a new OCI8 driver last week - will try that and figure 
out in the documentation, what the parameters realy mean...
I plan to do a fresh installation from git and try to trace it bit by bit...

I'm good at Oracle but have absolutly no experience with php...

regards

Robert

--

08/14/2010 03:02:09 PM Michael Rubinsky Comment #26 Reply to this comment
Ping? Any new data, or is this resolved for the OP?
07/29/2010 07:13:51 PM Michael Rubinsky Comment #24 Reply to this comment
Yes, we purposefully set the conncted_database_name to '' in the sql 
share driver. This is to workaround an issue with MDB2  not being able 
to detect when a database connection changes external to it's code. 
See Bug: 6997 for more detail on this.  What is supposed to happen is 
MDB2 re-selects the database in this case. That is what the commented 
out code is doing. I have no idea why it's failing, as 
$this->database_name should be the correct name to connect to. That 
being said, I'm no oracle expert, so I can't speak to the correctness 
of the statement being performed there.

See if you can add the line:

var_dump($result);

right before the PEAR::isError() statement to see if you can get a 
more detailed error message. Unfortunately, if the issue is with code 
in this file, it's not a Horde issue - as this is from PEAR.


07/29/2010 06:02:28 PM robert (at) databee (dot) org Comment #23 Reply to this comment
I did some debugging:

the error is thrown in the connect() function of
pear/php/MDB2/Driver/oci8.php
The function starts at line 429.

The problem is the following part:

//        if ($this->database_name) {
//            if ($this->database_name != $this->connected_database_name) {
//                $query = 'ALTER SESSION SET CURRENT_SCHEMA = "' 
.strtoupper($this->database_name) .'"';
//                $result =& $this->_doQuery($query);
//                if (PEAR::isError($result)) {
//                    $err = $this->raiseError($result, null, null,
//                        'Could not select the database: 
'.$this->database_name, __FUNCTION__);
//                    return $err;
//                }
                 $this->connected_database_name = $this->database_name;
//            }
//        }


As you can see, I uncommented all, except for on line.
I do have no errors any more in the log and have all features available.
But, this is only my workaround and cannot be the final fix.

What is done here, as far as I figured out:
It checks, if this->database_name is set, and if so if it is different 
then $this->connected_database_name, which is always true, because 
$this->connected_database_name is set to an empty string a few lines 
above.

With these conditions fulfilled, it assumes, that we have to switch to 
a different schema inside the oracle database and issues a "ALTER 
SESSION SET CURRENT_SCHEMA" which has to fail, because 
this->database_name is set to the connect-string.

It can succeed, only when I connect to schema HORDE inside a database 
named horde using a tnsnames.ora. That is not unlikely to happen in a 
testing environment...

I think, a few days ago, I saw inside the code, that at some place 
this->database_name was set to an empty string aftre a successfull 
connect- which at that time didn't made sense to me - but I can't find 
it any more.

Again, my php-knowledge ends here and I have to pass the ball back to you...

07/28/2010 07:36:29 PM robert (at) databee (dot) org Comment #22 Reply to this comment
Her comes the log:

Jul 28 21:27:00 HORDE [debug] [kronolith] Hook _horde_hook_share_init 
in application horde not called. [pid 7571 on line 1736 of 
"/home/horde/horde-webmail-1.2.6/lib/Horde.php"]
Jul 28 21:27:00 HORDE [debug] [kronolith] SQL query by 
Horde_Share_sql::listShares: SELECT DISTINCT s.*  FROM 
kronolith_shares s  LEFT JOIN kronolith_shares_users u ON u.share_id = 
s.share_id WHERE s.share_owner = 'rmarz' OR (bitand(s.perm_creator, 2) 
= 2) OR (bitand(s.perm_default, 2) = 2) OR ( u.user_uid = 'rmarz' AND 
(bitand(u.perm, 2) = 2)) ORDER BY s.attribute_name ASC [pid 7571 on 
line 469 of "/home/horde/horde-webmail-1.2.6/lib/Horde/Share/sql.php"]
Jul 28 21:27:00 HORDE [error] [kronolith] MDB2 Error: not found: 
[Error message: Could not select the database: 
dwo/dbrmz.robbienet.local]
  [pid 7571 on line 473 of 
"/home/horde/horde-webmail-1.2.6/lib/Horde/Share/sql.php"]

The query is valid, which is no surprise to me, because the Error 
message is not issued by oracle.

IMHO MDB2 says, that it cannot connect ("select") to the database.
"dwo/dbrmz.robbienet.local" is my connect string (server/databaseServcieName)

07/28/2010 03:53:30 PM Jan Schneider Assigned to Michael Rubinsky
 
07/28/2010 03:29:14 PM Michael Rubinsky Comment #21 Reply to this comment
The query that's causing this error should now be logged in the Horde 
log, can you try again and see if you see anything weird in the query 
that could be causing this in Oracle?
07/28/2010 03:28:17 PM CVS Commit Comment #20 Reply to this comment
07/28/2010 12:11:52 PM Jan Schneider Comment #19 Reply to this comment
You're right, those are forward ports for the Git version.
07/28/2010 12:05:51 PM robert (at) databee (dot) org Comment #18 Reply to this comment
I guess, I shall not apply these patches, do I?
I neither have a file
/ansel/lib/Ansel.php
nor do I have
/framework/Share/lib/Horde/Share/Sql.php

Or am I wrong?

07/28/2010 09:16:46 AM robert (at) databee (dot) org Comment #16 Reply to this comment
Applied imp and Auth patch.
I do not have a file named Ansel.php at all.

IMP errors are gone.

The others remain.
Actual Symptomns: I can create Adresses and Events (find them in the 
database), but cannot see them in the Web.

Error log:

Jul 28 11:10:59 HORDE [error] [kronolith] MDB2 Error: not found: 
[Error message: Could not select the database: 
dwo/dbrmz.robbienet.local]
  [pid 25403 on line 470 of 
"/home/horde/horde-webmail-1.2.6/lib/Horde/Share/sql.php"]
Jul 28 11:10:59 HORDE [error] [kronolith] MDB2 Error: not found: 
[Error message: Could not select the database: 
dwo/dbrmz.robbienet.local]
  [pid 25403 on line 1348 of 
"/home/horde/horde-webmail-1.2.6/kronolith/lib/Kronolith.php"]
Jul 28 11:10:59 HORDE [error] [nag] MDB2 Error: not found: [Error 
message: Could not select the database: dwo/dbrmz.robbienet.local]
  [pid 25403 on line 470 of 
"/home/horde/horde-webmail-1.2.6/lib/Horde/Share/sql.php"]
Jul 28 11:10:59 HORDE [error] [nag] MDB2 Error: not found: [Error 
message: Could not select the database: dwo/dbrmz.robbienet.local]
  [pid 25403 on line 295 of "/home/horde/horde-webmail-1.2.6/nag/lib/Nag.php"]
Jul 28 11:11:05 HORDE [error] [kronolith] MDB2 Error: not found: 
[Error message: Could not select the database: 
dwo/dbrmz.robbienet.local]
  [pid 25403 on line 470 of 
"/home/horde/horde-webmail-1.2.6/lib/Horde/Share/sql.php"]
Jul 28 11:11:05 HORDE [error] [kronolith] MDB2 Error: not found: 
[Error message: Could not select the database: 
dwo/dbrmz.robbienet.local]
  [pid 25403 on line 1348 of 
"/home/horde/horde-webmail-1.2.6/kronolith/lib/Kronolith.php"]
Jul 28 11:11:05 HORDE [error] [nag] MDB2 Error: not found: [Error 
message: Could not select the database: dwo/dbrmz.robbienet.local]
  [pid 25403 on line 470 of 
"/home/horde/horde-webmail-1.2.6/lib/Horde/Share/sql.php"]
Jul 28 11:11:05 HORDE [error] [nag] MDB2 Error: not found: [Error 
message: Could not select the database: dwo/dbrmz.robbienet.local]
  [pid 25403 on line 295 of "/home/horde/horde-webmail-1.2.6/nag/lib/Nag.php"]

07/28/2010 05:20:12 AM Michael Rubinsky Comment #14 Reply to this comment
now?
07/28/2010 05:19:41 AM CVS Commit Comment #13 Reply to this comment
Changes have been made in CVS for this ticket:

Use PEAR DB's limitQuery() method, don't hard code mysql-specific 
LIMIT syntax.
Bug: 9151
http://cvs.horde.org/diff.php/imp/lib/Sentmail/sql.php?rt=horde&r1=1.12.2.2&r2=1.12.2.3&ty=u
07/27/2010 11:38:49 PM robert (at) databee (dot) org Comment #12 Reply to this comment
way better - we're getting close, I think.

Now getting those errors:

Jul 28 01:25:16 HORDE [error] [kronolith] MDB2 Error: not found: 
[Error message: Could not select the database: 
dwo/dbrmz.robbienet.local]
  [pid 8796 on line 1348 of 
"/home/horde/horde-webmail-1.2.6/kronolith/lib/Kronolith.php"]
Jul 28 01:25:16 HORDE [error] [kronolith] MDB2 Error: not found: 
[Error message: Could not select the database: 
dwo/dbrmz.robbienet.local]
  [pid 8742 on line 470 of 
"/home/horde/horde-webmail-1.2.6/lib/Horde/Share/sql.php"]

Have no Idea, what that could mean...

Looking at the log, I found another error:

Jul 28 01:22:43 HORDE [error] [imp] DB Error: unknown error: SELECT 
sentmail_recipient, count(*) AS sentmail_count FROM imp_sentmail WHERE 
sentmail_who = 'rmarz' AND sentm
ail_success = 1 AND sentmail_action in ('new', 'forward', 'reply', 
'redirect') GROUP BY sentmail_recipient ORDER BY sentmail_count DESC 
LIMIT 10 [nativecode=ORA-00933: SQL
  command not properly ended] [pid 4593 on line 120 of 
"/home/horde/horde-webmail-1.2.6/imp/lib/Sentmail/sql.php"]

it is the "LIMIT 10" at the end.
What should that do? Limit the resultset to 10 rows?
"where rownum <10" would do that
I would use no restriction at all and fetch only the first 10 rows...
07/27/2010 11:19:14 PM Michael Rubinsky Comment #11 Reply to this comment
try now?
07/27/2010 11:15:50 PM Git Commit Comment #10 Reply to this comment
Changes have been made in Git for this ticket:

MFB, don't use 'AS' in table aliases.
Some of the changes from CVS were already present in Git, this is the 
remaining changes.

Bug: 9151

http://git.horde.org/diff.php/framework/Share/lib/Horde/Share/Sql/Hierarchical.php?rt=horde-git&r1=df95b1257ff0201b44aec092cdd4d70018beb14f&r2=7ebcfde1f90ad9c41d603ada10c1ef51567852e5
07/27/2010 10:05:56 PM robert (at) databee (dot) org Comment #8 Reply to this comment
tried - worked. Thanks a lot.
Connections to the database are made and its doing inserts and updates.

BUT: Now I got lots of errors like this:

  [pid 8797 on line 470 of 
"/home/horde/horde-webmail-1.2.6/lib/Horde/Share/sql.php"]
Jul 27 23:47:49 HORDE [error] [mnemo] MDB2 Error: unknown error: 
_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT DISTINCT s.*  FROM mnemo_shares s  LEFT 
JOIN mnemo_shares_users AS u ON u.share_id = s.share_id WHERE 
s.share_owner = 'rmarz' OR (bitand(s.per
m_creator, 4) = 4) OR (bitand(s.perm_default, 4) = 4) OR ( u.user_uid 
= 'rmarz' AND (bitand(u.perm, 4) = 4)) ORDER BY s.attribute_name ASC]
[Native code: 905]
[Native message: ORA-00905: missing keyword]

which is caused by the "AS" between table-name and alias in the 
outer-joined table.
In this rare case, Oracle follows hard the sql99-Standard, which says, 
that "as" is allowed for column aliases and does not mention it for 
table-aliases.



07/27/2010 08:17:35 PM Jan Schneider Comment #7
Assigned to Jan Schneider
Reply to this comment
Try this patch?
07/27/2010 08:16:45 PM CVS Commit Comment #6 Reply to this comment
Changes have been made in CVS for this ticket:

Disable emulate_database for MDB2/Oracle (Bug #9151).
http://cvs.horde.org/diff.php/framework/Share/Share/sql.php?rt=horde&r1=1.1.2.58&r2=1.1.2.59&ty=u
07/27/2010 07:15:31 PM robert (at) databee (dot) org Comment #5 Reply to this comment
It was in a file called /lib/Horde/SQL/Manager.php

There is a function:
     function getInstance($dsn = array())
     {
         // Merge local options with Horde database config.
         if (isset($GLOBALS['conf']['sql'])) {
             $dsn = array_merge($GLOBALS['conf']['sql'], $dsn);
         }
         unset($dsn['charset']);
         $options = array('seqcol_name' => 'id',
                          'portability' => MDB2_PORTABILITY_ALL & 
~MDB2_PORTABILITY_FIX_CASE,
                          'force_defaults' => false,
                          'emulate_database' => false);
                          ^^^^^^^^^^^^^^^^^^
This is for sure not the right place for doing so, since it affects 
the other db-drivers, too...

I'm a Oracle Database  Architect/Developer/Administrator, and have no 
experience in php-programming, so I decided at this to leave that to 
the ones who know, what they are doing

07/27/2010 05:15:56 PM Jan Schneider Comment #4 Reply to this comment
The emulate_database option should indeed keep the username from being 
assigned the database name. Where and how did you set it when you 
tried that?
07/27/2010 04:56:09 PM robert (at) databee (dot) org Comment #3 Reply to this comment
Yepp installation went fine, everything is up and running and looks good.
The trouble starts, when you actually trying to do something, like 
create an adressbok.

I See established Connections to my database, querying prefs and alarms.
Tables with data in, that have been read from and written to include
HORDE_ALAMS
HORDE_PREFS
HORDE_TOKENS
IMP_SENTMAIL
INGO_RULES
...
07/27/2010 04:39:42 PM Jan Schneider Version ⇒ FRAMEWORK_3
Queue ⇒ Horde Framework Packages
 
07/27/2010 04:39:28 PM Jan Schneider Comment #2
Summary ⇒ Kronolith, Nag, Mnemo, Turba don't work with Oracle DB
State ⇒ Feedback
Priority ⇒ 2. Medium
Reply to this comment
So, installation went fine and other database access like setting 
preferences works fine? Those don't use MDB2, so the problem is 
probably somewhere in passing the parameters to MDB2. Or rather, like 
you already found out, in passing the parameters inside MDB2.
07/27/2010 01:35:49 PM robert (at) databee (dot) org Comment #1
Priority ⇒ 3. High
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Groupware Webmail Edition
Type ⇒ Bug
Summary ⇒ Kronolith, Nag, Mnemo, turba wont work with Oracle DB
Reply to this comment
When using Oracle as Database, the Connections of the calender, 
adress, notes and tasks Apllications to the Database fail.

The Error shown in the Web is: "MDB2 Error: not found"
In the horde.log the error shows for example as:

  HORDE [error] [turba] MDB2 Error: not found: [Error message: not a 
valid connection string or environment variable [ORACLE_SID|TWO_TASK] 
not set]
  [pid 15777 on line 452 of 
"/home/horde/horde-webmail-1.2.6/turba/lib/Turba.php"]

Horde itself can open and use the database.

I have only very limited knowledge and experience with php and no 
infrastructure für debugging, but as far as I got (opened my own 
logfile and dumped variables and arrays), I found out that at some 
place the connect-string was used as User-Name.

See contents of the dsn Array from my own logging:
dsn: Array
(
     [phptype] => oci8
     [dbsyntax] => oci8
     [username] => horde
     [password] => HORDE
     [protocol] =>
     [hostspec] =>
     [port] =>
     [socket] =>
     [database] => dwo/dbrmz.robbienet.local
     [mode] =>
     [persistent] =>
)

This is, how it should be (right at the start in the MDB2.php File)

And this is, what's passed to the oci8.php for the connection:

  dsn: Array
(
     [phptype] => oci8
     [dbsyntax] => oci8
     [username] => dwo/dbrmz.robbienet.local
     [password] => HORDE
     [protocol] =>
     [hostspec] =>
     [port] =>
     [socket] =>
     [database] => dwo/dbrmz.robbienet.local
     [mode] =>
     [persistent] =>
)

The username is now the connect-string.

Somewhere in the Web I found the hint, that one should set the 
'emulate_database' option to false and I tried that, but got no luck - 
probably I did wrong...

I do have a (kronolith)  H3 (2.1.5) install, where this all works properly.

Saved Queries