[GH-ISSUE #194] System.InvalidCastException: Specified cast is not valid. #191

Closed
opened 2026-02-25 20:31:07 +03:00 by kerem · 4 comments
Owner

Originally created by @ThomasDaheim on GitHub (May 9, 2017).
Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/194

Hi,

thanks for the Synchronizer! I managed to get it setup in my infrastructure but on first sync I get the following error message:

  <LoadErrors>
    <LoadError>
      <EntityId>XXX.ics</EntityId>
      <Error>System.InvalidCastException: Specified cast is not valid.
   at DDay.iCal.Serialization.iCalendar.TriggerSerializer.Deserialize(TextReader tr)
   at DDay.iCal.Serialization.iCalendar.DataMapSerializer.Deserialize(TextReader tr)
   at DDay.iCal.iCalParser.property(ISerializationContext ctx, ICalendarPropertyListContainer c)
   at DDay.iCal.iCalParser.component(ISerializationContext ctx, ISerializerFactory sf, ICalendarComponentFactory cf, ICalendarObject o)
   at DDay.iCal.iCalParser.component(ISerializationContext ctx, ISerializerFactory sf, ICalendarComponentFactory cf, ICalendarObject o)
   at DDay.iCal.iCalParser.icalbody(ISerializationContext ctx, IICalendar iCal)
   at DDay.iCal.iCalParser.icalendar(ISerializationContext ctx)
   at DDay.iCal.Serialization.iCalendar.iCalendarSerializer.Deserialize(TextReader tr)
   at CalDavSynchronizer.Implementation.CalDavRepository`1.DeserializeCalendar(String iCalData, IStringSerializer calendarSerializer)
   at CalDavSynchronizer.Implementation.CalDavRepository`1.TryDeserializeCalendar(String iCalData, IICalendar&amp; calendar, WebResourceName uriOfCalendarForLogging, IStringSerializer calendarSerializer, ILoadEntityLogger logger)</Error>
      <IsAEntity>false</IsAEntity>
    </LoadError>
  </LoadErrors>

There is a reference to a concrete ics (sghul6osmyt2urqjgvepi.ics) but I'm not sure how to find the matching calendar entry in my nextcloud?

Thanks and regards,
Thomas

Originally created by @ThomasDaheim on GitHub (May 9, 2017). Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/194 Hi, thanks for the Synchronizer! I managed to get it setup in my infrastructure but on first sync I get the following error message: ``` <LoadErrors> <LoadError> <EntityId>XXX.ics</EntityId> <Error>System.InvalidCastException: Specified cast is not valid. at DDay.iCal.Serialization.iCalendar.TriggerSerializer.Deserialize(TextReader tr) at DDay.iCal.Serialization.iCalendar.DataMapSerializer.Deserialize(TextReader tr) at DDay.iCal.iCalParser.property(ISerializationContext ctx, ICalendarPropertyListContainer c) at DDay.iCal.iCalParser.component(ISerializationContext ctx, ISerializerFactory sf, ICalendarComponentFactory cf, ICalendarObject o) at DDay.iCal.iCalParser.component(ISerializationContext ctx, ISerializerFactory sf, ICalendarComponentFactory cf, ICalendarObject o) at DDay.iCal.iCalParser.icalbody(ISerializationContext ctx, IICalendar iCal) at DDay.iCal.iCalParser.icalendar(ISerializationContext ctx) at DDay.iCal.Serialization.iCalendar.iCalendarSerializer.Deserialize(TextReader tr) at CalDavSynchronizer.Implementation.CalDavRepository`1.DeserializeCalendar(String iCalData, IStringSerializer calendarSerializer) at CalDavSynchronizer.Implementation.CalDavRepository`1.TryDeserializeCalendar(String iCalData, IICalendar&amp; calendar, WebResourceName uriOfCalendarForLogging, IStringSerializer calendarSerializer, ILoadEntityLogger logger)</Error> <IsAEntity>false</IsAEntity> </LoadError> </LoadErrors> ``` There is a reference to a concrete ics (sghul6osmyt2urqjgvepi.ics) but I'm not sure how to find the matching calendar entry in my nextcloud? Thanks and regards, Thomas
kerem closed this issue 2026-02-25 20:31:07 +03:00
Author
Owner

@aluxnimm commented on GitHub (May 12, 2017):

In the sync report you should be able to click on the server id and load the ics file. Post it here then we can check what's wrong with it.

<!-- gh-comment-id:301052072 --> @aluxnimm commented on GitHub (May 12, 2017): In the sync report you should be able to click on the server id and load the ics file. Post it here then we can check what's wrong with it.
Author
Owner

@ThomasDaheim commented on GitHub (May 12, 2017):

Ah, missed that link...

Here you go. BTW, it still says "ownCloud" but I'm running nextcloud since some time - currently 11.0.3 (stable)

BEGIN:VCALENDAR
PRODID:-//ownCloud calendar v0
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
DTSTART:19810329T020000
TZNAME:CEST
TZOFFSETTO:+0200
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
DTSTART:19961027T030000
TZNAME:CET
TZOFFSETTO:+0100
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:sabre-vobject-cf985b15-b324-45d8-995b-46354fcb00df
DTSTAMP:20150928T153523Z
CREATED:20150928T153523Z
RRULE:FREQ=YEARLY;INTERVAL=1
LAST-MODIFIED:20150928T153523Z
SUMMARY:BIRTHDAY OF XYZ
DTSTART;VALUE=DATE:20150926
DTEND;VALUE=DATE:20150927
CLASS:PUBLIC
BEGIN:VALARM
TRIGGER:-PT1D
DESCRIPTION:owncloud
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR
<!-- gh-comment-id:301054252 --> @ThomasDaheim commented on GitHub (May 12, 2017): Ah, missed that link... Here you go. BTW, it still says "ownCloud" but I'm running nextcloud since some time - currently 11.0.3 (stable) ``` BEGIN:VCALENDAR PRODID:-//ownCloud calendar v0 BEGIN:VTIMEZONE TZID:Europe/Berlin BEGIN:DAYLIGHT TZOFFSETFROM:+0100 RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU DTSTART:19810329T020000 TZNAME:CEST TZOFFSETTO:+0200 END:DAYLIGHT BEGIN:STANDARD TZOFFSETFROM:+0200 RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU DTSTART:19961027T030000 TZNAME:CET TZOFFSETTO:+0100 END:STANDARD END:VTIMEZONE BEGIN:VEVENT UID:sabre-vobject-cf985b15-b324-45d8-995b-46354fcb00df DTSTAMP:20150928T153523Z CREATED:20150928T153523Z RRULE:FREQ=YEARLY;INTERVAL=1 LAST-MODIFIED:20150928T153523Z SUMMARY:BIRTHDAY OF XYZ DTSTART;VALUE=DATE:20150926 DTEND;VALUE=DATE:20150927 CLASS:PUBLIC BEGIN:VALARM TRIGGER:-PT1D DESCRIPTION:owncloud ACTION:DISPLAY END:VALARM END:VEVENT END:VCALENDAR ```
Author
Owner

@aluxnimm commented on GitHub (May 18, 2017):

The alarm trigger has an invalid duration, since it is 1 day before without a time it must be
TRIGGER:-P1D
instead of
TRIGGER:-PT1D

<!-- gh-comment-id:302485927 --> @aluxnimm commented on GitHub (May 18, 2017): The alarm trigger has an invalid duration, since it is 1 day before without a time it must be TRIGGER:-P1D instead of TRIGGER:-PT1D
Author
Owner

@ThomasDaheim commented on GitHub (May 31, 2017):

Thanks, I have created an issue for https://github.com/nextcloud/calendar for that

<!-- gh-comment-id:305129104 --> @ThomasDaheim commented on GitHub (May 31, 2017): Thanks, I have created an issue for https://github.com/nextcloud/calendar for that
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/outlookcaldavsynchronizer#191
No description provided.