Sync errors and possible reasons

From dmfswiki
Revision as of 20:44, 11 October 2012 by Marten (Talk | contribs)

Jump to: navigation, search

Below you'll find an explanation of some error reports and possible reasons.

java.lang.IllegalArgumentException: Username may not be null

The error messages

java.lang.NullPointerException: null
org.dmfs.dav.Dav.<init>(Dav.java:202)
org.dmfs.dav.Dav.<init>(Dav.java:164)
org.dmfs.dav.CalDav.<init>(CalDav.java:114)
org.dmfs.caldav.syncadapter.SyncAdapter.sync(SyncAdapter.java:231)
org.dmfs.syncadapter.AbstractSyncAdapter.onPerformSync(AbstractSyncAdapter.java:139)
android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:164)

and

java.lang.IllegalArgumentException: Username may not be null
org.apache.http.auth.UsernamePasswordCredentials.<init>(UsernamePasswordCredentials.java:84)
org.dmfs.dav.Dav.setCredentials(Dav.java:707)
org.dmfs.caldav.syncadapter.SyncAdapter.sync(SyncAdapter.java:264)
org.dmfs.syncadapter.AbstractSyncAdapter.onPerformSync(AbstractSyncAdapter.java:139)
android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:247)

are caused by a bug in Android. The app uses Android's account manager to store the user name and the server URL to sync to. Under some rare conditions (usually after adding or removing an account) the account manager doesn't return the stored values but null instead. The app doesn't expect that and crashes. Strange enough: 95% of all reports of this issue are from HTC devices.

If you get this error, please try to reboot and/or recreate the account on your device. A simple reboot worked for most users.

I'm already working on a solution for this issue. I'll implement a service that stores the account configuration in its own database. That will circumvent a few other issues with the account manager storage as well.

java.lang.NullPointerException: null

NullPointerExceptions are caused by bugs in most (if not all) cases. However not all of these bug are in CalDAV-Sync/CardDAV-Sync/SmoothSync. Sometimes the initial cause of a NullPointerException is in Android or an other software component. Please see above for a common cause.


The server returned status code 502 in response to a calendar-query request.

This is a server error. Especially Yahoo! servers return this error often. If you're syncing to Yahoo, please report this error to Yahoo! not to me. I can't do anything about it. If you're not syncing to Yahoo report this error to your service provider.

org.apache.http.conn.HttpHostConnectException: Connection to YOUR SERVER URL refused

The name of this error may be somewhat misleading. In many cases it just means the connection to the server has timed out - i.e. no connection could be established. This may happen due to insufficient connectivity or when a sync is triggered during a phone call (many devices loose their data connection during a voice call).

org.apache.http.client.ClientProtocolException: calendar-query failed

This is probably a server bug. You're probably using ownCloud or an older version of SabreDAV (see known issues in ownCloud). Try to upgrade your SabreDAV installation (or the SabreDAV part of ownCloud). If you're not using SabreDAV or ownCloud and you get this error send me an email, please!

javax.net.ssl.SSLException: Read error: ssl=0x34b548: I/O error during system call, Connection reset by peer

Probably a connectivity issue. If this happens very often you should check your connectivity or your server.

javax.net.ssl.SSLException: Read error: ssl=0x351428: I/O error during system call, Connection timed out

Probably a connectivity issue. If this happens very often you should check your connectivity or your server.

org.apache.http.MalformedChunkCodingException: Chunked stream ended unexpectedly

This is probably a connectivity issue as well. If you get this occasionally there is nothing to worry about. If you get it always you should check your server configuration.