arthurzaczek / kolab-android

Automatically exported from code.google.com/p/kolab-android
GNU General Public License v3.0
0 stars 0 forks source link

SyncException: Unable to find XML Document #68

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Calendar entries created by kontact-suit are not synchronized. The number of 
errors is equal to the number of entries. Entries created by kolab-android are 
shown by kontact.

Original issue reported on code.google.com by StEnd...@web.de on 19 Aug 2011 at 8:52

GoogleCodeExporter commented 9 years ago
I can confirm this.
To test, I've made 2 contacts:
  Lisa, made on the android and
  Homer, made on the KDE's Kontact.

Lisa can be synchronized to KDE's Kontact, but Homer cannot be synchronized to 
Android.
Also, after Lisa has been synchronized to KDE's Kontact, I can change it (add a 
telephone number), but synchronize it back to Android will fail.

Here are the *.xml's, maybe you can use it.

Lisa:
===========================
<?xml version="1.0" encoding="UTF-8"?>
<contact version="1.0">
<uid>kd-ct-35483c8f-408a-4757-bbcb-a6d73be8acd2</uid>
<name>
<full-name>Lisa Simpson</full-name>
<given-name>Lisa</given-name>
<last-name>Simpson</last-name>
</name>
<email>
<display-name>Lisa Simpson</display-name>
<smtp-address>lisa@yahoo.com</smtp-address>
</email>
</contact>
===========================

Homer:
===========================
<?xml version="1.0" encoding="UTF-8"?>
<contact version="1.0">
 <product-id>KAddressBook 3.3, Kolab resource</product-id>
 <uid>RvEJNr7ZNM</uid>
 <last-modification-date>2011-08-23T01:20:58Z</last-modification-date>
 <sensitivity>public</sensitivity>
 <name>
  <given-name>Homer</given-name>
  <last-name>Simpson</last-name>
  <full-name>Homer Simpson</full-name>
 </name>
 <email>
  <display-name>Homer Simpson</display-name>
  <smtp-address>duh@aol.com</smtp-address>
 </email>
 <preferred-address>home</preferred-address>
</contact>
===========================

Original comment by e.dur...@gmx.net on 23 Aug 2011 at 1:37

GoogleCodeExporter commented 9 years ago
This isn't very helpful, without mentioning the Android version (and HTC Sense 
yes/no) plus the version of kolab-android you use.

Original comment by STrille...@googlemail.com on 23 Aug 2011 at 6:19

GoogleCodeExporter commented 9 years ago
Also the kontact and kde version you use is important since they have changed 
_A LOT_ of things in their new versions with Akonadi.

Do you get any exceptions from kolab-android? If so, please upload them with 
our error reporting interface Is the number of contacts to sync that 
kolab-android shows correct?

Original comment by STrille...@googlemail.com on 23 Aug 2011 at 6:51

GoogleCodeExporter commented 9 years ago
I have the same Issue here. Using KDEPIM 4.7.1, Kolab-Abdroid git master from 
today. adb gives me one of the following for each entry:

I/sync    (28745): 2. Checking message 
kd-ev-5c3349aa-d93b-4d0e-b1b7-0c828a352e46
I/sync    (28745): 6. found no local entry => save
D/sync    (28745): Downloading item ...
E/sync    (28745): at.dasz.KolabDroid.Sync.SyncException: Unable to find XML 
Document

The xml-files are definitely there as attachments.

Original comment by ich.nutz...@googlemail.com on 16 Sep 2011 at 9:19

GoogleCodeExporter commented 9 years ago
Oh, my phone: Using a Google Nexus S running Android 2.3.4

Original comment by ich.nutz...@googlemail.com on 16 Sep 2011 at 9:20

GoogleCodeExporter commented 9 years ago
Ok, found the issue: The attachments in question report 
"APPLICATION/x-vndkolabevent" as mime-type while you check for 
"application/x-vnd.kolab.event". The best solution would probably be to check 
for all possible mime-types. I'll try to hack that tomorrow, with the mime-type 
changed by hand it all works like a charm for me now.

The interesting question for me is: Where is the mime-type determined? Android 
or your application?

Original comment by ich.nutz...@googlemail.com on 16 Sep 2011 at 9:41

GoogleCodeExporter commented 9 years ago
Sorry, me again: Since the Kolab-specs definitely specify 
application/x-vnd.kolab.event/contact (Yes, this happens with contacts as well) 
the logical place for the issue is kdepim, but according to the sourcecode and 
the item itself (attached) they report the correct mime-type (I would have been 
surprised if they didn't since they ARE the reference implementation).

I therefore have to conclude that somehow the javamail or activation packages 
report the wrong mime-type.

Original comment by ich.nutz...@googlemail.com on 16 Sep 2011 at 10:58

Attachments:

GoogleCodeExporter commented 9 years ago
Ok, one more thing (after that I'll wait for your input :D): I just tested with 
Thunderbird and SyncKolab: Same Behaviour (Only Difference: SyncKolab 
apparently uses base64 whereas Kontact uses quoted/printable to encode the XML 
in the message body).

I then tested using a Virtual Device under Android 2.2: The same. Android 2.1 
in a Virtual Device sadly didn't work because it thinks my username and 
password are incorrect (they work fine under the other two).

Original comment by ich.nutz...@googlemail.com on 17 Sep 2011 at 8:49

GoogleCodeExporter commented 9 years ago
I've tested the attached file and it works with my current dev. version. In the 
file, there is the correct mime type.

Maybe the "unable to find xml" was related to the class loader issue.

Original comment by arthur.z...@gmail.com on 22 Jun 2012 at 9:30

GoogleCodeExporter commented 9 years ago
I've just tried the new version 0.9.1. 
I attach an example entry of my IMAP folder.
The situation did not improve.
Still got an error for each calendar entry, and the log contains:

E/sync    (24939): 55bccc21-8a35-4d12-a888-89dbf62c9fea: 
at.dasz.KolabDroid.Sync.SyncException: Unable to find XML Document
D/Database(24939): dbopen(): path = 
/data/data/at.dasz.KolabDroid/databases/KolabDroid.db, flag = 6
D/Database(24939): dbopen(): path = 
/data/data/at.dasz.KolabDroid/databases/KolabDroid.db, free size = 16
I/KolabSyncAdapter(24939): syncResult.hasError() = false

Original comment by DvO...@gmail.com on 23 Jun 2012 at 10:25

Attachments:

GoogleCodeExporter commented 9 years ago
I'm so sorry. I cannot reproduce it. Are you a developer? Can you debug this 
issue. The interesting code is located in AbstractSyncHandler.extractXml(..), 
starting at line 326. 

There is a loop to find the right attachment. For your file, on my Testphone, 
the loop will hit the second attachment and return a valid XML.

Also I could produce more logging noise, but debugging is always better in such 
cases.

Original comment by arthur.z...@gmail.com on 26 Jun 2012 at 3:34

GoogleCodeExporter commented 9 years ago
Renaming case

Original comment by arthur.z...@gmail.com on 26 Jun 2012 at 3:53

GoogleCodeExporter commented 9 years ago

Original comment by arthur.z...@gmail.com on 26 Jun 2012 at 4:15

GoogleCodeExporter commented 9 years ago
Arthur, thanks for your response and trying to reproduce the issue with my test 
data.
I just tried again with version 0.9.1 both on my HTC Desire running rooted 
Android 2.3.3 and Desire S running 2.3.5 - the problem remains.

I do some software developments occasionally, but so far not for Android.
I could send further logs, maybe it helps if you make them more verbose.

Original comment by 8muelle...@gmail.com on 3 Jul 2012 at 5:28

GoogleCodeExporter commented 9 years ago
I'll implement a verbose version. Hopefully this week

Original comment by arthur.z...@gmail.com on 4 Jul 2012 at 11:57

GoogleCodeExporter commented 9 years ago
I've just release a 0.9.2 version with more verbose logging. Please enable Diag 
Log in your settings and submit the logcat.

Original comment by arthur.z...@gmail.com on 9 Jul 2012 at 1:59

GoogleCodeExporter commented 9 years ago
Thanks; the log is attached.

Original comment by 8muelle...@gmail.com on 9 Jul 2012 at 6:18

Attachments:

GoogleCodeExporter commented 9 years ago
Looks like diagnostic log was not enabled in kolab droid settings...

Original comment by arthur.z...@gmail.com on 10 Jul 2012 at 7:55

GoogleCodeExporter commented 9 years ago
I was expecting the messages:

Downloading item ...
extractXml
mainDataSource is a 
  containing ? items
  0: ......
  1: ......

Original comment by arthur.z...@gmail.com on 10 Jul 2012 at 7:56

GoogleCodeExporter commented 9 years ago
Oops, I was not aware of the diagnostic log option.
Please find enclosed the more detailed log.

Original comment by 8muelle...@gmail.com on 10 Jul 2012 at 8:25

Attachments:

GoogleCodeExporter commented 9 years ago
0.9.4 has been released - even more logging.

Original comment by arthur.z...@gmail.com on 10 Jul 2012 at 8:49

GoogleCodeExporter commented 9 years ago
All right, here is an updated log.

Original comment by 8muelle...@gmail.com on 10 Jul 2012 at 5:20

Attachments:

GoogleCodeExporter commented 9 years ago
Looks like, it is not a problem with the class loader or DCHFactory. Please - 
can anyone with this problem debug the app? We cannot reproduce it!

Thanks!

Original comment by arthur.z...@gmail.com on 31 Jul 2012 at 5:08

GoogleCodeExporter commented 9 years ago
I've created a new version 0.9.5. I've cleaned up some javax.mail code. Maybe 
this will help. Please tell me, if it did & we can close this case!

Thanks, Arthur

Original comment by arthur.z...@gmail.com on 9 Aug 2012 at 3:59

GoogleCodeExporter commented 9 years ago
Thanks Arthur for giving it another try!

Unfortunately, I still get the same error.
I enclose KolabDiagDump.txt and the logcat output.

Regards,
  David

Original comment by 8muelle...@gmail.com on 17 Aug 2012 at 7:31

Attachments:

GoogleCodeExporter commented 9 years ago
I had a similar problem while syncing my contacts and was trying to debug it. I 
figured out that in my case it was a problem with the expected mime type in 
AbstractSyncHandler.extractXml(). For contacts it should be 
"application/x-vnd.kolab.contact" but somehow the detected mime type was 
"application/x-vndkolabcontact" (so the same but without the dots). When 
viewing the message source with thunderbird I got the correct mime type:

Content-Type: application/x-vnd.kolab.contact; name="kolab.xml"

I added the changes from the attached patch and then it worked (for the 
contacts). I did not check yet if there is also a problem with the mime type of 
the calendar entries.

Hope this helps a little bit in finding the real problem. Just give me a hint 
when I can test some new code.

Original comment by zebol...@googlemail.com on 27 Aug 2012 at 12:16

Attachments:

GoogleCodeExporter commented 9 years ago
zebol...@gmail.com, could you please provide the .apk?

I just gave Kolab a try again, version 3.0.0 on Thunderbird and 0.9.5 on 
Android (this time Android 4.1.1 on Samsung Galaxy Note 2). Still the same 
compatibility problem: the Android part can sync to Thunderbird, but not vice 
versa.

I did not check the Android system log this time, 
but found that Menu ->  Diag. Dump says:
"no such column: displayName(code 1): ,
 while compiling : SELECT name,
 displayName, _sync_account,
 _sync_account_type FROM Calendars"

I noticed that the message attachments look quite different!
Those produced on Thunderbird start like this: 
Content-Type: application/vcard+xml;
 name="kolab.xml"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="kolab.xml"

As opposed to those produced on Android:
Content-Type: application/x-vnd.kolab.contact; name=kolab.xml
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=kolab.xml

BTW, the Android side gives a wrong app version:
User-Agent: kolab-android 0.1

Moreover, I did not find in the documentation for the Android app any hint 
whether the Thunderbird side should produce VCard/Kolab1, Xml/Kolab2, or 
Xml/Kolab3 format.

Original comment by DvO...@gmail.com on 15 Dec 2012 at 10:56

GoogleCodeExporter commented 9 years ago
Arthur, I just found what actually causes the trouble:
The Thunderbird add-on does not produce the header line

MIME-Version: 1.0

Original comment by DvO...@gmail.com on 16 Dec 2012 at 12:19

GoogleCodeExporter commented 9 years ago
Well, that's the problem for address book entries.
For Calendar entries there must be some further issue.

Original comment by DvO...@gmail.com on 16 Dec 2012 at 12:47

GoogleCodeExporter commented 9 years ago
I attach a patched Thunderbird extension that simply adds the missing MIME 
version line. After setting the Contact Format to Xml/Kolab2, contact sync now 
works fine.

Yet calendar sync with Android is still broken, in particular for ICS and 
beyond (Android 4+). See also issue 79.

Original comment by DvO...@gmail.com on 17 Dec 2012 at 12:09

Attachments:

GoogleCodeExporter commented 9 years ago
Meanwhile I filed a bug and provided a patch on the Thunderbird extension:
https://www.mozdev.org/bugs/show_bug.cgi?id=25271

BTW, note that the corrected version does not affect already existing IMAP 
folder entries. What I did to correct these is: disable kolab syncing, manually 
remove the broken entries via Thunderbird, re-enable kolab syncing, and 
manually sync. Be careful as entries may be lost - better backup your address 
book first.

@Arthur, I wonder why you could/can not reproduce this problem. Did you for 
instance actually insert as an IMAP folder entry the attachment I provided on 
June 23: 
http://kolab-android.googlecode.com/issues/attachment?aid=680010000&name=kolab.e
ml&token=2_T8af5yX3BNz0v55rWVUP8RwI8%3A1355702960750
I enclose a further item, this time a contact (rather than event).

Would be nice if synckolab also worked without seeing the "MIME-Version: 1.0" 
line.

Original comment by DvO...@gmail.com on 17 Dec 2012 at 7:55

Attachments: