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?