signalapp / Flock

Private contact and calendar sync for Android.
https://signal.org/blog/flock
357 stars 80 forks source link

"Secure XML processing is not supported" and encoding error #47

Closed cjeanneret closed 10 years ago

cjeanneret commented 10 years ago

Hello,

Going deeper in my troubles with Flock and contact sync (see #43), I get this nice trace:

I/ActivityManager( 1503): Start proc org.anhonesteffort.flock:flock for service org.anhonesteffort.flock/.sync.addressbook.AddressbookSyncService: pid=15039 uid=10073 gids={50073, 3003}
D/org.anhonesteffort.flock.sync.AbstractDavSyncAdapter(15039): performing sync for authority >> com.android.contacts
D/org.anhonesteffort.flock.sync.addressbook.AddressbookSyncService(15039): handlePreSyncOperations()
D/org.anhonesteffort.flock.sync.addressbook.AddressbookSyncService(15039): found local collection: /addressbooks/__uids__/SwissTengu@flock/addressbook/
W/System.err(15039): [SyncAdapterThread-1] WARN org.apache.jackrabbit.webdav.xml.DomUtil - Secure XML processing is not supported
W/System.err(15039): javax.xml.parsers.ParserConfigurationException: http://javax.xml.XMLConstants/feature/secure-processing
W/System.err(15039):    at org.apache.harmony.xml.parsers.DocumentBuilderFactoryImpl.setFeature(DocumentBuilderFactoryImpl.java:101)
W/System.err(15039):    at org.apache.jackrabbit.webdav.xml.DomUtil.createFactory(DomUtil.java:71)
W/System.err(15039):    at org.apache.jackrabbit.webdav.xml.DomUtil.<clinit>(DomUtil.java:62)
W/System.err(15039):    at org.apache.jackrabbit.webdav.property.ResourceType$TypeName.<init>(ResourceType.java:185)
W/System.err(15039):    at org.apache.jackrabbit.webdav.property.ResourceType$TypeName.<init>(ResourceType.java:176)
W/System.err(15039):    at org.apache.jackrabbit.webdav.property.ResourceType.<clinit>(ResourceType.java:76)
W/System.err(15039):    at org.apache.jackrabbit.webdav.security.SecurityConstants.<clinit>(SecurityConstants.java:42)
W/System.err(15039):    at org.anhonesteffort.flock.webdav.AbstractDavComponentCollection.getPropertyNamesForFetch(AbstractDavComponentCollection.java:131)
W/System.err(15039):    at org.anhonesteffort.flock.webdav.carddav.CardDavCollection.getPropertyNamesForFetch(CardDavCollection.java:70)
W/System.err(15039):    at org.anhonesteffort.flock.sync.addressbook.HidingCardDavCollection.getPropertyNamesForFetch(HidingCardDavCollection.java:87)
W/System.err(15039):    at org.anhonesteffort.flock.sync.addressbook.HidingCardDavStore.getCollection(HidingCardDavStore.java:92)
W/System.err(15039):    at org.anhonesteffort.flock.sync.addressbook.AddressbookSyncService$ContactsSyncAdapter.getSyncWorkers(AddressbookSyncService.java:112)
W/System.err(15039):    at org.anhonesteffort.flock.sync.AbstractDavSyncAdapter.onPerformSync(AbstractDavSyncAdapter.java:195)
W/System.err(15039):    at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)

After that, it goes on, starting to sync, speaking of elements found upstream and so on… And then, crash, "Unfortunately, Flock has stopped"…

Trace again:

D/org.anhonesteffort.flock.sync.AbstractDavSyncWorker(15039): remote component d77752ec-1b27-4889-9084-5220840ba4b3 not present locally
D/org.anhonesteffort.flock.sync.AbstractDavSyncWorker(15039): creating local component d77752ec-1b27-4889-9084-5220840ba4b3 using remote
D/org.anhonesteffort.flock.sync.addressbook.ContactFactory(15039): no photos found in vcard, returning absent
W/dalvikvm(15039): threadid=12: thread exiting with uncaught exception (group=0x4157fc08)
E/AndroidRuntime(15039): FATAL EXCEPTION: pool-1-thread-1
E/AndroidRuntime(15039): Process: org.anhonesteffort.flock:flock, PID: 15039
E/AndroidRuntime(15039): java.lang.IllegalArgumentException: Base64-encoded string must have at least four characters, but length specified was 3
E/AndroidRuntime(15039):    at org.anhonesteffort.flock.util.Base64.decode(Base64.java:1202)
E/AndroidRuntime(15039):    at org.anhonesteffort.flock.util.Base64.decode(Base64.java:1308)
E/AndroidRuntime(15039):    at org.anhonesteffort.flock.util.Base64.decode(Base64.java:1265)
E/AndroidRuntime(15039):    at org.anhonesteffort.flock.sync.addressbook.ContactFactory.getValuesForNote(ContactFactory.java:874)
E/AndroidRuntime(15039):    at org.anhonesteffort.flock.sync.addressbook.LocalContactCollection.addComponent(LocalContactCollection.java:624)
E/AndroidRuntime(15039):    at org.anhonesteffort.flock.sync.AbstractDavSyncWorker.pullRemotelyCreatedComponents(AbstractDavSyncWorker.java:512)
E/AndroidRuntime(15039):    at org.anhonesteffort.flock.sync.AbstractDavSyncWorker.run(AbstractDavSyncWorker.java:126)
E/AndroidRuntime(15039):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime(15039):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime(15039):    at java.lang.Thread.run(Thread.java:841)
D/org.anhonesteffort.flock.sync.addressbook.AddressbookSyncService(15039): handlePostSyncOperations()
D/org.anhonesteffort.flock.sync.AbstractDavSyncAdapter(15039): completed sync for authority >> com.android.contacts

If I understand the error, it seems one of my contacts isn't properly encoded right?

After a second check, I get the same error on my other device. "Source" (where I imported contacts to Flock) runs CM11, "guest" (where I wanted to get contacts) runs Slimkat.

I've tried to drop all contacts and re-import them from my owncloud dump (vcf format in the standard contact app, then import it into Flock), but it seems there's a lock somewhere…

Weird thing: the problematic records isn't on the "source" device… Where does it come from then??

It would be great if we could get some web interface on Flock servers so that we can try to sort it out or, at least, understand. Yes, I know, contents are encrypted… but I'd like to be able to download the broken vcard in order to understand what's happening ;).

scento commented 10 years ago

I can confirm the Secure XML processing is not supported warning, which is also thrown when one tries to setup an (unsupported) DAV server:

08-04 08:28:45.425      656-656/org.anhonesteffort.flock D/org.anhonesteffort.flock.ServerTestsFragment﹕ handleStartTests()
08-04 08:28:45.425      656-656/org.anhonesteffort.flock D/org.anhonesteffort.flock.ServerTestsFragment﹕ startTests()
08-04 08:28:45.804      656-674/org.anhonesteffort.flock W/System.err﹕ [AsyncTask #1] WARN org.apache.jackrabbit.webdav.xml.DomUtil - Secure XML processing is not supported
08-04 08:28:45.804      656-674/org.anhonesteffort.flock W/System.err﹕ javax.xml.parsers.ParserConfigurationException: http://javax.xml.XMLConstants/feature/secure-processing
08-04 08:28:45.814      656-674/org.anhonesteffort.flock W/System.err﹕ at org.apache.harmony.xml.parsers.DocumentBuilderFactoryImpl.setFeature(DocumentBuilderFactoryImpl.java:101)
08-04 08:28:45.814      656-674/org.anhonesteffort.flock W/System.err﹕ at org.apache.jackrabbit.webdav.xml.DomUtil.createFactory(DomUtil.java:71)
08-04 08:28:45.814      656-674/org.anhonesteffort.flock W/System.err﹕ at org.apache.jackrabbit.webdav.xml.DomUtil.<clinit>(DomUtil.java:62)
08-04 08:28:45.814      656-674/org.anhonesteffort.flock W/System.err﹕ at org.apache.jackrabbit.webdav.client.methods.PropFindMethod.<init>(PropFindMethod.java:82)
08-04 08:28:45.814      656-674/org.anhonesteffort.flock W/System.err﹕ at org.apache.jackrabbit.webdav.client.methods.PropFindMethod.<init>(PropFindMethod.java:64)
08-04 08:28:45.814      656-674/org.anhonesteffort.flock W/System.err﹕ at org.anhonesteffort.flock.webdav.carddav.CardDavStore.getCurrentUserPrincipal(CardDavStore.java:92)
08-04 08:28:45.824      656-674/org.anhonesteffort.flock W/System.err﹕ at org.anhonesteffort.flock.ServerTestsFragment$2.handleCardDavTestCurrentUserPrincipal(ServerTestsFragment.java:231)
08-04 08:28:45.824      656-674/org.anhonesteffort.flock W/System.err﹕ at org.anhonesteffort.flock.ServerTestsFragment$2.doInBackground(ServerTestsFragment.java:621)
08-04 08:28:45.824      656-674/org.anhonesteffort.flock W/System.err﹕ at org.anhonesteffort.flock.ServerTestsFragment$2.doInBackground(ServerTestsFragment.java:205)
08-04 08:28:45.824      656-674/org.anhonesteffort.flock W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java:287)
08-04 08:28:45.824      656-674/org.anhonesteffort.flock W/System.err﹕ at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
08-04 08:28:45.824      656-674/org.anhonesteffort.flock W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:137)
08-04 08:28:45.834      656-674/org.anhonesteffort.flock W/System.err﹕ at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
08-04 08:28:45.834      656-674/org.anhonesteffort.flock W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-04 08:28:45.834      656-674/org.anhonesteffort.flock W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
08-04 08:28:45.834      656-674/org.anhonesteffort.flock W/System.err﹕ at java.lang.Thread.run(Thread.java:856)
rhodey commented 10 years ago

This warning is harmless but after a few months has grown to be very annoying, it is produced by using any one of a few select WebDAV string constants. Ideally there would be some LogCat blacklist to which I could add "org.apache.jackrabbit.webdav.xml.DomUtil" but I haven't figured out how to do this with gradle and all that silliness.

I'm going to close this for now because it is not related to any lack of or broken functionality in the Flock client but know that as soon as I figure out how to silence this warning I will :P