quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.85k stars 2.7k forks source link

Getting `Task failed: java.io.IOException...` when exiting with "q" or "ctrl+c" in `quarkus dev` #38042

Open carlosedp opened 10 months ago

carlosedp commented 10 months ago

Describe the bug

Whenever I use quarkus dev or quarkus test on Mac, after generating some request/run tests if I press "q" to exit or "ctrl+c", I get:

❯ quarkus dev
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< org.acme:scala3-quarkus-quickstart >-----------------
[INFO] Building scala3-quarkus-quickstart 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- quarkus:3.6.4:dev (default-cli) @ scala3-quarkus-quickstart ---
[INFO] Invoking scala:4.8.1:add-source (scala-compile-first) @ scala3-quarkus-quickstart
[INFO] Invoking scala:4.8.1:compile (scala-compile-first) @ scala3-quarkus-quickstart
[INFO] compile in 1.5 s
[INFO] Invoking resources:3.3.1:resources (default-resources) @ scala3-quarkus-quickstart
[INFO] Copying 2 resources from src/main/resources to target/classes
[INFO] Invoking quarkus:3.6.4:generate-code (default) @ scala3-quarkus-quickstart
[INFO] Invoking compiler:3.12.1:compile (default-compile) @ scala3-quarkus-quickstart
[INFO] Nothing to compile - all classes are up to date.
[INFO] Invoking scala:4.8.1:add-source (scala-test-compile) @ scala3-quarkus-quickstart
[INFO] Invoking scala:4.8.1:testCompile (scala-test-compile) @ scala3-quarkus-quickstart
[INFO] compile in 0.2 s
[INFO] Invoking resources:3.3.1:testResources (default-testResources) @ scala3-quarkus-quickstart
[INFO] skip non existing resourceDirectory /Users/cdepaula/repos/scala/scala3-quarkus-quickstart/src/test/resources
[INFO] Invoking quarkus:3.6.4:generate-code-tests (default) @ scala3-quarkus-quickstart
[INFO] Invoking compiler:3.12.1:testCompile (default-testCompile) @ scala3-quarkus-quickstart
[INFO] Nothing to compile - all classes are up to date.
Listening for transport dt_socket at address: 5005
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2024-01-04 14:16:38,879 INFO  [io.quarkus] (Quarkus Main Thread) scala3-quarkus-quickstart 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.6.4) started in 2.890s. Listening on: http://0.0.0.0:8080

2024-01-04 14:16:38,885 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2024-01-04 14:16:38,887 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy-reactive, scala3, smallrye-context-propagation, vertx]
2024-01-04 14:16:46,003 INFO  [io.quarkus] (Shutdown thread) scala3-quarkus-quickstart stopped in 0.014s
Exception in thread "Console Shutdown Hook" java.io.IOError: java.io.IOException: Error executing 'stty icrnl ixon echo icanon iexten intr ^C': stty: 'standard input': unable to perform all requested operations

    at org.aesh.readline.terminal.impl.AbstractPosixTerminal.setAttributes(AbstractPosixTerminal.java:56)
    at org.aesh.readline.tty.terminal.TerminalConnection.setAttributes(TerminalConnection.java:180)
    at io.quarkus.deployment.console.AeshConsole.end(AeshConsole.java:167)
    at io.quarkus.deployment.console.AeshConsole.lambda$setup$2(AeshConsole.java:303)
    at org.aesh.readline.tty.terminal.TerminalConnection.close(TerminalConnection.java:346)
    at io.quarkus.deployment.console.AeshConsole$2.run(AeshConsole.java:88)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.io.IOException: Error executing 'stty icrnl ixon echo icanon iexten intr ^C': stty: 'standard input': unable to perform all requested operations

    at org.aesh.readline.terminal.impl.ExecPty.exec(ExecPty.java:460)
    at org.aesh.readline.terminal.impl.ExecPty.setAttr(ExecPty.java:215)
    at org.aesh.readline.terminal.impl.AbstractPosixTerminal.setAttributes(AbstractPosixTerminal.java:54)
    ... 6 more

--
Press [e] to edit command line args (currently ''), [:] for the terminal, [h] for more options>[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  18.141 s
[INFO] Finished at: 2024-01-04T14:16:46-03:00
[INFO] ------------------------------------------------------------------------

If I do not generate any requests to endpoints, the application exits normally without the error by pressing "q". Using "Ctrl+c" still generates the error.

Expected behavior

No error on exit

Actual behavior

Error is printed to console.

How to Reproduce?

I've been using my quickstart on https://github.com/carlosedp/scala3-quarkus-quickstart.git

Output of uname -a or ver

Darwin MBP16 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:21:56 PDT 2023; root:xnu-8796.141.3~6/RELEASE_X86_64 x86_64 i386 Darwin

Output of java -version

openjdk version "21.0.1" 2023-10-17 OpenJDK Runtime Environment GraalVM CE 21.0.1+12.1 (build 21.0.1+12-jvmci-23.1-b19) OpenJDK 64-Bit Server VM GraalVM CE 21.0.1+12.1 (build 21.0.1+12-jvmci-23.1-b19, mixed mode, sharing)

Quarkus version or git rev

3.6.4

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Additional information

No response

carlosedp commented 10 months ago

This looks like a similar error: https://github.com/jline/jline3/issues/97

I have homebrew coreutils installed as well.

❯ which stty
/usr/local/bin/gstty
❯ whence stty
stty is hashed to /usr/local/bin/gstty
stty is /usr/local/opt/coreutils/libexec/gnubin/stty
stty is /bin/stty

Bypassing homebrew coreutils with PATH="/bin:$PATH" quarkus dev doesn't print the error when exiting.

geoand commented 10 months ago

cc @stalep