Infrastructure-agent-installer fails on MacOS beta bug

AdvThanksance!!!

Following the Guided Install, to install New Relic directly onto my Big Sur MacOS host as I want to be able to import logs from Docker containers.

This is a beta release for MacOS that I had not seen before. The error messages appears to be a regular expression in need of execution. In addition, it is unclear where the directory/file is supposed to be located. I tried a couple of educated guesses with the current and my ~/.newrelic directories.

$ curl -Ls https://raw.githubusercontent.com/newrelic/newrelic-cli/master/scripts/install.sh | bash && sudo  NEW_RELIC_API_KEY=NRAK-5Z1...XOC NEW_RELIC_ACCOUNT_ID=32...59 /usr/local/bin/newrelic install
Starting installation.
Installing New Relic CLI v0.34.9
JnInstalling to /usr/local/bin using sudo
Password:

   _   _                 ____      _ _
  | \ | | _____      __ |  _ \ ___| (_) ___
  |  \| |/ _ \ \ /\ / / | |_) / _ | | |/ __|
  | |\  |  __/\ V  V /  |  _ |  __| | | (__
  |_| \_|\___| \_/\_/   |_| \_\___|_|_|\___|

  Welcome to New Relic. Let's install some instrumentation.

  Questions? Read more about our installation process at
  https://docs.newrelic.com/

	
INFO Validating connectivity to the New Relic platform... 
    ✅ Checking for data in New Relic (this may take a few minutes)...success.
The guided installation will begin by installing the latest version of the New Relic Infrastructure agent, which is required for additional instrumentation.

The following will be installed:
  Infrastructure Agent

==> Installing infrastructure-agent-installer...
sed: can't read /^staging/d: No such file or directory
==> Installing infrastructure-agent-installer...failed.

  One or more installations failed.  Check the install log for more details: /Users/kwiechm/.newrelic/newrelic-cli.log

FATAL We encountered an error during the installation: exit status 2: sed: can't read /^staging/d: No such file or directory. If this problem persists please visit the documentation and support page for additional help here: https://one.newrelic.com/-/06vjAeZLKjP

Have also had an error with:

==> Installing infrastructure-agent-installer...
sed: can't read /^proxy/d: No such file or directory
==> Installing infrastructure-agent-installer...failed.

Meanwhile you are waiting for the response from the support, you could debug the installation process like this. the install command line is composed of two commands. The first part could be run to debug installing the newrelic cli tool and infrastructure package by executing like this:
curl -Ls https://raw.githubusercontent.com/newrelic/newrelic-cli/master/scripts/install.sh | bash -x
Once you checked no error at the previous process, then you can debug it for the second part of installing process that newrelic cli is trying to install the downloaded package.
curl -Ls https://raw.githubusercontent.com/newrelic/newrelic-cli/master/scripts/install.sh | bash && sudo NEW_RELIC_API_KEY=NRAK-XXXXXXXXXXXXXXXXX NEW_RELIC_ACCOUNT_ID=0000000 /usr/local/bin/newrelic install --trace

This works for BigSur 11.4. I hope this helps you to move forward.
Note: please note that KEY and USER ID are obfuscated and you need to replace it with your own values.

1 Like

This seems to be an issue with sed on macOS. While we try to clarify, the manual steps via Homebrew are documented here: Install the infrastructure monitoring agent for macOS | New Relic Documentation

I see you mentioned you are looking to forward Docker logs to New Relic. Can you share a bit more context on your environment? Note that the initial macOS beta does not support the Docker integration (see limitations in the link above). The alternative might be to use the containerized version of the agent (depending on the use case): Docker container for infrastructure monitoring | New Relic Documentation

AdvThanksance!!!

Here is information on my version of sed:

$ which sed
/usr/local/opt/gnu-sed/libexec/gnubin/sed
$ sed --version
sed (GNU sed) 4.8
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
Paolo Bonzini, Jim Meyering, and Assaf Gordon.

This sed program was built without SELinux support.

GNU sed home page: .
General help using GNU software: .
E-mail bug reports to: .

Was installing the infrastructure monitoring agent directly into my macOS host as the Docker containerized version specifically said that it would not be able to forward with logs. My assumption for forwarding log files was the Forward your logs using the infrastructure agent | New Relic Documentation documentation might be out of date and not have included macOS.

Thanks for clarifying. As I now understand it, no containerized infrastructure agents support log forwarding at this time (and presumably can’t). When installing on macOS, the non-containerized Beta version currently does not support log forwarding at this time. Any ETA? Until there is an option to forward logs, will stick with the containerized version and revisit later. It avoids extra steps when setting up a local development environment.

I have the following containers spun up for a local Drupal install. I use Docksal to aid in setup:

Docker containers

fusion-151-newrelic_agent_1 # infrastructure agent
fusion-151-newrelic_browser_1 # browser for testing
fusion-151-newrelic_cli_1 # php 7.4
fusion-151-newrelic_db_1 # mysql 5.6
fusion-151-newrelic_memcached_1 # memcache
fusion-151-newrelic_web_1 # apache 2.4

Hey there @kevin.s.wiechmann,

I know it’s been a bit, but it looks like that issue has been resolved in a more-recent release of the infrastructure agent. Can you please attempt the installation again and see if you run into the same error message? If you do, please let me know and I’ll make sure the engineering team is alerted to the problem.

Thanks!

ran this and traced it as following.
method=POST status_code=401 url="https://api.newrelic.com/graphql"

FATAL could not fetch license key for account 3499444: 401 response returned: Invalid credentials provided. Missing API key or an invalid API key was provided.

looks like the problem is from newrelic’s end! pathetic!

Hey there @mrrmmonty,

We are sorry you are experiencing this issue and appreciate you reaching out to raise awareness on this issue. I am looping in an engineer from the team to help look into this further and find a resolution. We appreciate your patience as we work through this. Please let us know if we can assist with anything else a well!

Hi @mrrmmonty,
please verify which licence key you are using. I believe it should be the ‘INGEST - LICENSE’ key.

Ingest keys are for getting data into New Relic:
License keys for agent configuration and metric, event, log and trace APIs
Browser keys for browser applications
Mobile keys for mobile applications. To learn how to manage mobile keys, see our docs
User keys are for querying data and managing configurations (Alerts, Synthetics, dashboards, etc.)
To learn more about API keys, see our docs