NRIA_CACHE_PATH not set errors

After looking at /var/log/syslog, I noticed that we’re constantly getting this warning message and am not sure how to go about fixing it.

newrelic-infra[24450]: time="2019-03-08T14:22:34Z" level=error msg="executing data source" data prefix=integration/com.newrelic.nginx error="exit status 2" plugin name=nginx-server-metrics stderr="time=\"2019-03-08T14:22:34Z\" level=warning msg=\"Environment variable NRIA_CACHE_PATH is not set, using default /tmp/nr-nginx.json\" \npanic: assignment to entry in nil map\n\ngoroutine 1 [running]:\nmain.getMetricsData(0xc42000e080, 0x0, 0x0)\n\t/data/jenkins/infra-integrations-release-linux-package-9/go/src/github.com/newrelic/infra-integrations/integrations/nginx/src/metrics.go:179 +0x2a6\nmain.main()\n\t/data/jenkins/infra-integrations-release-linux-package-9/go/src/github.com/newrelic/infra-integrations/integrations/nginx/src/nginx.go:35 +0x10d\n"

$ newrelic-infra --version
New Relic Infrastructure Agent version: 1.2.15

Any suggestions?

Thanks in advance,
Robby

Hi @nikeinc

Thanks for sending over that log line. The NRIA_CACHE_PATH error is nothing to worry about, but it looks like metrics may be failing to get picked up correctly. In order to properly troubleshoot this, will you please send over the following details?

  1. Your integration config file, nginx-config.yml
  2. Let us know whether you’re using the HTTP status module or the HTTP stub status module as mentioned in this documentation.

Once we have this information, we should be able to provide further help.

Sure thing – here is is. Only thing that I noticed is maybe the ‘env’ setting for ‘staging01’ is the name of the server vs it being the ‘staging’ environment that Rails is running in. Could that be it?

$$:/etc/newrelic-infra/integrations.d# cat nginx-config.yml

integration_name: com.newrelic.nginx

instances:
- name: nginx-server-metrics
command: metrics
arguments:
status_url: http: // 127.0.0.1/status
labels:
env: production
role: load_balancer

- name: nginx-server-inventory
  command: inventory
  arguments:
      config_path: /etc/nginx/nginx.conf
  labels:
      env: staging01
      role: load_balancer

note: I had to modify the http:// localhost above with a space as this tool wouldn’t let me post a link. :wink:

Hi @nikeinc,

Thanks for sending over that config. However, in order to properly troubleshoot, will you please run the following curl command and share the full output in this thread?

curl -iv http://127.0.0.1/status

This will perform a very similar operation as the integration, and the output should provide some clue as the where the disconnect is happening.

Curl -iv output.txt (8.4 KB)
Did anyone found solution for this error? am facing similar issue. I have attached curl -iv outcome.

below is the error am getting:

time=“2019-10-28T06:39:18Z” level=info msg=“runtime configuration” agentUser=root component=“New Relic Infrastructure Agent” executablePath= maxProcs=1 pluginDir="[/etc/newrelic-infra/integrations.d /var/db/newrelic-infra/integrations.d]"
time=“2019-10-28T06:39:20Z” level=info msg=“Checking network connectivity…” component=AgentService service=newrelic-infra
time=“2019-10-28T06:39:21Z” level=info msg=Initializing component=AgentService elapsedTime=2.779837232s service=newrelic-infra
time=“2019-10-28T06:39:26Z” level=info msg=“New Relic Infrastructure Agent Running” component=AgentService elapsedTime=7.083487894s service=newrelic-infra
time=“2019-10-28T06:39:26Z” level=info msg=connecting component=Agent
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=metadata/attributes
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=metadata/system
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=metadata/host_aliases
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=metadata/proxy_config
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=metadata/agent_config
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=services/upstart
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=services/systemd
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=metadata/facter_facts
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=sessions/users
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=services/daemontools
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=services/supervisord
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=system/network_interfaces
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=kernel/sysctl
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=kernel/modules
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=services/pidfile
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=config/sshd
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=packages/dpkg
time=“2019-10-28T06:39:26Z” level=info msg=“Agent plugin” plugin=config/selinux
time=“2019-10-28T06:39:26Z” level=info msg=“Integration info” arguments=“map[remote_monitoring:true status_url:http://mds:mds@10.0.0.122/manager/status/all status_module:discover]” command=metrics commandLine="[./bin/nr-nginx -metrics]" env-vars=“map[PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin VERBOSE:0 STATUS_URL:http://mds:mds@10.0.0.122/manager/status/all STATUS_MODULE:discover REMOTE_MONITORING:true]” instance=nginx-server-metrics integration=com.newrelic.nginx interval=30 labels=“map[env:production role:load_balancer]” os=linux prefix=integration/com.newrelic.nginx protocolVersion=3 workingDir=/var/db/newrelic-infra/newrelic-integrations
time=“2019-10-28T06:39:26Z” level=info msg=“Integration info” arguments=“map[config_path:/etc/nginx/nginx.conf remote_monitoring:true]” command=inventory commandLine="[./bin/nr-nginx -inventory]" env-vars=“map[REMOTE_MONITORING:true PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin VERBOSE:0 CONFIG_PATH:/etc/nginx/nginx.conf]” instance=nginx-server-inventory integration=com.newrelic.nginx interval=60 labels=“map[role:load_balancer env:production]” os=linux prefix=config/nginx protocolVersion=3 workingDir=/var/db/newrelic-infra/newrelic-integrations
time=“2019-10-28T06:39:26Z” level=warning msg=“unable to use upstart” error=“fork/exec /sbin/initctl: no such file or directory” plugin=Upstart
time=“2019-10-28T06:39:26Z” level=info msg=“Integration health check starting” instance=nginx-server-metrics integration=com.newrelic.nginx prefix=integration/com.newrelic.nginx working-dir=/var/db/newrelic-infra/newrelic-integrations
time=“2019-10-28T06:39:26Z” level=info msg=“Integration health check starting” instance=nginx-server-inventory integration=com.newrelic.nginx prefix=config/nginx working-dir=/var/db/newrelic-infra/newrelic-integrations
time=“2019-10-28T06:39:26Z” level=error msg=“Integration command failed” error=“exit status 2” instance=nginx-server-metrics integration=com.newrelic.nginx prefix=integration/com.newrelic.nginx stderr=“panic: assignment to entry in nil map\n\ngoroutine 1 [running]:\nmain.getDiscoveredMetricsData(0xc4200696e0, 0x0, 0x0)\n\t/data/jenkins/infra-integrations-nri-nginx-release-linux-package-15/go/src/github.com/newrelic/nri-nginx/src/metrics.go:298 +0x2bb\nmain.getMetricsData(0xc4200696e0, 0x0, 0x0)\n\t/data/jenkins/infra-integrations-nri-nginx-release-linux-package-15/go/src/github.com/newrelic/nri-nginx/src/metrics.go:204 +0x456\nmain.main()\n\t/data/jenkins/infra-integrations-nri-nginx-release-linux-package-15/go/src/github.com/newrelic/nri-nginx/src/nginx.go:63 +0x1aa\n” working-dir=/var/db/newrelic-infra/newrelic-integrations

Hi @mohd.sarfaraz

The curl output doesn’t appear to be from the NGINX status module; instead, it looks to be for Apache Tomcat:

<table border="1" cellspacing="0" cellpadding="3">
<tr>
 <td colspan="8" class="title">Server Information</td>
</tr>
<tr>
 <td class="header-center"><small>Tomcat Version</small></td>
 <td class="header-center"><small>JVM Version</small></td>
 <td class="header-center"><small>JVM Vendor</small></td>
 <td class="header-center"><small>OS Name</small></td>
 <td class="header-center"><small>OS Version</small></td>
 <td class="header-center"><small>OS Architecture</small></td>
 <td class="header-center"><small>Hostname</small></td>
 <td class="header-center"><small>IP Address</small></td>
</tr>
<tr>
 <td class="row-center"><small>Apache Tomcat/9.0.27</small></td>
 <td class="row-center"><small>11.0.4+11-post-Ubuntu-1ubuntu218.04.3</small></td>
 <td class="row-center"><small>Ubuntu</small></td>
 <td class="row-center"><small>Linux</small></td>
 <td class="row-center"><small>4.15.0-66-generic</small></td>
 <td class="row-center"><small>amd64</small></td>
 <td class="row-center"><small>tomcat</small></td>
 <td class="row-center"><small>127.0.1.1</small></td>
</tr>
</table>

The NGINX on-host integration collects information from either the NGINX Opensource stub_status module or the NGINX Plus status module. You’ll need to ensure the listener you have configured in your NGINX instance has the status module enabled.

1 Like

Hi Sellefson,

Thanks for helping me out with the information. It resolved when I changed the pointer to nginx.
Appreciate your help!

Regards,
Faraz

1 Like

That’s excellent - thanks for confirming :smiley: