cryostatio / cryostat

Secure JDK Flight Recorder management for containerized JVMs
https://cryostat.io
Other
8 stars 8 forks source link

[Bug] JMX connection failures due to auth result in HTTP 504, not HTTP 427 #438

Closed andrewazores closed 2 months ago

andrewazores commented 2 months ago

Current Behavior

See #350

When attempting to connect to a target using JMX authentication, and when Cryostat does not have any corresponding stored credentials, Cryostat should fail the connection and respond to the client with an HTTP 427.

Expected Behavior

Cryostat instead takes some time and then responds with HTTP 504.

Steps To Reproduce

  1. ./smoketest.bash -t
  2. Select the vertx-fib-demo-2:9094 target, which uses JMX auth
  3. Go to Events view to try to view event templates

Environment

No response

Anything else?

No response

andrewazores commented 2 months ago

Bisect shows that this started with https://github.com/cryostatio/cryostat3/pull/424

andrewazores commented 2 months ago

Looks like it just comes down to:

diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index adef239..67b8e7f 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -1,3 +1,4 @@
+quarkus.naming.enable-jndi=true
 cryostat.discovery.jdp.enabled=false
 cryostat.discovery.containers.poll-period=10s
 cryostat.discovery.containers.request-timeout=2s

Not even sure why that got into the PR...