Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to save history warning is unnecessarily large #4456

Open
spacemanspiff2007 opened this issue Nov 18, 2024 · 1 comment
Open

Failed to save history warning is unnecessarily large #4456

spacemanspiff2007 opened this issue Nov 18, 2024 · 1 comment
Labels
bug An unexpected problem or unintended behavior of the Core

Comments

@spacemanspiff2007
Copy link
Contributor

When running openHAB with a user that has no home directory entering a command in the openHAB console produces a large warning:

2024-11-18 06:06:07.307 [WARN ] [org.jline                           ] - Failed to save history
java.nio.file.AccessDeniedException: /home/openhab
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) ~[?:?]
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
        at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:397) ~[?:?]
        at java.nio.file.Files.createDirectory(Files.java:700) ~[?:?]
        at java.nio.file.Files.createAndCheckIsDirectory(Files.java:807) ~[?:?]
        at java.nio.file.Files.createDirectories(Files.java:793) ~[?:?]
        at org.jline.reader.impl.history.DefaultHistory.internalWrite(DefaultHistory.java:227) ~[bundleFile:?]
        at org.jline.reader.impl.history.DefaultHistory.save(DefaultHistory.java:219) ~[bundleFile:?]
        at org.jline.reader.impl.history.DefaultHistory.add(DefaultHistory.java:384) [bundleFile:?]
        at org.jline.reader.impl.LineReaderImpl.finish(LineReaderImpl.java:1140) [bundleFile:?]
        at org.jline.reader.impl.LineReaderImpl.finishBuffer(LineReaderImpl.java:1109) [bundleFile:?]
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:689) [bundleFile:?]
        at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.readCommand(ConsoleSessionImpl.java:447) [bundleFile:4.4.6]
        at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:405) [bundleFile:4.4.6]
        at java.lang.Thread.run(Thread.java:833) [?:?]

Entering a couple commands fills up the log file very quick.

Expected Behavior

Should only print one line

Failed to save history in /home/openhab: java.nio.file.AccessDeniedException

or an even better error message

Steps to Reproduce (for Bugs)

  1. create user without home directory
  2. run openhab with said user
  3. enter a command in the karaf console

Your Environment

  • Version used: 4.2.0
@spacemanspiff2007 spacemanspiff2007 added the bug An unexpected problem or unintended behavior of the Core label Nov 18, 2024
@rkoshak
Copy link

rkoshak commented Nov 18, 2024

https://www.mail-archive.com/[email protected]/msg58309.html

This log statement appears to be the least of the issues. But it also appears top be something that needs to be fixed upstream and not here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

No branches or pull requests

2 participants