]
Jean-Francois Denise resolved WFCORE-4278.
------------------------------------------
Resolution: Done
fixed in aesh-readline 1.14
jboss-cli "java.lang.ArithmeticException: / by zero" when
executed from /usr/bin/expect without tty
---------------------------------------------------------------------------------------------------
Key: WFCORE-4278
URL:
https://issues.jboss.org/browse/WFCORE-4278
Project: WildFly Core
Issue Type: Bug
Components: CLI
Environment: Fedora 29, RHEL7.5
Reporter: Jean-Francois Denise
Assignee: Jean-Francois Denise
Priority: Major
Running the jboss-cli.sh from expect without tty (e.g. a cron or a jenkins job), causes a
division by zero. (you can simulate non-availability of the real tty with
"-nottycopy" :
NB: The failure occurs when you type a character in the CLI console.
{code}
$ /usr/bin/expect
expect1.1> spawn -nottycopy ./jboss-cli.sh
spawn -nottycopy ./jboss-cli.sh
25901
expect1.2> interact
You are disconnected at the moment. Type 'connect' to connect to the server or
'help' for the list of supported commands.
[disconnected /] Exception in thread "CLI Terminal Connection
(uninterruptable)" java.lang.ArithmeticException: / by zero
at org.aesh.readline.Buffer.printInsertedData(Buffer.java:582)
at org.aesh.readline.Buffer.insert(Buffer.java:231)
at org.aesh.readline.AeshConsoleBuffer.writeChar(AeshConsoleBuffer.java:130)
at org.aesh.readline.Readline$AeshInputProcessor.parse(Readline.java:262)
at org.aesh.readline.Readline$AeshInputProcessor.access$100(Readline.java:174)
at org.aesh.readline.Readline.readInput(Readline.java:95)
at org.aesh.readline.Readline.access$1000(Readline.java:57)
at org.aesh.readline.Readline$AeshInputProcessor.lambda$start$1(Readline.java:333)
at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:118)
at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:31)
at org.aesh.io.Decoder.write(Decoder.java:133)
at
org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:216)
at
org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:203)
at
org.jboss.as.cli.impl.ReadlineConsole$CLITerminalConnection.lambda$null$1(ReadlineConsole.java:176)
at java.lang.Thread.run(Thread.java:748)
{code}
The same works fine on EAP 7.1