epickrram / grav

Performance visualisation tools
Apache License 2.0
293 stars 22 forks source link

Permission Denied error while attaching to java process inside the container. #12

Closed sattishv closed 6 years ago

sattishv commented 6 years ago

Hi team,

We aren't able to attach to the java process. Got the below mentioned error while trying to attach to the java process which resides inside the container from the host. Changed the owner permission to all the scripts and tried attaching to the process using the user who owns the process but still the same issue. Could you please review.

./scheduling-profile 90961 ./scheduling-profile: line 25: /tmp/jstack-90961.txt: Permission denied

Thanks Sattish.

epickrram commented 6 years ago

Can you provide more details of the operating environment? You mention "container" but nothing else. Does the file exist? What are the permissions of it?

sattishv commented 6 years ago

Hi Mark,

Thanks for the response. Host kernel version 4.4.0-97-generic #120~14.04.1-Ubuntu. We deployed multiple docker containers on ubuntu host.I am trying to invoke the scheduling profile script on the java process inside the docker container from the host environment.Gave 775 permissions to the script and changed the owner permission to the user who owns the process inside the container. Please let me know if you need further details.

Sattish.

epickrram commented 6 years ago

You'll probably have more luck running the tool from within the docker container. I haven't tested using any of these tools in the way you describe, so it's not really a supported mode.

This post goes into some detail on working with JVMs in docker containers:

http://blog.alicegoldfuss.com/making-flamegraphs-with-containerized-java/

You are probably hitting some of the same issues.

As a workaround, I would suggest running the tools from the container, after connecting with docker exec -it <containerIdOrName> bash.