Summary | SQL DB as VFS causes exception |
Queue | Turba |
Queue Version | 3.0.3 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | |
Requester | thpo+horde (at) dotrc (dot) de |
Created | 06/06/2011 (5140 days ago) |
Due | 06/06/2011 (5140 days ago) |
Updated | 06/30/2011 (5116 days ago) |
Assigned | 06/29/2011 (5117 days ago) |
Resolved | 06/30/2011 (5116 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
[jan] Fix generating database DSN for VFS if the global VFS
configuration doesn't use SQL (
Bug #10199).2 files changed, 5 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/442c1bf2b4a6cf7dd0121642fc625e2dddcf4fd4
$conf['documents']['type'] = 'Sql';
configuration page of horde. In the relevant "Virtual File Storage"
stanza I selected "SQL database" and "Horde defaults". I hope this
clears it up a bit. Sorry for prefiltering the information and
misleading you in fixing the bug.
Please note, that in my bug report I also made a suggestion at the
bottom of it, how I managed to fix this bug for me.
horde:/srv/horde4/turba# cat config/conf.php
<?php
/* CONFIG START. DO NOT CHANGE ANYTHING IN OR AFTER THIS LINE. */
// $Id: 09b0c45b46e87aabed0f94ca32516030865b379b $
$conf['menu']['import_export'] = true;
$conf['menu']['apps'] = array();
$conf['shares']['source'] = 'localsql';
$conf['comments']['allow'] = true;
$conf['documents']['params']['driverconfig'] = 'horde';
$conf['documents']['type'] = 'Sql';
/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */
Kind regards,
Thomas
State ⇒ Feedback
$conf['documents']['type'] = 'Sql';
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ SQL DB as VFS causes exception
Due ⇒ 06/06/2011
Queue ⇒ Turba
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
$conf['documents']['params']['driverconfig'] = 'horde';
$conf['documents']['type'] = 'Sql';
When selecting an entry in the addressbook, I get the following error:
A fatal error has occurred
Could not instantiate PDO with DSN
"pgsql:vfsroot=/srv/horde_vfs;host=pgsql.back;dbname=horde4".
PDOException: SQLSTATE[08006] [7] invalid connection option "vfsroot"
1. Turba_View_Contact->html() /srv/horde4/turba/contact.php:113
2. Turba_Form_Contact->__construct() /srv/horde4/turba/lib/View/Contact.php:42
3. Horde_Core_Factory_Vfs->getConfig()
/srv/horde4/turba/lib/Form/Contact.php:33
4. Horde_Core_Factory_Db->create()
/usr/share/php/Horde/Core/Factory/Vfs.php:91
5. Horde_Core_Factory_Db->createDb()
/usr/share/php/Horde/Core/Factory/Db.php:92
6. Horde_Db_Adapter_Base->__construct()
/usr/share/php/Horde/Core/Factory/Db.php:155
7. Horde_Db_Adapter_Pdo_Pgsql->connect()
/usr/share/php/Horde/Db/Adapter/Base.php:143
8. Horde_Db_Adapter_Pdo_Base->connect()
/usr/share/php/Horde/Db/Adapter/Pdo/Pgsql.php:88
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_Db_Exception Object
(
[details] =>
[message:protected] => Could not instantiate PDO with DSN
"pgsql:vfsroot=/srv/horde_vfs;host=pgsql.back;dbname=horde4".
PDOException: SQLSTATE[08006] [7] invalid connection option "vfsroot"
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => /usr/share/php/Horde/Db/Adapter/Pdo/Base.php
[line:protected] => 46
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => /usr/share/php/Horde/Db/Adapter/Pdo/Pgsql.php
[line] => 88
[function] => connect
[class] => Horde_Db_Adapter_Pdo_Base
[type] => ->
[args] => Array
(
)
)
[1] => Array
(
[file] => /usr/share/php/Horde/Db/Adapter/Base.php
[line] => 143
[function] => connect
[class] => Horde_Db_Adapter_Pdo_Pgsql
[type] => ->
[args] => Array
(
)
)
[2] => Array
(
[file] => /usr/share/php/Horde/Core/Factory/Db.php
[line] => 155
[function] => __construct
[class] => Horde_Db_Adapter_Base
[type] => ->
[args] => Array
(
[0] => Array
(
[persistent] => 1
[username] => horde
[password] => :-)
[protocol] => tcp
[database] => horde4
[charset] => utf-8
[phptype] => pgsql
[vfsroot] => /srv/horde_vfs
[adapter] => pdo_pgsql
[host] => pgsql.back
)
)
)
[3] => Array
(
[file] => /usr/share/php/Horde/Core/Factory/Db.php
[line] => 92
[function] => createDb
[class] => Horde_Core_Factory_Db
[type] => ->
[args] => Array
(
[0] => Array
(
[persistent] => 1
[username] => horde
[password] => :-)
[hostspec] => pgsql.back
[protocol] => tcp
[database] => horde4
[charset] => utf-8
[phptype] => pgsql
[vfsroot] => /srv/horde_vfs
)
)
)
[4] => Array
(
[file] => /usr/share/php/Horde/Core/Factory/Vfs.php
[line] => 91
[function] => create
[class] => Horde_Core_Factory_Db
[type] => ->
[args] => Array
(
[0] => horde
[1] => vfs
)
)
[5] => Array
(
[file] => /srv/horde4/turba/lib/Form/Contact.php
[line] => 33
[function] => getConfig
[class] => Horde_Core_Factory_Vfs
[type] => ->
[args] => Array
(
[0] => documents
)
)
[6] => Array
(
[file] => /srv/horde4/turba/lib/View/Contact.php
[line] => 42
[function] => __construct
[class] => Turba_Form_Contact
[type] => ->
[args] => Array
(
__ Private data removed __
)
)
[7] => Array
( [file] => /srv/horde4/turba/contact.php
[line] => 113
[function] => html
[class] => Turba_View_Contact
[type] => ->
[args] => Array
(
)
)
)
[previous:Exception:private] =>
)
In my opinion the bug could be fixed like this:
# diff -u /usr/share/php/Horde/Core/Factory/Vfs.php*
--- /usr/share/php/Horde/Core/Factory/Vfs.php 2011-06-06
19:19:20.780334492 +0200
+++ /usr/share/php/Horde/Core/Factory/Vfs.php_orig 2011-06-02
12:26:44.559126032 +0200
@@ -88,7 +88,7 @@
} else {
$vfs['params']['db'] = $this->_injector
->getInstance('Horde_Core_Factory_Db')
- ->create('horde', 'sql');
+ ->create('horde', 'vfs');
}
break;
}