Hit ‘’ for a list of available commands
and ‘[cmd] --help’ for help on a specific command.
Hit ‘’ or type ‘system:shutdown’ or ‘logout’ to shutdown openHAB.
Error executing command: For input string: “1517090219544”
I have activated the karaf log and it produces the following exception
2018-02-25 23:52:16.064 [ERROR] [apache.karaf.shell.support.ShellUtil] - Exception caught while executing command
java.lang.NumberFormatException: For input string: "1517090219544"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]
at java.lang.Long.parseLong(Long.java:578) ~[?:?]
at java.lang.Long.parseLong(Long.java:631) ~[?:?]
at org.jline.reader.impl.history.DefaultHistory.lambda$load$0(DefaultHistory.java:87) ~[?:?]
at java.util.Iterator.forEachRemaining(Iterator.java:116) [?:?]
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) [?:?]
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) [?:?]
at org.jline.reader.impl.history.DefaultHistory.load(DefaultHistory.java:85) [14:org.jline:3.5.1.sp1]
at org.jline.reader.impl.history.DefaultHistory.attach(DefaultHistory.java:68) [14:org.jline:3.5.1.sp1]
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:475) [14:org.jline:3.5.1.sp1]
at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:349) [11:org.apache.karaf.shell.core:4.1.3]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-02-25 23:52:16.064 [ERROR] [apache.karaf.shell.support.ShellUtil] - Exception caught while executing command
java.lang.NumberFormatException: For input string: "1517090219544"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]
at java.lang.Long.parseLong(Long.java:578) ~[?:?]
at java.lang.Long.parseLong(Long.java:631) ~[?:?]
at org.jline.reader.impl.history.DefaultHistory.lambda$load$0(DefaultHistory.java:87) ~[?:?]
at java.util.Iterator.forEachRemaining(Iterator.java:116) [?:?]
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) [?:?]
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) [?:?]
at org.jline.reader.impl.history.DefaultHistory.load(DefaultHistory.java:85) [14:org.jline:3.5.1.sp1]
at org.jline.reader.impl.history.DefaultHistory.attach(DefaultHistory.java:68) [14:org.jline:3.5.1.sp1]
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:475) [14:org.jline:3.5.1.sp1]
at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:349) [11:org.apache.karaf.shell.core:4.1.3]
at java.lang.Thread.run(Thread.java:748) [?:?]
Thanks for not giving up:
I cleared all the cache as described there but unfortunately the problem stays…
and I went on investigating:
What stroke me in the exception is that it tries to read the “DefaultHistory”. When I looked into the source of org.jline.reader.impl.history.DefaultHistory on github I got the feeling it tries to read the karaf history file but unfortunately I couldn’t directly find it until I finally got so desperate that I just searched the whole disc for “1517090219544” and I found the file. It is in the “hidden” directory “.karaf” (/var/lib/openhab2/.karaf) and is called “karaf41.history”.
I then looked into the file and it seems to be the history of the console and looks similar to this (“excerpt”)
1519062633979:feature:install openhab-transformation-regex
1519062646508:logout
1519073299907:feature:list
1519073335327:feature:list |
1519155183950:e
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@1517090219544:smarthome things list | more
1517090229723:smarthome things list
1517090233369:smarthome
1517090247942:smarthome things
151709 …
What is weird is actually the line that is “1517090219544” as it starts with ^@^@^@^…and it looks like this is some garbage that happened during a crash of the system…at least this does not belong there!
I fired up the editor, deleted all these crazy characters, saved the file and bingo, the console works again!