gggard / AndroidCaldavSyncAdapater

Caldav synch adapter for Android
246 stars 88 forks source link

Caldav Sync error (gener..): illegal character in path at index 48:/cloud/remote.php/caldav/calend... #123

Closed vlapla closed 10 years ago

vlapla commented 11 years ago

When I add my OwnCloud account everything seems fine at first, but the adapter never syncs with the server. Instead I get the above error displayed in the message area.

I'm using Cyanogenmod 10.0 (Android 4.1), AndroidCalDAVSyncAdapter 1.8 (from F-Droid), and an unknown OwnCloud version (probably 5.0, and I could find it out). Other calendars like Kontact (in KDE) or aCal (on Android) work fine with my account.

Am I the only person with this problem? Should I provide more information?

I'm really glad I discovered this promising project, and I hope it will work for me soon!

rpedrica commented 11 years ago

I have the same issue. V1.7 worked fine but I have this issue since the 1.8 update. ViperS on HTC One S, Android 4.1.x, ownCloud 5.0.11

timoberger commented 11 years ago

can you provide access to the calendar server or the calendar?

rpedrica commented 11 years ago

Hi I can't give my own account but I can create a test account for you if you'd like - let me know.

timoberger commented 11 years ago

i need one of these:

what kind of url did you use during accout creation? are any calendars created on your device? are there events within the calendars?

Weishaupt commented 11 years ago

Since yesterday I experience the same problem. The sync won't take place. I'll try to provide some useful logs later.

timoberger commented 11 years ago

this could be a single event that causes this error.

Weishaupt commented 11 years ago

Update: Solution below

Okay,

it seems the error lies within this: DateException: Duration.parse(str='PT-22H0M0S') unexpected char '-' at index=2

I just downloaded the two calendars I use with my OwnCloud Account, but non of them contain the string "PT-". Do you know a possibility to download the .ics from the phone?

I use the Google Calendar app, that shipped with the phone.

D/CalendarEvent(28758): AndroidEvent is dirty: 0
D/CalendarEvent(28758): Update calendar event not needed: for content://com.android.calendar/events/1463
I/SyncAdapter(28758): Event /owncloud/remote.php/caldav/calendars/marvin/defaultcalendar/owncloud-251a0fc826f5356553739afb78f16271.ics androidUri=null
D/CaldavFacade(28758): LastAuthState: restored with user marvin
D/CaldavFacade(28758): LastAuthScope: restored
W/CalendarProvider2(13837): Could not calculate last date.
W/CalendarProvider2(13837): com.android.calendarcommon2.DateException: Duration.parse(str='PT-22H0M0S') unexpected char '-' at index=2
W/CalendarProvider2(13837):     at com.android.calendarcommon2.Duration.parse(Duration.java:119)
W/CalendarProvider2(13837):     at com.android.providers.calendar.CalendarProvider2.calculateLastDate(CalendarProvider2.java:2897)
W/CalendarProvider2(13837):     at com.android.providers.calendar.CalendarProvider2.updateLastDate(CalendarProvider2.java:2952)
W/CalendarProvider2(13837):     at com.android.providers.calendar.CalendarProvider2.insertInTransaction(CalendarProvider2.java:2125)
W/CalendarProvider2(13837):     at com.android.providers.calendar.SQLiteContentProvider.insert(SQLiteContentProvider.java:96)
W/CalendarProvider2(13837):     at android.content.ContentProvider$Transport.insert(ContentProvider.java:213)
W/CalendarProvider2(13837):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:158)
W/CalendarProvider2(13837):     at android.os.Binder.execTransact(Binder.java:388)
W/CalendarProvider2(13837):     at dalvik.system.NativeStart.run(Native Method)
E/JavaBinder(13837): *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
E/JavaBinder(13837): java.lang.RuntimeException: Could not insert event.
E/JavaBinder(13837):    at com.android.providers.calendar.CalendarProvider2.insertInTransaction(CalendarProvider2.java:2127)
E/JavaBinder(13837):    at com.android.providers.calendar.SQLiteContentProvider.insert(SQLiteContentProvider.java:96)
E/JavaBinder(13837):    at android.content.ContentProvider$Transport.insert(ContentProvider.java:213)
E/JavaBinder(13837):    at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:158)
E/JavaBinder(13837):    at android.os.Binder.execTransact(Binder.java:388)
E/JavaBinder(13837):    at dalvik.system.NativeStart.run(Native Method)
E/SyncAdapter(28758): Updating calendar exception java.lang.NullPointerException
E/SyncAdapter(28758): java.lang.NullPointerException
E/SyncAdapter(28758):   at org.gege.caldavsyncadapter.caldav.entities.CalendarEvent.createAndroidEvent(CalendarEvent.java:912)
E/SyncAdapter(28758):   at org.gege.caldavsyncadapter.syncadapter.SyncAdapter.synchroniseEvents(SyncAdapter.java:330)
E/SyncAdapter(28758):   at org.gege.caldavsyncadapter.syncadapter.SyncAdapter.onPerformSync(SyncAdapter.java:170)
E/SyncAdapter(28758):   at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:254)
I/ActivityManager( 1179): No longer want com.google.android.gms (pid 15232): empty #17
D/SyncManager( 1179): failed sync operation marvin@https://marvindickhaus.de/owncloud/remote.php/caldav/ u0 (org.gege.caldavsyncadapter.account), com.android.calendar, SERVER, earliestRunTime 235427408, reason: AutoSync, SyncResult: stats [ numParseExceptions: 1]
D/SyncManager( 1179): not retrying sync operation because the error is a hard error: marvin@https://marvindickhaus.de/owncloud/remote.php/caldav/ u0 (org.gege.caldavsyncadapter.account), com.android.calendar, SERVER, earliestRunTime 235447162, reason: AutoSync

As it turns out, the problem was an event created with repetition directly in the owncloud webinterface. The VEVENT that caused the error is:

BEGIN:VEVENT
CREATED;VALUE=DATE-TIME:20131104T105249Z
UID:8a95465d68
RRULE:FREQ=MONTHLY;BYDAY=1MO;INTERVAL=1
LAST-MODIFIED;VALUE=DATE-TIME:20131104T105249Z
DTSTAMP;VALUE=DATE-TIME:20131104T105249Z
SUMMARY:Monntagssitzung
DTSTART;VALUE=DATE-TIME:20131202T180000Z
DTEND;VALUE=DATE-TIME:20131125T200000Z
CLASS:PUBLIC
LOCATION:Filmkreis
END:VEVENT

The same Event created with Thunderbird lightning looks like:

BEGIN:VEVENT
CREATED:20131108T165934Z
LAST-MODIFIED:20131108T170018Z
DTSTAMP:20131108T170018Z
UID:c7fa9048-c465-452f-8a21-12c34815a3ff
SUMMARY:Montagssitzung
RRULE:FREQ=MONTHLY
DTSTART;VALUE=DATE-TIME:20131202T180000Z
DTEND;VALUE=DATE-TIME:20131202T200000Z
LOCATION:Filmkreiskeller
DESCRIPTION:Monatliche Besprechung
CLASS:PUBLIC
END:VEVENT
timoberger commented 11 years ago

the event started 2013-12-02 and ended 2013-11-25. one point for the web interface. i will add a logic test between start and end.

timoberger commented 10 years ago

please test my latest release v1.8.1-beta.2 https://github.com/timoberger/AndroidCaldavSyncAdapater/releases/tag/v1.8.1-beta.2

vlapla commented 10 years ago

Great, it's working! Thank you, timoberger!