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

Clicking on application class in stacktrace causes 500 in dev ui #18676

Closed
Postremus opened this issue Jul 14, 2021 · 10 comments · Fixed by #18761
Closed

Clicking on application class in stacktrace causes 500 in dev ui #18676

Postremus opened this issue Jul 14, 2021 · 10 comments · Fixed by #18761
Labels
area/dev-ui env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@Postremus
Copy link
Member

Describe the bug

I use idea for development.

Stack traces of the application are visible in the dev ui. Application classes are clickable, and should open the file in the ide. (see #15761)

This does not work however in my testing. The http access log simply shows a 500 status code.

Expected behavior

File is opened in idea. If no ide is found, an actionable error message should be shown.

Actual behavior

The http access logs show a status code 500. I was not able to get an stacktrace for this.

2021-07-14 09:54:36,646 INFO  [io.qua.htt.access-log] (vert.x-eventloop-thread-11) 127.0.0.1 - - 14/Jul/2021:09:54:36 +0200 "POST /q/dev/io.quarkus.quarkus-vertx-http/openInIDE HTTP/1.1" 500 - 
Host: localhost:8080
Connection: keep-alive
sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"
Accept: */*
X-Requested-With: XMLHttpRequest
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryq6xHXmAFsFB0AMhL
Origin: http://localhost:8080
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://localhost:8080/q/dev/
Accept-Encoding: gzip, deflate, br
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
content-length: 495
x-quarkus-hot-deployment-done: true

How to Reproduce?

Reproducer:

  1. mvn quarkus:dev
  2. open dev ui, and open the log
  3. in a seperate tab, go to localhost:8080/hello
  4. switch to the dev ui log
  5. click on the SomeResource application class

Output of uname -a or ver

MSYS_NT-10.0 NANB7NLNVP2 2.10.0(0.325/5/3) 2018-06-13 23:34 x86_64 Msys

Output of java -version

openjdk version "11.0.7" 2020-04-14 LTS OpenJDK Runtime Environment Zulu11.39+15-CA (build 11.0.7+10-LTS) OpenJDK 64-Bit Server VM Zulu11.39+15-CA (build 11.0.7+10-LTS, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.0.2.Final

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

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) Maven home: C:\eclipse\tools\apache-maven\bin.. Java version: 11.0.7, vendor: Azul Systems, Inc., runtime: C:\eclipse\tools\java\11 Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Additional information

No response

@Postremus Postremus added the kind/bug Something isn't working label Jul 14, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 14, 2021

/cc @Ladicek, @kenfinnigan

@geoand
Copy link
Contributor

geoand commented Jul 14, 2021

Let me check

@geoand
Copy link
Contributor

geoand commented Jul 14, 2021

I couldn't reproduce this. Do you have a stacktrace perhaps?

@Postremus
Copy link
Member Author

Hi @geoand,
No, was not able to get an stacktrace.
I believe the 500 status code is caused by this line:

if (ide != null) {
typicalProcessLaunch(routingContext, className, lang, srcMainPath, line, ide);
} else {
log.debug("Unhandled IDE : " + ide);
routingContext.fail(500);
}

Activating debug logging for that logger prints following:

Unable to determine proper launch command for IDE: Ide{defaultCommand='eclipse'}

I have in my %PATH% variable an idea.cmd, generated using the jetbrains toolbox.

@geoand
Copy link
Contributor

geoand commented Jul 14, 2021

Would you be willing to debug through io.quarkus.deployment.ide.IdeProcessor and see what Quarkus is figuring out for your environment?

@Postremus
Copy link
Member Author

I'll take a look later today.

@geoand
Copy link
Contributor

geoand commented Jul 14, 2021

Thanks a lot!

@Postremus
Copy link
Member Author

Postremus commented Jul 14, 2021

@geoand
I read through the source of the IdeProcessor a bit, and found some possible culprits.

  1. Detecting the .idea directory is not working for multi module projects.
    https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/ide/IdeProcessor.java#L130-L142

The .idea directory is part of the root project (multi-module-jandex/.idea). The projectRoot variable points to multi-module-jandex/web, where no .idea exists.
In a simple project without any submodules idea is correctly detected.

Unable to determine proper launch command for IDE: Ide{defaultCommand='idea'}
  1. Detecting the running idea process is not working.
    https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/ide/IdeProcessor.java#L62-L72
    The code is searching for "jbr" inside the process command. Which is not the case for my system:
    image

@geoand
Copy link
Contributor

geoand commented Jul 14, 2021

That's very useful information, thanks!

geoand added a commit to geoand/quarkus that referenced this issue Jul 14, 2021
* Test more possible cases for Windows
* Support detection for multi-module projects

Fixes: quarkusio#18676
@geoand
Copy link
Contributor

geoand commented Jul 14, 2021

Would you be able to try #18682 and see if it works on your environment?

Postremus added a commit to Postremus/quarkus that referenced this issue Jul 16, 2021
* Test more possible cases for idea
* correctly add the line argument for idea
* Support detection for multi-module projects

Fixes: quarkusio#18676
Postremus added a commit to Postremus/quarkus that referenced this issue Jul 16, 2021
* Test more possible cases for idea
* correctly add the line argument for idea
* Support detection for multi-module projects

Fixes: quarkusio#18676
Postremus added a commit to Postremus/quarkus that referenced this issue Jul 19, 2021
* Test more possible cases for idea
* correctly add the line argument for idea
* Support detection for multi-module projects

Fixes: quarkusio#18676
Postremus added a commit to Postremus/quarkus that referenced this issue Jul 19, 2021
* Test more possible cases for idea
* correctly add the line argument for idea
* Support detection for multi-module projects

Fixes: quarkusio#18676
geoand added a commit that referenced this issue Jul 20, 2021
@quarkus-bot quarkus-bot bot added this to the 2.2 - main milestone Jul 20, 2021
@gsmet gsmet modified the milestones: 2.2 - main, 2.1.0.Final Jul 21, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 21, 2021
* Test more possible cases for idea
* correctly add the line argument for idea
* Support detection for multi-module projects

Fixes: quarkusio#18676
(cherry picked from commit ec335b6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dev-ui env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants