-
Type: Story
-
Status: Resolved (View Workflow)
-
Priority: Medium
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: VOLTHA v2.6
-
Component/s: onos
-
Labels:
-
Story Points:3
-
Epic Link:
ONOS 2.2.4 and over, based on karaf 4.2.9 when deployed in kind over `Linux Server4 4.4.0-142-generic #168-Ubuntu` after a number of runs shows a continuous log of
``` 2020-09-29T22:48:46.11138354Z 22:48:46.111 ERROR [fileinstall] In main loop, we have serious trouble
2020-09-29T22:48:46.11138799Z java.lang.NullPointerException```
digging deeper the exception is
``` 2020-08-03T15:13:23,789 | ERROR | fileinstall-/root/onos/apache-karaf-4.2.9/deploy | fileinstall | 10 - org.apache.felix.fileinstall - 3.6.6 | In main loop, we have serious trouble
java.lang.NullPointerException: null
at org.apache.felix.fileinstall.internal.Scanner.processFiles(Scanner.java:158) ~[!/:3.6.6]
at org.apache.felix.fileinstall.internal.Scanner.scan(Scanner.java:131) ~[!/:3.6.6]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:311) [!/:3.6.6] ```
it seems that while moving to karaf 4.2.9 fileinstall moved from 3.6.4 to 3.6.6
The reason for the NPE seems to be the filter being null:
https://github.com/apache/felix/blob/e062b1324b13ecfe294104b999655a2f745a452b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java#L97
possibly fixable by setting
https://felix.apache.org/documentation/subprojects/apache-felix-file-install.html
felix.fileinstall.subdir.mode jar Possible values are jar, skip, recurse. Defines the behavior for sub directories.
This effects how the Scanner is configured
https://github.com/apache/felix/blob/e062b1324b13ecfe294104b999655a2f745a452b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java#L194
scanner = new Scanner(watchedDirectory, filter, properties.get(SUBDIR_MODE));
the directory it's watching:
https://github.com/apache/felix/blob/e062b1324b13ecfe294104b999655a2f745a452b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java#L176
./load by default
watchedDirectory = getFile(properties, DIR, new File("./load"));
the filter string is defined by the felix.fileinstall.filter system property
if it's null or "" then the scanner will be constructed with no filter
Thanks to Jordan Halterman for the insight.