Troubleshooting CalDav Personal - Public Garbage Collection Calendar

caldavbinding
Tags: #<Tag:0x00007f1e6bcaf2e8>
(Ben) #1

Hello all,
I’m trying to get a CalDav IO Personal binding up and running.
I am running Openhabian - OH2.4 on a raspberry pi with an SSD, & persistence (mapdb, influxdb).
I’m trying to integrate a publically accessible calendar file for garbage collection into rules, to have prompted reminders.

This has been a bit challenging, as much of the documentation refers to OH1 details such as the OH config file that doesn’t exist anymore. The suggested caldavio.cfg file is also missing the usedCalendars parameter, which then threw an error in the log. This could be added back, but then unfortunately the binding doesn’t seem to have any logging to be able to troubleshoot it further. I can’t see any references to caldav logging levels in the logging level file /var/lib/openhab2/etc/org.ops4j.pax.logging.cfg
Perhaps I’m getting too far into the weeds with this - is there an easier way to debug a caldav binding?

The link to the calendar works, and a cut and paste into a browser results in this file being downloaded - I imagine it should be compatible

BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
PRODID:Data::ICal 0.22
X-PUBLISHED-TTL:1440
X-WR-CALDESC:Solid Waste
X-WR-CALNAME:[**Address Removed**]
X-WR-TIMEZONE:America/Vancouver
BEGIN:VEVENT
DESCRIPTION:Recyclables and green bin
DTSTART;VALUE=DATE:20190429
SUMMARY:Recyclables and green bin
UID:2019-04-29-[**Identifier Removed **]
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:Green bin and garbage
DTSTART;VALUE=DATE:20190506
SUMMARY:Green bin and garbage
UID:2019-05-06-[**Identifier Removed **]
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:Recyclables and green bin
DTSTART;VALUE=DATE:20190513
SUMMARY:Recyclables and green bin
UID:2019-05-13-[**Identifier Removed **]
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:Green bin and garbage
DTSTART;VALUE=DATE:20190521
SUMMARY:Green bin and garbage
UID:2019-05-21-[**Identifier Removed **]
END:VEVENT

[**SNIP**]
END:VEVENT
END:VCALENDAR

caldavio.cfg

################################### CalDAV IO Binding ###################################
#
# Used to connect to Cal DAV.
# Path to the calendar
caldavio:GarbagePickup:url=https://SNIPPED-ADDRESS

# Username for the calendar
#<calendarId>:username=

# Password for the calendar
#<calendarId>:password=

# Reload interval unit is minutes.
# Defines how often the calendar should be reloaded from server.
# Default is 60 minutes
caldavio:GarbagePickup:reloadInterval=10

# This defines which events are relevant for execution. Unit is in minutes.
# Default is 1 Day (1440 minutes)
<calendarId>:preloadTime= 8639 # 6 days -1 minute
#2879 is 2 days -1 minute

# A caldav Server is just a webdav Server which list files. Some servers does not use the valid timestamp for modifications.
# If your calendar does not provide correct timestamps you have to set this false.
# Default is true
#<calendarId>:lastModifiedFileTimeStampValid=

# SSL verification can be disabled, if you don't want to import the server certificate
# into the java keystore. This is just needed for self-signed certificates, where the
# certificate path cannot be verified. Default is false. Do not set to true if no SSL is used.
#<calendarId>:disableCertificateVerification=

# Timezone for events which does not have a timeZone information.
# Normally this is not required
#timeZone=

# Charset which should be used for reading an event.
#charset=UTF-8

caldavPersonal:usedCalendars=GarbagePickup

caldavPersonal.cfg

############################# CalDAV Personal Binding ################################
# see CalDAV IO Binding
# Used to toggle switch items for presence. Switched to ON if an event in the calendar occurs.
# And back to OFF if the event ends.
# Can also be used to show upcoming or active events
#
# Which calendars should be used to detect presence (comma separated)
# usedCalendars=<ids from caldav-io>
#
# If the location of the event is one of this identifiers, the presence will not be changed.
# Can be used for events which are at home or are just reminders. (comma separated, optional)
# homeIdentifiers=

caldavio:usedCalendars=GarbagePickup

calendaritems.items

String GarbagePickupName0	"Pickup Today? [%s]"		<calendar>	{ caldavPersonal="calendar:GarbagePickup type:ACTIVE eventNr:1 value:NAME" } //eventNr for concurrent events
DateTime GarbagePickupTime0	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	{ caldavPersonal="calendar:GarbagePickup type:ACTIVE eventNr:1 value:START" } //eventNr for concurrent events
String GarbagePickupName1	"Next Pickup [%s]"	<calendar>	{ caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:1 value:NAME" }
DateTime GarbagePickupTime1	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	{ caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:1 value:START" }
String GarbagePickupName2	"Following Pickup [%s]" <calendar> { caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:2 value:NAME" }
DateTime GarbagePickupTime2	"Time [%1$tT, %1$td.%1$tm.%1$tY]" 			<calendar> { caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:2 value:START" }

I’m using a habmin panel pointing to the above strings / dates, which shows the values remaining undefined.

The log doesn’t show anything related to caldav at all - including when I update/modify/touch the config or items files.

Any suggestions on where to go from here?

Thanks

0 Likes

(Rich Koshak) #2

Please file an issue in the openhab1-addons repo. See How to file an Issue for details on how to file an issue.

Anything it tells you to put into openhab.conf needs to go into it’s open file. Name the file after the first part of the parameter. If the parameters are caldav:foo then name the file caldav.conf and removed the caldav: part when you add the configuration parameters to that file.

Individual binding’s are not included in the liver config. If you want to change the logging for just one add-on, you need to add an appender and lover for that add-on yourself. See Log4j2 Sample Config for details.

Alternatively, you can put everything into trace or debug logging and filter out just those that have caldav using grep.

I see a number of errors.

Remove “caldavio:” from in front of all parameters in that file.

<caldendarId> is meant to be replaced with a unique I’d for the calendar the parameter is intended to configure. Many users have this binding connected to multiple calendars and this is how you can have different configurations for reach calendar. It looks like you are using “GarbagePickup” as your calendarID.

0 Likes

(Ben) #3

Thanks @rlkoshak
I had missed the parameter with the not replaced.
I had kept the caldavio: prefix due to the discussion on the documentation page:


under “Note for Openhab 2” and as reflected by the section immediately above it.

Regardless, after updating the incorrect calendar-ID paremeter, I tried removing all the caldavio: prefixes from the file. I didn’t see any notification that the config file was rescanned (I seem to only see notifications if there’s an error with the file). I restarted OH2, and continued to see the string items as undefined.

I obviously need to get into the finer details of controlling log levels more. My reading of : https://www.openhab.org/docs/administration/logging.html was that even using Karaf, I needed to specify the package and subpackage, which means I need to know the name for it in the first place. I see the new paperui ‘replacement’ idea has a section for setting logging levels, so hopefully this makes it more accessible.

Is there an easy way to just ‘put everything into trace or debug’? I haven’t seen this mentioned yet.

If it helps, in the file structure
/var/lib/openhab2/etc/caldav
I see a directory titled GarbagePickup

  • it is empty. I assume this is where calendar files would be downloaded to.


I’ve just posted an issue about the caldavio documentation (and refining log info) to github - thanks for the prompt.

Thanks for your help!

0 Likes

(Rich Koshak) #4

In the Karaf console I think the command it log:set trace followed by a log:tail. You can do it in the config file by changing log4j2.logger.openhab.level to TRACE in the logging config file.

Definitely follow the directions in the CalDav docs over anything said here. I don’t use this binding so don’t know if there is something unique about it.

0 Likes

(Ben) #5

Thanks.

Incidentally, on the topic of creating an issue for caldavio, after creating it, a reply was made that stated this belonged in the forums, and the issue was closed. (the issue was that the documentation was out of date, and I requested better logging detail on if/when calendars fail to load)
It seems they want specific defects in code posted as issues, rather than missing features (logging fidelity) or documentation discrepancies.

0 Likes

(Rich Koshak) #6

Well, the issue filled reads like a discussion and request for help and it’s really two different issues and should have been separated.

  1. Docs are incorrect and inconsistent referring files that don’t exist.

  2. A feature request to add additional logging

Though, if the config isn’t correct and loaded the binding probably doesn’t even know about the calendar so would be able to log out about failing.

0 Likes

(Ben) #7

I agree, I could have been much more succinct in my ‘issue’.

Separately, I’ve done a bit of a deeper dive into this.

Short question: Can someone else reproduce this problem with accessing a freely-available calendar (ie , no username or password )? Below I am using https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true

If so, then perhaps this is an issue that could be posted on github.

Long question(s)/info:

I’ve tried toggling the caldavio authentication, thinking that it may be a factor.

When I set a username and password, I seem to be getting an error logged for parsing. Otherwise, if I remove the username/password (commented-out), I don’t get anything significant per my read of the logs (set to trace).

If I deliberately foul the calendar URL, there is no error thrown that I can find in the trace logs.

  • perhaps either because it doesn’t log failed/successful attempts, or because the error parsing the password stopped the show before that point.


If I add another publically-accessible calendar that doesn’t require username/password (for transparent testing purposes. found on a google search - a public Pool in halifax), I get the same sort of problems.

The calendar URL for testing: https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true

The error from the trace logs:

2019-05-14 21:02:10.493 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.openhab.io.caldav.CalDavLoader, id=156, bundle=273/mvn:org.openhab.io/org.openhab.io.caldav/1.13.0]: Updating property CalDAV IO of configuration org.openhab.caldavio caused a problem: Unable to parse configuration parameter: password

My testing caldavio.cfg file:

################################### CalDAV IO Binding ###################################
#
# Used to connect to Cal DAV.
# Path to the calendar

caldavio:TestCal:url=https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true
caldavio:TestCal:username=
caldavio:TestCal:password=
caldavio:TestCal:reloadInterval=60
caldavio:TestCal:preloadTime=1000

caldavio:usedCalendars=TestCal

There are no extra characters after the username or password fields. I tried setting the username and password to ‘random’, and the same unable to parse password error came up. I removed the .config files, as suggested by https://github.com/openhab/openhab1-addons/issues/4074#issuecomment-303877706 - also to no avail.

The trace log - notably still had an entry for GarbagePickup, although it had been removed from the config file:

tail -F /var/log/openhab2/openhab.log /var/log/openhab2/events.log
caldav
 2019-05-14 21:02:10.408 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.413 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.415 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.418 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.422 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.424 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.427 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.431 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.433 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.436 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.440 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.442 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.444 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.448 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.451 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.453 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.457 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.460 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.463 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.467 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.469 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.472 [DEBUG] [org.apache.felix.configadmin        ] - update(properties={GarbagePickup:disableCertificateVerification=true, GarbagePickup:password=, GarbagePickup:preloadTime=2879, GarbagePickup:reloadInterval=10, GarbagePickup:url=[snip], GarbagePickup:username=, password=blank, service.pid=org.openhab.caldavio, TestCal:password=, TestCal:preloadTime=1000, TestCal:reloadInterval=60, TestCal:url=https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true, TestCal:username=, usedCalendars=TestCal, username=blank})

2019-05-14 21:02:10.474 [DEBUG] [org.apache.felix.configadmin        ] - Updating config org.openhab.caldavio with {GarbagePickup:disableCertificateVerification=true, GarbagePickup:password=, GarbagePickup:preloadTime=2879, GarbagePickup:reloadInterval=10, GarbagePickup:url=[snip], GarbagePickup:username=, password=blank, service.pid=org.openhab.caldavio, TestCal:password=, TestCal:preloadTime=1000, TestCal:reloadInterval=60, TestCal:url=https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true, TestCal:username=, usedCalendars=TestCal, username=blank}

2019-05-14 21:02:10.482 [DEBUG] [org.apache.felix.configadmin        ] - Scheduling task Fire ConfigurationEvent: pid=org.openhab.caldavio

2019-05-14 21:02:10.483 [DEBUG] [org.apache.felix.configadmin        ] - Scheduling task Update: pid=org.openhab.caldavio

2019-05-14 21:02:10.483 [DEBUG] [org.apache.felix.configadmin        ] - Running task Fire ConfigurationEvent: pid=org.openhab.caldavio

2019-05-14 21:02:10.484 [DEBUG] [org.apache.felix.configadmin        ] - UpdateConfiguration(org.openhab.caldavio) scheduled

2019-05-14 21:02:10.485 [DEBUG] [org.apache.felix.configadmin        ] - Sending CM_UPDATED event for org.openhab.caldavio to [org.osgi.service.cm.ConfigurationListener, id=115, bundle=9/mvn:org.apache.felix/org.apache.felix.configadmin/1.9.4]

2019-05-14 21:02:10.484 [DEBUG] [org.apache.felix.configadmin        ] - Running task Update: pid=org.openhab.caldavio

2019-05-14 21:02:10.486 [DEBUG] [org.apache.felix.configadmin        ] - Updating configuration org.openhab.caldavio to revision #16

2019-05-14 21:02:10.486 [DEBUG] [org.apache.felix.configadmin        ] - Sending CM_UPDATED event for org.openhab.caldavio to [org.openhab.core.karaf.internal.FeatureInstaller, org.osgi.service.cm.ConfigurationListener, id=199, bundle=181/mvn:org.openhab.core/org.openhab.core.karaf/2.4.0]

2019-05-14 21:02:10.487 [DEBUG] [org.apache.felix.configadmin        ] - Sending CM_UPDATED event for org.openhab.caldavio to [org.osgi.service.cm.ConfigurationListener, id=68, bundle=43/mvn:org.apache.karaf.config/org.apache.karaf.config.core/4.2.1]

2019-05-14 21:02:10.487 [DEBUG] [org.apache.felix.configadmin        ] - canReceive=true: bundle=mvn:org.openhab.io/org.openhab.io.caldav/1.13.0; configuration=mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.489 [DEBUG] [org.apache.felix.configadmin        ] - Sending CM_UPDATED event for org.openhab.caldavio to [org.osgi.service.cm.ConfigurationListener, org.apache.felix.fileinstall.ArtifactListener, org.apache.felix.fileinstall.ArtifactInstaller, id=39, bundle=10/mvn:org.apache.felix/org.apache.felix.fileinstall/3.6.4]

2019-05-14 21:02:10.491 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=?)

2019-05-14 21:02:10.492 [WARN ] [.io.caldav.internal.CalDavLoaderImpl] - Unable to parse configuration parameter: password

2019-05-14 21:02:10.493 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.495 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.apache.felix/org.apache.felix.fileinstall/3.6.4

2019-05-14 21:02:10.493 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.openhab.io.caldav.CalDavLoader, id=156, bundle=273/mvn:org.openhab.io/org.openhab.io.caldav/1.13.0]: Updating property CalDAV IO of configuration org.openhab.caldavio caused a problem: Unable to parse configuration parameter: password

org.osgi.service.cm.ConfigurationException: CalDAV IO : Unable to parse configuration parameter: password

	at org.openhab.io.caldav.internal.CalDavLoaderImpl.updated(CalDavLoaderImpl.java:183) ~[?:?]

2019-05-14 21:02:10.500 [DEBUG] [org.apache.felix.configadmin        ] - Sending CM_UPDATED event for org.openhab.caldavio to [org.osgi.service.cm.ConfigurationListener, id=40, bundle=14/mvn:org.apache.karaf.shell/org.apache.karaf.shell.core/4.2.1]

2019-05-14 21:02:11.492 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.497 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.499 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.503 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.508 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.510 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.513 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.517 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.519 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.522 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.526 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.528 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.531 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.535 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.537 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.540 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.544 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.547 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.549 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.553 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.556 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

==
The relevant section of the CalDavLoader.Impl.java code is (per github):

public void updated(Dictionary<String, ?> config) throws ConfigurationException {
        if (config == null) {
            log.debug("Update was called with a null configuration for CalDAV IO.");
            return;
        }

        log.debug("Update was called for CalDAV IO.");
        CompatibilityHints.setHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING, true);
        Map<String, CalDavConfig> configMap = new HashMap<String, CalDavConfig>();

        Enumeration<String> iter = config.keys();
        while (iter.hasMoreElements()) {
            String key = iter.nextElement();

            if (key.equals("service.pid")) {
                continue;
            }

            log.trace("processing configuration parameter: {}", key);
            if (key.equals(PROP_TIMEZONE)) {
                String newTimeZoneStr = Objects.toString(config.get(key), null);
                if (StringUtils.isBlank(newTimeZoneStr)) {
                    log.info("The {} setting was configured with an empty value. Default value '{}' will be used instead.",
                             PROP_TIMEZONE, defaultTimeZone);
                    continue;
                }
                DateTimeZone newTimeZone = DateTimeZone.forID(newTimeZoneStr);
                if (newTimeZone == null) {
                    log.warn("Invalid timezone value: {}", newTimeZoneStr);
                    throw new ConfigurationException(PROP_TIMEZONE, "Invalid timezone value: " + newTimeZoneStr);
                }
                log.debug("Overriding default timezone {} with {}", defaultTimeZone, newTimeZone);
                defaultTimeZone = newTimeZone;
                continue;
            }

            String[] keys = key.split(":");
            if (keys.length != 2) {
                log.warn("Unable to parse configuration parameter: {}", key);
                throw new ConfigurationException("CalDAV IO", "Unable to parse configuration parameter: "+key);
            }
            String id = keys[0];
            String paramKey = keys[1];
            CalDavConfig calDavConfig = configMap.get(id);
            if (calDavConfig == null) {
                calDavConfig = new CalDavConfig();
                configMap.put(id, calDavConfig);
            }
            String value = Objects.toString(config.get(key), null);

            calDavConfig.setKey(id);
            if (paramKey.equals(PROP_USERNAME)) {
                calDavConfig.setUsername(value);
            } else if (paramKey.equals(PROP_PASSWORD)) {
                calDavConfig.setPassword(value);
            } else if (paramKey.equals(PROP_URL)) {
                calDavConfig.setUrl(value);
            } else if (paramKey.equals(PROP_RELOAD_INTERVAL)) {
                calDavConfig.setReloadMinutes(Integer.parseInt(value));
            } else if (paramKey.equals(PROP_PRELOAD_TIME)) {
                calDavConfig.setPreloadMinutes(Integer.parseInt(value));
            } else if (paramKey.equals(PROP_HISTORIC_LOAD_TIME)) {
                calDavConfig.setHistoricLoadMinutes(Integer.parseInt(value));
            } else if (paramKey.equals(PROP_LAST_MODIFIED_TIMESTAMP_VALID)) {
                calDavConfig.setLastModifiedFileTimeStampValid(BooleanUtils.toBoolean(value));
            } else if (paramKey.equals(PROP_DISABLE_CERTIFICATE_VERIFICATION)) {
                calDavConfig.setDisableCertificateVerification(BooleanUtils.toBoolean(value));
            } else if (paramKey.equals(PROP_CHARSET)) {
                try {
                    Charset.forName(value);
                    calDavConfig.setCharset(value);
                } catch (UnsupportedCharsetException e) {
                    log.warn("Character set not valid: {}", value);
                }
            }
        }

Thoughts?

0 Likes

(Rich Koshak) #8

Try commenting out the username and password instead of having them be blank.

0 Likes