[SOLVED] CalDavPersonal - "Sardine error" every minute

Hi there,

i´m currently trying to get my logfile “clean” by digging into every warning message i receive.
One of the last warnings comes every minute from caldav.internal.job.EventReloaderJob

Warning:

2018-11-28 17:04:41.980 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine error while loading calendar entries: Unexpected response (401 - Unauthorized)
	at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:48) [240:org.openhab.io.caldav:1.12.0]
	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:40) [240:org.openhab.io.caldav:1.12.0]
	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:35) [240:org.openhab.io.caldav:1.12.0]
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218) [240:org.openhab.io.caldav:1.12.0]
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160) [240:org.openhab.io.caldav:1.12.0]
	at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:962) [240:org.openhab.io.caldav:1.12.0]
	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:417) [240:org.openhab.io.caldav:1.12.0]
	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:409) [240:org.openhab.io.caldav:1.12.0]
	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:386) [240:org.openhab.io.caldav:1.12.0]
	at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:246) [240:org.openhab.io.caldav:1.12.0]
	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) [240:org.openhab.io.caldav:1.12.0]

I had the reloadInterval down to 1 minute when testing the binding and updates.
Currently the reloadInterval is set to 60 minutes and the preloadTime to 20.000 minutes.

caldavio.cfg

Abfall:url=https://www.google.com/calendar/dav/<calender ID>@group.calendar.google.com/events
Abfall:username=<username without @gmail.com>
Abfall:password=<password>
Abfall:reloadInterval=60
Abfall:preloadTime=20000
Abfall:disableCertificateVerification=true
Abfall:timeZone=Europe/Berlin

When filtering the log for “caldav” and doing a openhab restart i´m seeing this:

2018-11-28 17:01:56.102 [INFO ] [b.core.service.AbstractActiveService] - CalDav Loader has been shut down
2018-11-28 17:04:20.286 [INFO ] [.io.caldav.internal.CalDavLoaderImpl] - CalDAV IO is properly configured.
2018-11-28 17:04:20.484 [INFO ] [b.core.service.AbstractActiveService] - CalDav Loader has been started
2018-11-28 17:04:20.498 [INFO ] [.io.caldav.internal.CalDavLoaderImpl] - reload job scheduled for: Abfall
2018-11-28 17:04:20.506 [INFO ] [.io.caldav.internal.CalDavLoaderImpl] - reload job scheduled for: Abfallkalender
2018-11-28 17:04:31.226 [INFO ] [nhab.io.caldav.internal.job.EventJob] - event BEGIN for: <calender ID>@google.com(gelb@28.11.2018/00:00-29.11.2018/00:00)
2018-11-28 17:04:35.445 [INFO ] [nhab.io.caldav.internal.job.EventJob] - event BEGIN for: <calender ID>@google.com(gelb@28.11.2018/00:00-29.11.2018/00:00)
2018-11-28 17:04:42.115 [INFO ] [nhab.io.caldav.internal.job.EventJob] - event BEGIN for: <calender ID>@google.com(gelb@28.11.2018/00:00-29.11.2018/00:00)

openHAB still logs an reload schedule für “Abfallkalender” even after changing everything to “Abfall”.
Even the Google Calender is called “Abfall” and not “Abfallkalender” anymore.

My abfall.items file:

String calAbfallTonne "Tonne [MAP(muell.map):%s]" <tonne> {caldavPersonal="calendar:Abfall type:EVENT eventNr:1 value:NAME"}
String calAbfallMieter "Tonne [%s]" <tonne> {caldavPersonal="calendar:Abfall type:EVENT eventNr:1 value:DESCRIPTION"}
String calAbfall "Nächste Leerung [%s]" <tonne>
DateTime calAbfallDate "Datum der Abholung [%1$td.%1$tm.%1$tY]" <calendar> {caldavPersonal="calendar:Abfall type:EVENT eventNr:1 value:START"}

My last try was to stop openHAB, clear the cache with openhab-cli clean-cache and start openHAB again.
No change…

Questions:

  1. Where does the sardine error come from?
  2. What is the correct syntax for my caldavio.cfg file? (With or without caldavio: prefix?)

kind regards
Michael

With prefix like stated in the docs:

Check your /userdata/config/org/openhab/caldavPersonal.config for wrong values.
You can safely delete it and restart openHAB, it will be recreated.

The caldavPersonal.config had no wrong values.
But caldavio.config had multiple mixed values.
And i had one Abfall.config and one Abfallkalender.config in this folder.
I deleted all four files and did a restart.
oH recreated Abfall.config, caldavio.config and caldavPersonal.config

Currently i´m not seeing any Sardine errors.

Thanks for your help @sihui!

---------- Solution ----------

  1. Check if there is any old *.config file from previous configurations
    -> Delete them
  2. Check the content of caldavio.config for old configurations that are mixed up
    -> Delete the file
  3. Check the content of caldavPersonal.config for wrong configurations
    -> Delete the file
  4. Restart the openHAB service
1 Like

Hi,

sorry for re-opening this thread, but it’s driving me crazy. I have the same problem as described above (Sardine error - unauthorized). I deleted the files as described, but after OH restart the same error messages occur every minute. Here is my caldavio.config:

caldavio:Abfallentsorgung:url=https://www.google.com/calendar/dav/xxxxxxxxx@group.calendar.google.com/events
caldavio:Abfallentsorgung:username=myusername
caldavio:Abfallentsorgung:password=mypw
caldavio:Abfallentsorgung:reloadInterval=1
caldavio:Abfallentsorgung:preloadTime=12000  
caldavio:Abfallentsorgung:disableCertificateVerification=true

I have only this one calendar defined:

caldavPersonal.usedCalendars=Abfallentsorgung

caldavioCommand.config is empty. Multiple mixed values seem not to occur.
Does anyone have an idea?

Hello Ulrich,
could it be, that you use dual factor authentication ? i’ve got in the past the same Problem.
regards Mario

Hello, I followed the instructions above and from other threads - don’t remember where. There were some inconsistent copies of confilg files. After I copied the one to another the problem didn’t occur anymore. If you need more infos I can search that thread.
Currently I have the problem that the calendar entries will not be refreshed, only after OH restart. I will look for an appropriate thread or open a new one.