Failed to install artifact: /var/lib/openhab2/etc/org.openhab.ephemeris.cfg

Hello,

Using last snapshot build. And notice, that I have errors in my logs. system is still working, there is an error messaged:

org.openhab.ephemeris.cfg:
dayset-weekend=[SATURDAY,SUNDAY]
dayset-school=[MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY]

my settings in runtime.cfg
org.eclipse.smarthome.core.localeprovider:language=“en”
org.eclipse.smarthome.core.localeprovider:region=“LT”

Error Log message:
Oct 08 12:31:09 sm0-srv karaf[19420]: 12:31:09.316 [Start Level: Equinox Container: 7a17acb5-3d00-47e2-a133-61de8317200e] ERROR org.apache.felix.
fileinstall - Failed to install artifact: /var/lib/openhab2/etc/org.openhab.ephemeris.cfg
Oct 08 12:31:09 sm0-srv karaf[19420]: java.lang.NullPointerException: null
Oct 08 12:31:09 sm0-srv karaf[19420]: at java.util.Hashtable.put(Hashtable.java:460) ~[?:?]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.apache.felix.fileinstall.internal.ConfigInstaller.setConfig(ConfigInstaller.java:277) ~[10:org.apach
e.felix.fileinstall:3.6.4]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.apache.felix.fileinstall.internal.ConfigInstaller.install(ConfigInstaller.java:99) ~[10:org.apache.f
elix.fileinstall:3.6.4]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:950) [10:org.apache
.felix.fileinstall:3.6.4]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:884) [10:org.apache
.felix.fileinstall:3.6.4]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:489) [10:org.apac
he.felix.fileinstall:3.6.4]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache
.felix.fileinstall:3.6.4]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:247) [10:org.apache.f
elix.fileinstall:3.6.4]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.apache.felix.fileinstall.internal.FileInstall.updated(FileInstall.java:254) [10:org.apache.felix.fil
einstall:3.6.4]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.apache.felix.fileinstall.internal.FileInstall.start(FileInstall.java:138) [10:org.apache.felix.filei
nstall:3.6.4]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:779) [?:?]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) [?:?]
Oct 08 12:31:09 sm0-srv karaf[19420]: at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:772) [?:?]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:729) [?:?]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:933) [?:?]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:309) [?:?
]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.eclipse.osgi.container.Module.doStart(Module.java:581) [?:?]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.eclipse.osgi.container.Module.start(Module.java:449) [?:?]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634)
[?:?]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1614)
[?:?]
Oct 08 12:31:09 sm0-srv karaf[19420]: at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.jav
a:1585) [?:?]

Hi Edvard,

It was possible for me to reproduce the error. Please try the following steps to get rid of it:

  1. Stop openHAB
  2. Move file /var/lib/openhab2/etc/org.openhab.ephemeris.cfg to /etc/openhab2/services/ephemeris.cfg
  3. Restart openHAB

// optionally

  1. Check if you now can find a new file in /var/lib/openhab2/config/org/openhab/ephemeris.config with the following content:
:org.apache.felix.configadmin.revision:=L"XXX"
dayset-school=( \
  "MONDAY", \
  "TUESDAY", \
  "WEDNESDAY", \
  "THURSDAY", \
  "FRIDAY", \
)
dayset-weekend=( \
  "SATURDAY", \
  "SUNDAY", \
)
service.pid="org.openhab.ephemeris"

Hello,

I thing it’s also problem with paper UI. when You choose weekend days, I assume to have multiple choice. but I can’t do multiple choice, and also “save” button" not appear, if you change days.

Ed

Yes, that is correct. I additionally can see a timing issue of the requests the UI is sending to the server - a reload of the page will help for the moment: (see also https://github.com/openhab/openhab-core/pull/919#issuecomment-538686290).

I also see this on a brand new 2.5.0 build 1717 instance so it seems something isn’t quite right. The NPE is because it’s trying to put a null value into the Hashtable. Restarting the runtime also doesn’t solve it for me.

Yes, me too. I assume it is a problem with the default configuration provided by the Karaf feature. According to the Karaf docs:

The content of the <config/> element is a set of properties, following the key=value standard.

I am afraid it cannot handle multiple values like expected.

@wborn As you are the most skilled Karaf user I know - do you have an idea? Could it be possible to use a config file instead?

Looks like it uses Apache fileinstall for this. After following the stack trace I had a look at the ConfigInstaller code. Seems there was a bug fix for FELIX-6042: Lists are not recognized as typed properties which may perhaps be the same issue?

I’ve created an issue for traceability: