[SOLVED] com.github.sardine.impl.SardineException: Unexpected response

Someone with Caldav running on OpenHab could share a valid .ics file with me. I am trying to setup with a file that is validated in https://icalendar.org/validator.html#results, but when this file is read by openhab, it gives me the following error:

2018-12-06 20:44:17.785 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine exception reading ics file: name_file

com.github.sardine.impl.SardineException: Unexpected response

at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:48) [233:org.openhab.io.caldav:1.12.0]

at com.github.sardine.impl.handler.VoidResponseHandler.handleResponse(VoidResponseHandler.java:34) [233:org.openhab.io.caldav:1.12.0]

at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:756) [233:org.openhab.io.caldav:1.12.0]

at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:741) [233:org.openhab.io.caldav:1.12.0]

at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:732) [233:org.openhab.io.caldav:1.12.0]

at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:145) [233:org.openhab.io.caldav:1.12.0]

at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:318) [233:org.openhab.io.caldav:1.12.0]

at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) [233:org.openhab.io.caldav:1.12.0]

at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh230]

at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh230]

Thanks.

Check your caldav config files in /userdata/config/org/openhab/, there may be wrong values compared to your caldav cfg files.

BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20171105T204207Z
LAST-MODIFIED:20181126T160638Z
DTSTAMP:20181126T160638Z
UID:XXXXXXXXXXXXXXXXXX
SUMMARY:Xmas_Lights_Enable_Proxy
STATUS:CONFIRMED
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=-1MO
DTSTART;TZID=Europe/Berlin:20181126T150000
DTEND;TZID=Europe/Berlin:20190104T230000
CLASS:PUBLIC
SEQUENCE:21
DESCRIPTION:BEGIN:Xmas_Lights_Enable_Proxy:ON\nEND:Xmas_Lights_Enable_Pro
 xy:OFF
X-MOZ-GENERATION:12
END:VEVENT
END:VCALENDAR

This event was set up via Lightning in Thunderbird on a nextCloud Server.

1 Like

Problem solved.
I was having trouble with the configuration.
Thanks for the help!!

Glad the problem is solved.

Please mark the post solved by clicking the square box (lower right corner) on the post that provided the solution, e.g. sihui’s post. Also edit the title to start with [Solved], doing both will help others, with similar issues, find a quick solution.

Thanks

1 Like

Could you provide some information how you fixed it? I’m having problems with my calendar.

The contents of files in /userdata/config/org/openhab/ were not updating along with my settings. I corrected them and everything started to work. Do you have any log information?

Can you please explain your result a bit more?
I have the same problem.
Thanks

I have replicated the configuration of the ‘/etc/openhab2/services’ files to the ‘/userdata/config/org/openhab/’ files. I believe that if you delete the files from ‘/userdata/config/org/openhab/’, they will be automatically created with the ‘/etc/openhab2/services’ settings.

Hello Luiz,
i have delete the CalDav Config Files under /var/lib/openhab2/config/org/openhab/ and after an reload of Openhab the files where recreated, but i’ve got still the error Message

2019-07-02 16:04:19.503 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine exception reading ics file: 20190122T095608CET-546h45657_158_181_48_192
com.github.sardine.impl.SardineException: Unexpected response
        at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:48) ~[285:org.openhab.io.caldav:1.13.0]
        at com.github.sardine.impl.handler.VoidResponseHandler.handleResponse(VoidResponseHandler.java:34) ~[285:org.openhab.io.caldav:1.13.0]
        at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:756) ~[285:org.openhab.io.caldav:1.13.0]
        at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:741) ~[285:org.openhab.io.caldav:1.13.0]
        at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:732) ~[285:org.openhab.io.caldav:1.13.0]
        at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:145) ~[285:org.openhab.io.caldav:1.13.0]
        at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:318) [285:org.openhab.io.caldav:1.13.0]
        at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) [285:org.openhab.io.caldav:1.13.0]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh240]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh240]

it’s an Google Calendar iCal Download. When i copy the URL from the caldavio.config File, and enter Username/Password, i got an ical File.

An Idea ?

The error:

2019-11-06 20:10:26.071 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine exception reading ics file: 6csjcd9hc4s68bb5cgoj0b9kcos32bb164pmab9i69ijgopjc4qj8o9n6g_google_com
com.github.sardine.impl.SardineException: Unexpected response
        at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:48) ~[255:org.openhab.io.caldav:1.13.0]
        at com.github.sardine.impl.handler.VoidResponseHandler.handleResponse(VoidResponseHandler.java:34) ~[255:org.openhab.io.caldav:1.13.0]
        at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:756) ~[255:org.openhab.io.caldav:1.13.0]
        at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:741) ~[255:org.openhab.io.caldav:1.13.0]
        at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:732) ~[255:org.openhab.io.caldav:1.13.0]
        at com.github.sardine.impl.SardineImpl.get(SardineImpl.java:145) ~[255:org.openhab.io.caldav:1.13.0]

can also be caused by the historicLoadTime setting
caldavio:<calendar-id>:historicLoadTime=<minutes>

A large number of my ICS files failed. Once setting was removed, inc from config/org/openhab/caldav*.config file, the problem went away. No idea why as ICS files were successfully validated using an online service.

YMMV.

JJ

I have also a Sardine error…but here the error message is

020-04-18 19:36:53.016 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine error while loading calendar entries: Unexpected response (401 - Unauthorized)