Problem
The infrastructure agent is not starting, and logs are not created.
Solution
Here are some troubleshooting options for non-root users if the infrastructure agent is not starting and there are no logs:
Check requiretty
To see if requiretty
is causing logging issues:
In
/var/log/messages
or/var/log/syslog
, look for the messagesudo: sorry, you must have a tty to run sudo
.Important
When using old Linux versions, sometimes the
nri-agent
user fails to execute a service because it does not have any TTY attached.If you find this message, edit your
/etc/sudoers
file with thevisudo
command and comment or remove the following line:Defaults requiretty
Save and exit the file.
Restart the
newrelic-infra
service.
Review log permissions
Check the agent's permission to open log_file
. It's possible that the log file you are using was created when the agent was running as root, and now the nri-agent
user does not have permissions to write it.
To solve this, try one of these options:
Change the owner of the log file.
Change the
log_file
entry in the/etc/newrelic-infra.yml
configuration file. Our installation scripts create the/var/log/newrelic-infra/
folder for that purpose, so we recommend the following value:log_file: /var/log/newrelic-infra/newrelic-infra.log