[Tickets #13865] Application settings for "horde" application not updatable in IMAP/Kolab back-end

noreply at bugs.horde.org noreply at bugs.horde.org
Tue Feb 17 11:28:05 UTC 2015


BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN. NACHRICHTEN AN DIESE  
E-MAIL-ADRESSE WERDEN NICHT GELESEN.

Ticket-URL: https://bugs.horde.org/ticket/13865
------------------------------------------------------------------------------
  Ticket           | 13865
  Erstellt Von     | jmozdzen at nde.ag
  Zusammenfassung  | Application settings for "horde" application not
                   | updatable in IMAP/Kolab back-end
  Warteschlange    | Kolab
  Typ              | Bug
  Status           | Unconfirmed
  Priorität        | 3. High
  Milestone        |
  Patch            |
  Zuständige       |
------------------------------------------------------------------------------


jmozdzen at nde.ag (2015-02-17 11:28) hat geschrieben:

as you probably have noticed on the Horde mailing list, I ran into  
problems storing Horde preferences in our Kolab backend.

Yesterday, I have done some tracing in the Horde code, and pin-pointed  
the path leading to the problem. But I'm still far from solving the  
riddle and ask for your help.

The symptom is that Horde prefs (the ones for  
"<application>horde</application>", vs. i.e.  
"<application>imp</application>") are not *updated* in the IMAP store.  
Initial save works, but once the settings are stored, no new settings  
will be persisted.

Using the web UI, I receive the green "OK" feedback when storing these  
preferences... but further debugging showed that an exception is  
thrown, which somewhere along the way is caught and not reported  
"upstream":

--- cut here ---
2015-02-16T18:07:06+01:00 DEBUG: Variable information:
object(Horde_Kolab_Storage_Object_Exception)#984 (10) {
   ["details"]=>
   NULL
   ["logged"]=>
   bool(false)
   ["_logLevel":protected]=>
   int(0)
   ["message":protected]=>
   string(99) "Failed writing the Kolab object: Failed parsing Kolab  
object input data of type string! Input was:
"
   ["string":"Exception":private]=>
   string(0) ""
   ["code":protected]=>
   int(0)
   ["file":protected]=>
   string(65)  
"/usr/share/php5/PEAR/Horde/Kolab/Storage/Object/Writer/Format.php"
   ["line":protected]=>
   int(94)
   ["trace":"Exception":private]=>
   array(5) {
     [0]=>
     array(6) {
       ["file"]=>
       string(51) "/usr/share/php5/PEAR/Horde/Kolab/Storage/Object.php"
       ["line"]=>
       int(443)
       ["function"]=>
       string(4) "save"
       ["class"]=>
       string(40) "Horde_Kolab_Storage_Object_Writer_Format"
[...]
--- cut here ---


I found that exception by entering successive trace points in the code  
and then adding a "try/catch" block in Storage/Data/Base.php, method  
modify():

--- cut here ---
         if (!$object instanceOf Horde_Kolab_Storage_Object) {
             $object_array = $object;
             $object = $oldObject;
             $object->setData($object_array);
         }

         $object->setDriver($this->_driver);
         try {
         $result = $object->save($writer);
         } catch (Horde_Kolab_Storage_Exception $e) {
Horde::debug( $e);
         }
--- cut here ---

Further debugging brought me to Kolab/Format/Xml.php, method save():

--- cut here ---
     public function save($object, $options = array())
     {
Horde::debug( $object);
         if (!isset($options['previous'])) {
             $this->_xmldoc = $this->_getParser()->getDocument();
         } else {
             $parse_options = $options;
             unset($parse_options['previous']);
Horde::debug( $options);
             $this->_xmldoc = $this->_getParser()->parse(
                 $options['previous'], $parse_options
             );
Horde::debug( "TP0c");
         }
         $this->_refreshParser();
--- cut here ---

I hit both the first and second trace point, but not the third  
("TP0c"), hence the exception seems to be thrown in  
$this->_getParser()->parse().

That parse() method receives two arguments, $options['previous'] and  
$parse_options (which is $options minus $options['previous'], $options  
is traced as:

-- cut here ---
2015-02-16T18:07:06+01:00 DEBUG: Variable information:
array(1) {
   ["previous"]=>
   resource(7460) of type (stream)
}

Backtrace:
1. Horde_Prefs->store()
2. Horde_Prefs_Storage_KolabImap->store()  
/usr/share/php5/PEAR/Horde/Prefs.php:433
3. Horde_Kolab_Storage_Data_Base->modify()  
/usr/share/php5/PEAR/Horde/Prefs/Storage/KolabImap.php:137
4. Horde_Kolab_Storage_Object->save()  
/usr/share/php5/PEAR/Horde/Kolab/Storage/Data/Base.php:303
5. Horde_Kolab_Storage_Object_Writer_Format->save()  
/usr/share/php5/PEAR/Horde/Kolab/Storage/Object.php:443
6. Horde_Kolab_Format_Xml->save()  
/usr/share/php5/PEAR/Horde/Kolab/Storage/Object/Writer/Format.php:92
7. Horde::debug() /usr/share/php5/PEAR/Horde/Kolab/Format/Xml.php:271
--- cut here ---

The stream is read in parse() (but empty?) and at last _parseXml()  
receives that empty string as first parameter:

--- cut here ---
2015-02-16T18:28:10+01:00 DEBUG: Variable information:
string(0) ""

Backtrace:
1. Horde_Prefs->store()
2. Horde_Prefs_Storage_KolabImap->store()  
/usr/share/php5/PEAR/Horde/Prefs.php:433
3. Horde_Kolab_Storage_Data_Base->modify()  
/usr/share/php5/PEAR/Horde/Prefs/Storage/KolabImap.php:137
4. Horde_Kolab_Storage_Object->save()  
/usr/share/php5/PEAR/Horde/Kolab/Storage/Data/Base.php:302
5. Horde_Kolab_Storage_Object_Writer_Format->save()  
/usr/share/php5/PEAR/Horde/Kolab/Storage/Object.php:443
6. Horde_Kolab_Format_Xml->save()  
/usr/share/php5/PEAR/Horde/Kolab/Storage/Object/Writer/Format.php:92
7. Horde_Kolab_Format_Xml_Parser->parse()  
/usr/share/php5/PEAR/Horde/Kolab/Format/Xml.php:274
8. Horde_Kolab_Format_Xml_Parser->_parseXml()  
/usr/share/php5/PEAR/Horde/Kolab/Format/Xml/Parser.php:81
9. Horde::debug() /usr/share/php5/PEAR/Horde/Kolab/Format/Xml/Parser.php:114
--- cut here ---

which is generated in Format/Xml/Parser.php:
--- cut here ---
private function _parseXml($input, $options = array())
     {
Horde::debug( $input);
--- cut here ---

When storing other applications' preferences, data can be read from  
the according stream.

I have no idea how to continue from here. Can you make anything from  
this and share either a fix or at least a pointer to where I should  
continue debugging?

Not reporting the exception, but rather telling the user that saving  
the prefs was successful, is an error on its own ;)

Regards,
Jens





More information about the bugs mailing list