Caldav stopped working

Hello,

I’m using caldav for my garbage-calendar. Sometimes it does work and mostly not.

I’ve tried version 1.8 and now version 1.12 but stil get errrors in the log:

2018-08-14 13:35:50.556 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.caldav-personal-1.12.0.jar

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.caldav-personal [257]

  Unresolved requirement: Import-Package: org.openhab.io.caldav

	at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]

	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [9:org.apache.felix.fileinstall:3.6.4]

can someone help to solve this, please?

Have you configured the binding to work the old way, assuming you are using openhab2.

Workaround for openhab2 found at this link.

https://github.com/openhab/openhab1-addons/issues/4074#issuecomment-202737544

@H102

I’ve put the file ‘org.openhab.binding.caldav-personal-1.12.0.jar’ in /usr/share/openhab2/addons folder and this is my caldavio.cfg file:

caldavio:Afvalkalender:url=https://www.google.com/calendar/davxxxxxxxxxxxxxxxxxxxxxx@group.calendar.google.com/events
caldavio:Afvalkalender:username=xxxxxxxxxxxxx
caldavio:Afvalkalender:password=xxxxxxxxxxxx
caldavio:Afvalkalender:reloadInterval=1
caldavio:Afvalkalender:preloadTime=50000

Toward the bottom of the link I sent there is a post by Shorthander, have you tried that description on your system?

If you have tried two version it may help to check that you don’t have stale caldav config files in: /var/lib/openhab2/config/org/openhab and make sure that you have specified the calendar to use in: caldavpersonal.cfg

Then:
sudo service openhab2 stop && sudo rm -rf /var/lib/openhab2/cache/* && sudo rm -rf /var/lib/openhab2/tmp/* && sudo reboot

Or do it manually, stop openhab then delete whats in cache and temp file, not the actual files just whats inside.

If your still having the issue, please post your openhab info. What version of openhab, what your running openhab on and how you installed and set the log to DEBUG or TRACE to help provide more info for troubleshooting.
Thanks

I tried the steps in your previous post but with no luck, so here is my config:

openHAB 2.4.0 Build #1330
org.openhab.binding.caldav-personal-1.12.0.jar

I’m running openHab on a Orange Pi plus 2E
I installed openHab trough the apt repositories.

this is my log: https://drive.google.com/file/d/1Tl9a0qUFtmDoiag1sVTbtgjcGpduCBsw/view?usp=sharing

Well, I did ask for DEBUG info. :sweat_smile: Just not on the entire server. You might want to remove that link to your logs…ASAP…TMI

When debugging its best to debug only what your having an issue with, else your eyes start to bleed reading thru it all. I didn’t look at everything but I did see (as your original post shows) an issue with caldav-personal. So try this:

Create a cfg file: sudo nano /etc/openhab2/services/caldavPersonal.cfg
and place this inside then save: caldavPersonal:usedCalendars=Afvalkalender

You can test, but most likely need an addition cfg file like:

sudo nano /etc/openhab2/services/caldavCommand.cfg
and place this inside and save: caldavCommand:readCalendars=Afvalkalender

Shouldn’t have issues with permissions but check if still having problems.
Hope this helps.

Also dont forget to turn off DEBUG.

still this error:

2018-08-14 22:55:17.987 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.caldav-personal-1.12.0.jar

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.caldav-personal [252]

  Unresolved requirement: Import-Package: org.openhab.io.caldav

	at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]

	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [9:org.apache.felix.fileinstall:3.6.4]

I just installed the caldav-command binding with the jar-file but I get the same error

What output do you get from: ls -al /var/lib/openhab2/etc

total 272
drwxr-xr-x  4 openhab openhab 12288 Aug 14 17:50 .
drwxr-xr-x 19 openhab openhab  4096 Aug 14 17:51 ..
-rw-rw-r--  1 openhab openhab  1035 Aug 13 12:45 all.policy
-rw-rw-r--  1 openhab openhab  1067 Aug 13 12:45 branding.properties
-rw-rw-r--  1 openhab openhab  1067 Aug 13 12:45 branding-ssh.properties
drwxr-xr-x  3 openhab openhab  4096 Jul 26 13:11 caldav
-rw-rw-r--  1 openhab openhab    10 Aug 13 12:45 com.eclipsesource.jaxrs.connector.cfg
-rw-rw-r--  1 openhab openhab    59 May 27 01:27 com.eclipsesource.jaxrs.swagger.config.cfg
-rw-rw-r--  1 openhab openhab 11328 Aug 14 17:51 config.properties
-rw-rw-r--  1 openhab openhab   318 Aug 13 12:45 custom.properties
-rw-rw-r--  1 openhab openhab   459 Aug 13 12:45 custom.system.properties
-rw-rw-r--  1 openhab openhab  1144 Aug 13 12:45 distribution.info
-rw-rw-r--  1 openhab openhab  4616 May 25 23:13 equinox-debug.properties
-rw-r--r--  1 openhab openhab  3348 May 29 17:41 host.key
-rw-rw-r--  1 openhab openhab   252 May 25 23:13 java.util.logging.properties
-rw-r--r--  1 openhab openhab  4437 May 27 01:27 jetty.xml
-rw-rw-r--  1 openhab openhab  2256 Aug 13 12:45 jmx.acl.org.apache.karaf.bundle.cfg
-rw-rw-r--  1 openhab openhab  4132 Aug 13 12:45 jmx.acl.org.apache.karaf.config.cfg
-rw-rw-r--  1 openhab openhab 20758 Aug 13 12:45 jre.properties
-rw-rw-r--  1 openhab openhab  2091 May 25 23:13 keys.properties
-rw-rw-r--  1 openhab openhab   604 May 27 01:28 keystore
-rw-rw-r--  1 openhab openhab   493 Aug 13 12:45 org.apache.felix.eventadmin.impl.EventAdmin.cfg
-rw-rw-r--  1 openhab openhab   371 Aug 13 12:45 org.apache.felix.fileinstall-deploy.cfg
-rw-rw-r--  1 openhab openhab  2425 Aug 13 12:45 org.apache.karaf.command.acl.bundle.cfg
-rw-rw-r--  1 openhab openhab  2713 Aug 13 12:45 org.apache.karaf.command.acl.config.cfg
-rw-rw-r--  1 openhab openhab  1572 Aug 13 12:45 org.apache.karaf.command.acl.feature.cfg
-rw-rw-r--  1 openhab openhab  1506 Aug 13 12:45 org.apache.karaf.command.acl.jaas.cfg
-rw-rw-r--  1 openhab openhab  1635 Aug 13 12:45 org.apache.karaf.command.acl.kar.cfg
-rw-rw-r--  1 openhab openhab  1376 Aug 13 12:45 org.apache.karaf.command.acl.scope_bundle.cfg
-rw-rw-r--  1 openhab openhab  1118 Aug 13 12:45 org.apache.karaf.command.acl.shell.cfg
-rw-rw-r--  1 openhab openhab  1800 Aug 13 12:45 org.apache.karaf.command.acl.system.cfg
-rw-rw-r--  1 openhab openhab  2705 Aug 13 12:45 org.apache.karaf.features.cfg
-rw-rw-r--  1 openhab openhab  3416 Aug 13 12:45 org.apache.karaf.features.repos.cfg
-rw-rw-r--  1 openhab openhab   834 Aug 13 12:45 org.apache.karaf.jaas.cfg
-rw-rw-r--  1 openhab openhab   532 Aug 13 12:45 org.apache.karaf.kar.cfg
-rw-rw-r--  1 openhab openhab   758 Aug 13 12:45 org.apache.karaf.log.cfg
-rw-rw-r--  1 openhab openhab  4147 Aug 13 12:45 org.apache.karaf.shell.cfg
-rw-rw-r--  1 openhab openhab    33 May 27 01:27 org.eclipse.smarthome.audio.cfg
-rw-rw-r--  1 openhab openhab    22 May 27 01:27 org.eclipse.smarthome.voice.cfg
-rw-rw-r--  1 openhab openhab    65 Aug 13 12:45 org.jupnp.cfg
-rw-rw-r--  1 openhab openhab  5879 Aug 14 20:47 org.ops4j.pax.logging.cfg
-rw-rw-r--  1 openhab openhab  3705 Aug 13 12:45 org.ops4j.pax.url.mvn.cfg
-rw-rw-r--  1 openhab openhab  1346 May 27 01:27 org.ops4j.pax.web.cfg
-rw-rw-r--  1 openhab openhab   227 Aug 13 12:45 overrides.properties
-rw-rw-r--  1 openhab openhab  8943 Aug 14 17:51 profile.cfg
drwxr-xr-x  2 openhab openhab  4096 Aug 14 17:50 scripts
-rw-rw-r--  1 openhab openhab  1848 May 25 23:13 shell.init.script
-rw-rw-r--  1 openhab openhab   663 Aug 13 12:45 startup.properties
-rw-rw-r--  1 openhab openhab  5101 Aug 13 12:45 system.properties
-rw-rw-r--  1 openhab openhab  1525 May 27 01:28 users.properties
-rw-rw-r--  1 openhab openhab   447 Aug 13 12:45 version.properties

I’m running out of idea’s.

What about output of: ls -al /var/lib/openhab2/config/org/openhab

total 320
drwxr-xr-x 2 openhab openhab   4096 Aug 14 22:53 .
drwxr-xr-x 6 openhab openhab   4096 May 27 01:28 ..
-rw-r--r-- 1 openhab openhab    337 Aug 13 09:20 addons.config
-rw-r--r-- 1 openhab openhab     72 Aug 14 22:38 caldavCommand.config
-rw-r--r-- 1 openhab openhab    357 Aug 14 15:02 caldavio.config
-rw-r--r-- 1 openhab openhab     73 Aug 14 15:02 caldavPersonal.config
-rw-r--r-- 1 openhab openhab     74 May 27 01:28 dashboard.config
-rw-r--r-- 1 openhab openhab     69 Aug 14 15:02 gcal.config
-rw-r--r-- 1 openhab openhab 271412 Aug 14 22:53 habpanel.config
-rw-r--r-- 1 openhab openhab     69 Aug 12 11:54 http.config
-rw-r--r-- 1 openhab openhab    548 Aug  9 00:56 openhabcloud.config
-rw-r--r-- 1 openhab openhab     72 May 27 01:28 runtime.config
-rw-r--r-- 1 openhab openhab     73 May 27 01:28 services.config
-rw-r--r-- 1 openhab openhab    231 Jun 14 23:14 telegram.config

I started up another server with openhab and installed the caldav as you described and received the same errors. The missing file needed can be found here:

https://dl.bintray.com/openhab/mvn/org/openhab/io/org.openhab.io.caldav/1.12.0

You need to install the org.openhab.io.caldav/1.12.0.jar file (9th one from the top). Install this in /usr/share/openhab2/addons folder then: sudo /etc/init.d/openhab2 restart

This should fix the unresolved requirement issue.

Thanks for your reply. I just figured this out a few minutes ago. But thanks for your help

Did this fix your issue?

caldav is working now. The items of my garbage widget have values now.

Only an error with the rule that I have to fix.

Good deal, glad to see its working. If you would, click the box on the post I sent with the link to the org.openhab.io.caldav/1.12.0.jar file (post #12 I think it was). This will help others with similar issues find the solution faster. Thanks

I did that already.

I got an error from the rule but I didn’t change the rule. Last time it worked:

2018-08-15 14:35:28.287 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Afvalcontainer.rules' is either empty or cannot be parsed correctly!

2018-08-15 14:35:30.076 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Afvalcontainer.rules' has errors, therefore ignoring it: [51,1]: no viable alternative at input

and this is my rule. I looked into it with vs code but no errors:

rule "Tage bis Abfall berechnen"
when 
	Time cron "0 5 * 1/1 * ? *" or
	Item Restmuell changed or
	Item Biomuell changed or
	Item Papiermuell changed
then
	logInfo("all.rules", "Tage bis Abfall berechnen")
	//Restmuell
	val DateTime varRestmuellDatum = new DateTime((Restmuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli).withTimeAtStartOfDay
	val Long varRestmuellDiff = Math::round((varRestmuellDatum.millis - now.withTimeAtStartOfDay.millis) / (86400000.0))
	if ( varRestmuellDiff == 0 ) {
		RestmuellTage.postUpdate("vandaag")
	} else if ( varRestmuellDiff == 1 ) {
		RestmuellTage.postUpdate("morgen")
	} else {
		RestmuellTage.postUpdate(String::format("(%1$d T.)", varRestmuellDiff))
	}
	//Biomuell
	val DateTime varBiomuellDatum = new DateTime((Biomuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli).withTimeAtStartOfDay
	val Long varBiomuellDiff = Math::round((varBiomuellDatum.millis - now.withTimeAtStartOfDay.millis) / (86400000.0))
	if ( varBiomuellDiff == 0 ) {
		BiomuellTage.postUpdate("vandaag")
	} else if ( varBiomuellDiff == 1 ) {
		BiomuellTage.postUpdate("morgen")
	} else {
		BiomuellTage.postUpdate(String::format("(%1$d T.)", varBiomuellDiff))
	}
	//Papiermuell
	val DateTime varPapiermuellDatum = new DateTime((Papiermuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli).withTimeAtStartOfDay
	val Long varPapiermuellDiff = Math::round((varPapiermuellDatum.millis - now.withTimeAtStartOfDay.millis) / (86400000.0))
	if ( varPapiermuellDiff == 0 ) {
		PapiermuellTage.postUpdate("vandaag")
	} else if ( varPapiermuellDiff == 1 ) {
		PapiermuellTage.postUpdate("morgen")
	} else {
		PapiermuellTage.postUpdate(String::format("(%1$d T.)", varPapiermuellDiff))
	}
	
end

rule "Abfalltermine sortieren"
when
	Item Restmuell received update or
	Item Biomuell received update or
	Item Papiermuell received update or
	Item RestmuellTage changed or
	Item PapiermuellTage changed or
	Item BiomuellTage changed or
	//Time cron "0 8 0 1/1 * ? *" or	
then
	Thread::sleep(3000)
	var DateTime varTempDatum
	var DateTime varAbfall1Datum = new DateTime((Restmuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli)
	var DateTime varAbfall2Datum = new DateTime((Biomuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli)
	var DateTime varAbfall3Datum = new DateTime((Papiermuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli)
	var String varTempArt
	var String varAbfall1Art = "Restafval"
	var String varAbfall2Art = "Groenafval"
	var String varAbfall3Art = "Plasticafval"
	var String varTempTage
	var String varAbfall1Tage = RestmuellTage.state.toString
	var String varAbfall2Tage = BiomuellTage.state.toString
	var String varAbfall3Tage = PapiermuellTage.state.toString
	var i = 1
	while ((i=i+1) < 6) {
		if (varAbfall1Datum > varAbfall2Datum) {
			varTempDatum = varAbfall1Datum
			varAbfall1Datum = varAbfall2Datum
			varAbfall2Datum = varTempDatum
			varTempArt = varAbfall1Art
			varAbfall1Art = varAbfall2Art
			varAbfall2Art = varTempArt
			varTempTage = varAbfall1Tage
			varAbfall1Tage = varAbfall2Tage
			varAbfall2Tage = varTempTage
			if (varAbfall2Datum > varAbfall3Datum) {
				varTempDatum = varAbfall2Datum
				varAbfall2Datum = varAbfall3Datum
				varAbfall3Datum = varTempDatum
				varTempArt = varAbfall2Art
				varAbfall2Art = varAbfall3Art
				varAbfall3Art = varTempArt
				varTempTage = varAbfall2Tage
				varAbfall2Tage = varAbfall3Tage
				varAbfall3Tage = varTempTage
				}
		}
		if (varAbfall2Datum > varAbfall3Datum) {
				varTempDatum = varAbfall2Datum
				varAbfall2Datum = varAbfall3Datum
				varAbfall3Datum = varTempDatum
				varTempArt = varAbfall2Art
				varAbfall2Art = varAbfall3Art
				varAbfall3Art = varTempArt
				varTempTage = varAbfall2Tage
				varAbfall2Tage = varAbfall3Tage
				varAbfall3Tage = varTempTage
				}
		}
	Abfall_1_Datum.postUpdate(varAbfall1Datum.toString)
	Abfall_2_Datum.postUpdate(varAbfall2Datum.toString)
	Abfall_3_Datum.postUpdate(varAbfall3Datum.toString)
	Abfall_1_Art.postUpdate(varAbfall1Art)
	Abfall_2_Art.postUpdate(varAbfall2Art)
	Abfall_3_Art.postUpdate(varAbfall3Art)
	Abfall_1_Tage.postUpdate(varAbfall1Tage)
	Abfall_2_Tage.postUpdate(varAbfall2Tage)
	Abfall_3_Tage.postUpdate(varAbfall3Tage)
end

rule "Abfall steht an - Blinkeding"
when
	Time cron "0 0 17 1/1 * ? *"
then
	if (Abfall_1_Tage.state.toString == "morgen") {
	Abfall_Steht_An.postUpdate(ON)
	}
end

rule "Abfall steht an - Informiere Jochen"
when
	Time cron "0 30 20 1/1 * ? *"
then
	if ((Abfall_Steht_An.state == ON) && (Abfall_1_Art != "RaWeg")) {
	sendTelegram("jeroen", "%s moet je nog aan straat zetten", Abfall_1_Art.state.toString)
	}
end

rule "Abfall steht an - Informiere -Frau- und Jochen"
when
	Time cron "0 30 21 1/1 * ? *"
then
	if ((Abfall_Steht_An.state == ON) && (Abfall_1_Art != "RaWeg")) {
	sendTelegram("jeroen", "Oh oh staat het %s nog niet buiten!", Abfall_1_Art.state.toString)
	sendTelegram("thuis", "%s staat nog steeds niet buiten", Abfall_1_Art.state.toString)
	}
end

With all the file changing you might need to do this step again. You can change the last part from sudo reboot to sudo restart if you prefer not rebooting.

rule "Abfalltermine sortieren"
when
	Item Restmuell received update or
	Item Biomuell received update or
	Item Papiermuell received update or
	Item RestmuellTage changed or
	Item PapiermuellTage changed or
	Item BiomuellTage changed or
	//Time cron "0 8 0 1/1 * ? *" or	
then
	Thread::sleep(3000)
	var DateTime varTempDatum

Also need to remove the “or” at the end of the “Item BiomuellTage changed” in your second rule.

I did the steps you provided. The script run now, only with an error:

2018-08-15 14:57:30.622 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Abfalltermine sortieren': An error occurred during the script execution: null