[ https://issues.apache.org/jira/browse/KARAF-7389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17563703#comment-17563703 ]
ASF GitHub Bot commented on KARAF-7389: --------------------------------------- grgrzybek commented on PR #1599: URL: https://github.com/apache/karaf/pull/1599#issuecomment-1177384453 Hmm. I still believe that updating a configuration **with** `FILEINSTALL_FILE_NAME` property will trigger a race condition - a moment later Karaf will continue writing the file (even if using tmpFile first) and FileInstall will get notified (because of `FILEINSTALL_FILE_NAME` property) and will attempt to write the file. If (as described by J. Brébec in https://issues.apache.org/jira/browse/KARAF-6080) the case is that fileinstall sees existing file in etc and feature has `<config>`, this is probably something different. For KARAF-6080, `if (!cfgFile.exists())` should be enough - as in initial fix for KARAF-6080. > Problem installing features with embedded config > ------------------------------------------------ > > Key: KARAF-7389 > URL: https://issues.apache.org/jira/browse/KARAF-7389 > Project: Karaf > Issue Type: Bug > Components: karaf > Affects Versions: 4.4.0, 4.3.6, 4.2.15 > Reporter: Grzegorz Grzybek > Assignee: Jean-Baptiste Onofré > Priority: Major > > I've just seen this when installing Pax Web 8.0.1-SNAPSHOT features: > {noformat} > 2022-02-08T13:25:32,180 | INFO | > fileinstall-/data/servers/apache-karaf-4.4.0-SNAPSHOT/etc | fileinstall > | 17 - org.apache.felix.fileinstall - 3.7.4 | Updating > configuration {org.ops4j.pax.web} from > /data/servers/apache-karaf-4.4.0-SNAPSHOT/etc/org.ops4j.pax.web.cfg > 2022-02-08T13:25:32,184 | ERROR | > fileinstall-/data/servers/apache-karaf-4.4.0-SNAPSHOT/etc | fileinstall > | 17 - org.apache.felix.fileinstall - 3.7.4 | Failed to > install artifact: > /data/servers/apache-karaf-4.4.0-SNAPSHOT/etc/org.ops4j.pax.web.cfg > java.lang.RuntimeException: java.lang.IllegalArgumentException: Key [] must > not be an empty string > at > org.apache.felix.fileinstall.internal.ConfigInstaller.update0(ConfigInstaller.java:649) > ~[!/:3.7.4] > at > org.apache.felix.fileinstall.internal.ConfigInstaller.setConfig(ConfigInstaller.java:411) > ~[!/:3.7.4] > at > org.apache.felix.fileinstall.internal.ConfigInstaller.install(ConfigInstaller.java:192) > ~[!/:3.7.4] > at > org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:950) > [!/:3.7.4] > at > org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:884) > [!/:3.7.4] > at > org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:489) > [!/:3.7.4] > at > org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) > [!/:3.7.4] > at > org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) > [!/:3.7.4] > Caused by: java.lang.IllegalArgumentException: Key [] must not be an empty > string > at > org.apache.felix.cm.impl.CaseInsensitiveDictionary.checkKey(CaseInsensitiveDictionary.java:269) > ~[?:?] > at > org.apache.felix.cm.impl.CaseInsensitiveDictionary.<init>(CaseInsensitiveDictionary.java:73) > ~[?:?] > at > org.apache.felix.cm.impl.ConfigurationImpl.update(ConfigurationImpl.java:452) > ~[?:?] > at > org.apache.felix.cm.impl.ConfigurationAdapter.updateIfDifferent(ConfigurationAdapter.java:204) > ~[?:?] > at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) ~[?:?] > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > ~[?:1.8.0_312] > at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_312] > at > org.apache.felix.fileinstall.internal.ConfigInstaller.update0(ConfigInstaller.java:641) > ~[!/:3.7.4] > ... 7 more > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010)