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

Setting datadog agent permissions to log file not working #12066

Open
pascuflow opened this issue May 17, 2022 · 1 comment
Open

Setting datadog agent permissions to log file not working #12066

pascuflow opened this issue May 17, 2022 · 1 comment

Comments

@pascuflow
Copy link

pascuflow commented May 17, 2022

Describe what happened:

  ----------
    - Type: file
      Path: /home/ubuntu/Projects/livestream/nohup.out
      Status: Error: cannot read file /home/ubuntu/Projects/livestream/nohup.out: stat /home/ubuntu/Projects/livestream/nohup.out: permission denied
      BytesRead: 0
      Average Latency (ms): 0
      24h Average Latency (ms): 0
      Peak Latency (ms): 0
      24h Peak Latency (ms): 0

Describe what you expected:
I expect that after I confirm permissions with getfacl, datadog agent can read the log file:

# file: Projects/livestream/
# owner: ubuntu
# group: ubuntu
user::rwx
user:dd-agent:r-x
group::rwx
group:dd-agent:r-x
mask::rwx
other::rwx

ubuntu@ip-172-31-38-150:~$ getfacl Projects/livestream/nohup.out 
# file: Projects/livestream/nohup.out
# owner: ubuntu
# group: ubuntu
user::rwx
user:dd-agent:r-x
group::---
group:dd-agent:r-x
mask::rwx
other::rwx

sudo systemctl restart datadog-agent
sudo datadog-agent status

Steps to reproduce the issue:

Go through this guide https://docs.datadoghq.com/logs/guide/setting-file-permissions-for-rotating-logs/

Additional environment details (Operating System, Cloud provider, etc):

AWS Linux

@emmercm
Copy link

emmercm commented Apr 23, 2024

I ran into this issue as well, some concrete info about my situation:

  • The EC2 instances are AWS EMR v6.8.0

  • I'm configuring log file reading for the following:

    /mnt/var/log/bootstrap-actions/master.log
    /mnt/var/log/bootstrap-actions/1/controller
    /mnt/var/log/bootstrap-actions/1/stderr
    /mnt/var/log/bootstrap-actions/1/stdout
    
  • All those log files are owned by the hadoop user and group

No amount of sudo chmod -R o+rx /mnt/var/log/bootstrap-actions or sudo chown -R dd-agent:dd-agent /mnt/var/log/bootstrap-actions/* fixed my issue. Instead, https://stackoverflow.com/a/72410946 solved my issue with sudo usermod -aG hadoop dd-agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants