Emmanuel
Emmanuel

Reputation: 17061

JProfiler remote process list empty after selecting container

I'm using JProfiler 12 and trying to attach via SSH to a remote JVM process in a Docker container. I've followed the instructions here: https://www.ej-technologies.com/products/jprofiler/whatsnew12.html#:~:text=Attaching%20to%20JVMs%20running

Everything is working well until I have to choose the process. The list is empty. There's no error message.

I can't find any such issue anywhere. I found someone else who had folder permission problems but that cannot be my issue since I'm connecting as root. Even when I chmod folder permissions to 777, it still does nothing.

This is what I get:

enter image description here

This is what I should get:

enter image description here

[UPDATE 1 Oct 2021]

One problem is I was using a Kubernetes pod securityContext with readOnlyRootFilesystem, allowPrivilegeEscalation, and dropping some capabilities. When I remove those, I can see the process. But then when I click Open, it fails with this error:

enter image description here

Which seems to indicate that I was using the wrong user (root). But when I switch to that user, I get this error before I can even choose the container:

enter image description here

So now I'm stuck one step earlier.

Upvotes: 2

Views: 474

Answers (1)

Emmanuel
Emmanuel

Reputation: 17061

I figured out a workaround.

It turns out when you use

securityContext:
  readOnlyRootFilesystem: true
  allowPrivilegeEscalation: false
  capabilities:
    drop:
      - <...capabilities...

and

spec:
  securityContext:
    runAsUser: <user id>
    runAsGroup: <group id>
    fsGroup: <id>

then JProfiler can't connect to your container. So get rid of all this. You can even do it at runtime without having to rebuild your container image by editing your Kubernetes deployment kubectl edit deployment to remove these items.

Upvotes: 2

Related Questions