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

Please add Ubuntu 22.04 support, Ubuntu 20.04 fails with malformed repository line #400

Open
jjperry opened this issue Sep 14, 2023 · 0 comments

Comments

@jjperry
Copy link

jjperry commented Sep 14, 2023

While working to certify Ubuntu 22.04 support in our Chef environment, this cookbook generated errors on Ubuntu.

It said that the deb repository line in the /etc/apt/sources.list.d/newrelic-infra.list was a malformed repository line.

        * file[/etc/apt/sources.list.d/newrelic-infra.list] action create
          - update content in file /etc/apt/sources.list.d/newrelic-infra.list from c81efd to 8c177b
          --- /etc/apt/sources.list.d/newrelic-infra.list       2023-09-13 23:37:08.591295593 +0000
          +++ /etc/apt/sources.list.d/.chef-newrelic-infra20230913-3151-7zpchn.list     2023-09-13 23:37:49.647491073 +0000
          @@ -1 +1 @@
          +deb      [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt main
        * execute[apt-cache gencaches] action run[2023-09-13T23:37:49+00:00] ERROR: execute[apt-cache gencaches] (vmn-newrelic::agent_infra line 415) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
       ---- Begin output of ["apt-cache", "gencaches"] ----
       STDOUT:
       STDERR: E: Malformed entry 1 in list file /etc/apt/sources.list.d/newrelic-infra.list (Component)
       E: The list of sources could not be read.
       ---- End output of ["apt-cache", "gencaches"] ----
       Ran ["apt-cache", "gencaches"] returned 100; ignore_failure is set, continuing

From New Relic's install page, https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/install-infrastructure-monitoring-agent-linux/#ubuntu-version, the line being generated is incorrect and should be including the distribution name (xenial, bionic, groovy, jammy, etc).

For Ubuntu 22.04 this newrelic cookbook generated

deb      [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt main

where New Relic's install webpage has:

deb https://download.newrelic.com/infrastructure_agent/linux/apt/ jammy main

The commands that were being run by Chef on the Ubuntu 22.04 by this supermarket cookbook are

apt-key add /tmp/kitchen/cache/https___download_newrelic_com_infrastructure_agent_gpg_newrelic-infra_gpg
create file /etc/apt/sources.list.d/newrelic-infra with content: 
   deb      [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt main
apt-cache gencaches 
apt-get -q update
apt-cache policy newrelic-infra

Where those on New Relic's Ubuntu install pages are:

curl -fsSL https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/newrelic-infra.gpg
echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt/ jammy main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
sudo apt-get install newrelic-infra -y

The latter set of commands installed the New Relic Infra agent on the Ubuntu 22.04 where the cookbook-generated commands had errors.

  • The apt-key add command generated a deprecation warning: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. It seems that the new process is to use gpg --dearmor instead.
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

1 participant