The agent is not starting and there are no logs

Problem

The Infrastructure agent is not starting, and there are no logs.

Solution

To start the agent and generate logs:

  1. Look for the message ​sudo: sorry, you must have a tty to run sudo in /var/log/messages or /var/log/syslog. 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 the visudo command and comment or remove the following line:

    Defaults requiretty

    After exiting and saving the file, restart the newrelic-infra service.

  2. Check the agent's permission to open the 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, you need to change the owner of the log file or just 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 a recommended value would be:

    log_file: /var/log/newrelic-infra/newrelic-infra.log

For more help

Recommendations for learning more: