# Oneagent is unable to log the Java process logs in some cases causing warning messages at the time of process initiation

**URL:** <https://community.dynatrace.com/t/oneagent-is-unable-to-log-the-java-process-logs-in-some-cases-causing-warning-messages-at-the-time-of-process-initiation/17170>\
**Category:** Open Q&A\
**Tags:** oneagent, java\
**Created:** [November 21, 2018, 1:16am UTC](https://community.dynatrace.com/t/oneagent-is-unable-to-log-the-java-process-logs-in-some-cases-causing-warning-messages-at-the-time-of-process-initiation/17170 "2018-11-21T01:16:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![suneel\_k\_kamise](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@suneel\_k\_kamise](https://community.dynatrace.com/u/suneel_k_kamise)\
**Post date:** [November 21, 2018, 1:16am UTC](https://community.dynatrace.com/t/oneagent-is-unable-to-log-the-java-process-logs-in-some-cases-causing-warning-messages-at-the-time-of-process-initiation/17170/1 "2018-11-21T01:16:55Z")

</div>

Hi ,

When I run the beeline command on Hadoop Edge nodes, the commandline shows below warning messages saying permission denied while reading the log files by one agent under “/opt/dynatrace/oneagent/log/java” (on Linux OS). However, when I run the same command as a root its working fine and creating the log files in the same location.

Can you please advise, if there ant config setting can be changes to fix the issue. We noticed this issue with beeline as of now.

Error message:

Cannot open log file ‘/opt/dynatrace/oneagent/log/java/ruxitagent\_org.apache.hadoop.util.VersionInfo\_bootstrap\_57136.0.log’: Permission denied

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 21, 2018, 7:22am UTC](https://community.dynatrace.com/t/oneagent-is-unable-to-log-the-java-process-logs-in-some-cases-causing-warning-messages-at-the-time-of-process-initiation/17170/2 "2018-11-21T07:22:58Z")

</div>

There errors are most likely caused by bad permissions on Oneagent directories.  
- What is the ownership and permissions of /opt/dynatrace/oneagent/log/java ? (post a “ls -al” output)  
- Is your Linux agent running in non root mode or in root mode?

---

<div class="post-metadata">

**Author:** ![suneel\_k\_kamise](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@suneel\_k\_kamise](https://community.dynatrace.com/u/suneel_k_kamise)\
**Post date:** [November 21, 2018, 4:27pm UTC](https://community.dynatrace.com/t/oneagent-is-unable-to-log-the-java-process-logs-in-some-cases-causing-warning-messages-at-the-time-of-process-initiation/17170/3 "2018-11-21T16:27:43Z")

</div>

Yes, the directory owned by root. We see this issue only for maprcli commands. For other Java related apps, it is working fine.

drwxrwxr-t 2 root dtuser 233XX Nov 21 07:00 java

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 21, 2018, 6:52pm UTC](https://community.dynatrace.com/t/oneagent-is-unable-to-log-the-java-process-logs-in-some-cases-causing-warning-messages-at-the-time-of-process-initiation/17170/4 "2018-11-21T18:52:00Z")

</div>

Your current permission require the user starting the Java process to be either root or member of the dtuser group to be able to write logs into this directory. So either you add the write permission to others or you need to add the user into the dtuser group.

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [November 21, 2018, 7:06pm UTC](https://community.dynatrace.com/t/oneagent-is-unable-to-log-the-java-process-logs-in-some-cases-causing-warning-messages-at-the-time-of-process-initiation/17170/5 "2018-11-21T19:06:23Z")

</div>

Did you install the Dynatrace Agent from the root user?

If not, the easiest way will be to reinstall the agent using the root user.

The Dynatrace user will then be given appropriate permissions to instrumentation of application processes.

---

<div class="post-metadata">

**Author:** ![suneel\_k\_kamise](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@suneel\_k\_kamise](https://community.dynatrace.com/u/suneel_k_kamise)\
**Post date:** [December 12, 2018, 6:15pm UTC](https://community.dynatrace.com/t/oneagent-is-unable-to-log-the-java-process-logs-in-some-cases-causing-warning-messages-at-the-time-of-process-initiation/17170/6 "2018-12-12T18:15:47Z")

</div>

Apologies for the late reply.

If I add the WW permissions, the issue is not reoccurring. However, this is not a best practice from Security standards.

Though we installed the agent with a root user, still it is expecting WW permissions. Does Dyntrace has any solution?

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [December 13, 2018, 8:05am UTC](https://community.dynatrace.com/t/oneagent-is-unable-to-log-the-java-process-logs-in-some-cases-causing-warning-messages-at-the-time-of-process-initiation/17170/7 "2018-12-13T08:05:20Z")

</div>

Actually this is ok, the log file directory must be writable for any user. Normally this should have following permissions and ownership:  
drwxrwxrwt 1 root dtuser 182 Dec 13 08:57 log

Notice the t flag, this will prevent removing files not owned by the process.  
The directory must be writable for everybody, since oneagents injected into applications are running in context of the application itself and typically run as different user than the OS part of oneagent.

I think you have some hardening / security script running on your system to find directories writable for everybody and changing permissions. Or someone did this manually.
