[#11775] syncml fails - unable to find dtd...
Summary syncml fails - unable to find dtd...
Queue Synchronization
Queue Version Git master
Type Bug
State Assigned
Priority 2. Medium
Owners jan@horde.org
Requester kikireon@gmail.com
Created 2012-11-28 (2428 days ago)
Due
Updated 2013-08-27 (2156 days ago)
Assigned 2013-08-27 (2156 days ago)
Resolved
Milestone
Patch No

Comments
kikireon@gmail.com 2012-11-28 20:21:53
I tried to sync horde by syncml with an android mobile phone (android 
> 4.0). I used 4myPAL SyncML and SyncJe.

The connection to the server was properly established when I omitted 
the https (encryption), but when trying to open folders the software 
hung or gave an error. That's what the log says:

Message from syslogd@host at Nov 28 20:49:46 ...
  HORDE: [horde] Unable to find dtd for syncml:syncml1.11.2 [pid 2291 
on line 110
  of "/usr/share/php/Horde/Xml/Wbxml/Encoder.php"]

Message from syslogd@host at Nov 28 20:51:09 ...
  HORDE: [horde] Unable to find dtd for syncml:syncml1.11.2 [pid 3118 
on line 110
  of "/usr/share/php/Horde/Xml/Wbxml/Encoder.php"]

Message from syslogd@host at Nov 28 20:51:30 ...
  HORDE: [horde] Unable to find dtd for syncml:syncml1.11.2 [pid 3051 
on line 110
  of "/usr/share/php/Horde/Xml/Wbxml/Encoder.php"]

Unfortunately, ActiveSync didn't work out of the box neither. Ical 
worked with lightning. The only remaining way (after hours of fiddling 
round) to sync tasks and contacts is then a manual export? So CardDav 
(and CalDAV) will be very welcome once ready.

Thanks for checking / improving.

arjen+horde@de-korte.org 2012-11-28 20:41:17
> I tried to sync horde by syncml with an android mobile phone 
> (android > 4.0). I used 4myPAL SyncML and SyncJe.
>
> The connection to the server was properly established when I omitted 
> the https (encryption), but when trying to open folders the software 
> hung or gave an error. That's what the log says:
>
> Message from syslogd@host at Nov 28 20:49:46 ...
>  HORDE: [horde] Unable to find dtd for syncml:syncml1.11.2 [pid 2291 
> on line 110
>  of "/usr/share/php/Horde/Xml/Wbxml/Encoder.php"]
>
> Message from syslogd@host at Nov 28 20:51:09 ...
>  HORDE: [horde] Unable to find dtd for syncml:syncml1.11.2 [pid 3118 
> on line 110
>  of "/usr/share/php/Horde/Xml/Wbxml/Encoder.php"]
>
> Message from syslogd@host at Nov 28 20:51:30 ...
>  HORDE: [horde] Unable to find dtd for syncml:syncml1.11.2 [pid 3051 
> on line 110
>  of "/usr/share/php/Horde/Xml/Wbxml/Encoder.php"]

Did you follow the instructions from

     http://wiki.horde.org/SyncHowTo

There are instructions on what to do when things don't work out. 
Submitting bug reports is going to get you nowhere at this stage.

> Unfortunately, ActiveSync didn't work out of the box neither.

It requires some steps to set this up. Again, follow the instructions:

     http://wiki.horde.org/ActiveSync

If it doesn't work, there are instructions on how to provide 
meaningful debug information.

delrio@mie.utoronto.ca 2012-11-30 15:26:12
> Message from syslogd@host at Nov 28 20:49:46 ...
>  HORDE: [horde] Unable to find dtd for syncml:syncml1.11.2 [pid 2291 
> on line 110
>  of "/usr/share/php/Horde/Xml/Wbxml/Encoder.php"]

I get the same error using SyncJE for Blackberry.
It seems to be a bug parsing wbxmlVersion in Encoder.php, function 
writeHeader($uri).
In some cases, it would add "1.2" to the $uri when it already has 
"1.1", resulting in an invalid "1.11.2" version.

The following patches should seems to fix it:

--- Horde/Xml/Wbxml/Encoder.php.orig    Wed Oct 31 10:24:43 2012
+++ Horde/Xml/Wbxml/Encoder.php Fri Nov 30 10:02:21 2012
@@ -95,15 +95,8 @@
      public function writeHeader($uri)
      {
          // @todo: this is a hack!
-        if ($this->_wbxmlVersion == 2 && !preg_match('/1\.2$/', $uri)) {
-            $uri .= '1.2';
-        }
-        if ($this->_wbxmlVersion == 1 && !preg_match('/1\.1$/', $uri)) {
-            $uri .= '1.1';
-        }
-        if ($this->_wbxmlVersion == 0 && !preg_match('/1\.0$/', $uri)) {
-            $uri .= '1.0';
-        }
+        if (!preg_match('/1\.[0-9]$/', $uri))
+            $uri .= '1.' . $this->_wbxmlVersion;

          $this->_dtd = $this->_dtdManager->getInstanceURI($uri);



Also, I'm not sure why ContentHandler.php forces wbxmlVersion = 2.

--- Horde/Xml/Wbxml/ContentHandler.php.orig     Wed Oct 31 10:24:43 2012
+++ Horde/Xml/Wbxml/ContentHandler.php  Fri Nov 30 09:58:31 2012
@@ -51,7 +51,7 @@

      public function setVersion($v)
      {
-        $this->_wbxmlVersion = 2;
+        $this->_wbxmlVersion = $v;
      }


Hope that helps.
Oscar

kikireon@gmail.com 2012-12-01 13:42:35
I did follow these linked instructions in the horde wiki and spent 
hours reading further informations about server adjustments in the 
internet.

> Submitting bug reports is going to get you nowhere at this stage.
Tell me what debug information you want and I see whether I can get them.
I was just telling you that something doesn't work and should be 
looked after. It is not my intention and responsability to work as a 
developer and solve implementation problems. I just switch the product 
if I encounter problems not solvable with a reasonable amount of time.

> If it doesn't work, there are instructions on how to provide 
> meaningful debug information.
so where is that?

Sincerely, David

delrio@mie.utoronto.ca 2012-12-13 19:32:16
Can anyone review/test the patch I proposed in the earlier comment?
Syncml broke again for my blackberry/syncje after a "pear upgrade".
"Unable to find dtd for syncml:syncml1.11.2"

Thanks

> --- Horde/Xml/Wbxml/Encoder.php.orig    Wed Oct 31 10:24:43 2012
> +++ Horde/Xml/Wbxml/Encoder.php Fri Nov 30 10:02:21 2012
> @@ -95,15 +95,8 @@
>      public function writeHeader($uri)
>      {
>          // @todo: this is a hack!
> -        if ($this->_wbxmlVersion == 2 && !preg_match('/1\.2$/', $uri)) {
> -            $uri .= '1.2';
> -        }
> -        if ($this->_wbxmlVersion == 1 && !preg_match('/1\.1$/', $uri)) {
> -            $uri .= '1.1';
> -        }
> -        if ($this->_wbxmlVersion == 0 && !preg_match('/1\.0$/', $uri)) {
> -            $uri .= '1.0';
> -        }
> +        if (!preg_match('/1\.[0-9]$/', $uri))
> +            $uri .= '1.' . $this->_wbxmlVersion;
>
>          $this->_dtd = $this->_dtdManager->getInstanceURI($uri);
>
>
> --- Horde/Xml/Wbxml/ContentHandler.php.orig     Wed Oct 31 10:24:43 2012
> +++ Horde/Xml/Wbxml/ContentHandler.php  Fri Nov 30 09:58:31 2012
> @@ -51,7 +51,7 @@
>
>      public function setVersion($v)
>      {
> -        $this->_wbxmlVersion = 2;
> +        $this->_wbxmlVersion = $v;
>      }



Jan Schneider <jan@horde.org> 2013-01-03 11:50:37
This patch is just curing symptoms. The question is, why does $uri at 
that point already have a version attached, and why doesn't it match 
the version in $this->_wbxmlVersion?

setVersion() indeed looks broken though. Did you try if only changing 
that method already fixes the double version number?

> Can anyone review/test the patch I proposed in the earlier comment?
> Syncml broke again for my blackberry/syncje after a "pear upgrade".
> "Unable to find dtd for syncml:syncml1.11.2"
>
> Thanks
>
>> --- Horde/Xml/Wbxml/Encoder.php.orig    Wed Oct 31 10:24:43 2012
>> +++ Horde/Xml/Wbxml/Encoder.php Fri Nov 30 10:02:21 2012
>> @@ -95,15 +95,8 @@
>>      public function writeHeader($uri)
>>      {
>>          // @todo: this is a hack!
>> -        if ($this->_wbxmlVersion == 2 && !preg_match('/1\.2$/', $uri)) {
>> -            $uri .= '1.2';
>> -        }
>> -        if ($this->_wbxmlVersion == 1 && !preg_match('/1\.1$/', $uri)) {
>> -            $uri .= '1.1';
>> -        }
>> -        if ($this->_wbxmlVersion == 0 && !preg_match('/1\.0$/', $uri)) {
>> -            $uri .= '1.0';
>> -        }
>> +        if (!preg_match('/1\.[0-9]$/', $uri))
>> +            $uri .= '1.' . $this->_wbxmlVersion;
>>
>>          $this->_dtd = $this->_dtdManager->getInstanceURI($uri);
>>
>>
>> --- Horde/Xml/Wbxml/ContentHandler.php.orig     Wed Oct 31 10:24:43 2012
>> +++ Horde/Xml/Wbxml/ContentHandler.php  Fri Nov 30 09:58:31 2012
>> @@ -51,7 +51,7 @@
>>
>>      public function setVersion($v)
>>      {
>> -        $this->_wbxmlVersion = 2;
>> +        $this->_wbxmlVersion = $v;
>>      }
>
>


delrio@mie.utoronto.ca 2013-01-08 22:00:04
Changing setVersion() alone did not help.

Adding some debugging, I found that setVersion() is being called with $v = 2
Then writeHeader() is being called with $uri = "syncml:syncml1.1" and 
$_wbxmlVersion is 2

I couldn't figure out where $uri with 1.1 is coming from.