chef-newrelic-sysmond icon indicating copy to clipboard operation
chef-newrelic-sysmond copied to clipboard

apt repository path is wrong

Open duckworth opened this issue 8 years ago • 5 comments

All of a sudden this started failing on ubuntu 14 with an error that it cannot find the newrelic repository packages. It is adding the apt_repository resource with the distribution name (trusty) but that is no longer on New Relics servers.

/etc/apt/sources.list.d/newrelic.list
deb      "http://apt.newrelic.com/debian/" trusty newrelic non-free

which gives the error.

 Err http://apt.newrelic.com trusty/newrelic amd64 Packages
          404  Not Found
 Err http://apt.newrelic.com trusty/non-free amd64 Packages
         404  Not Found

If I remove the distribution "trusty" it works. Is the apt_repository resource adding the distribution automatically? It may need to be provided and an attribute to override.

duckworth avatar Apr 20 '16 15:04 duckworth

1+

alexleone avatar Apr 20 '16 16:04 alexleone

FWIW, It's the apt_repository resource here that's adding the distro name.

In case it helps, here's the quick and dirty fix I'm using in my wrapper cookbook to get around this for now:

begin
  r = resources(:apt_repository => "newrelic")
  r.distribution = ""
rescue
  Chef::Log.error "could not patch newrelic apt_repository"
end

kylemcc avatar Apr 20 '16 20:04 kylemcc

I have submitted a pull request https://github.com/phlipper/chef-newrelic-sysmond/pull/31 that sets the default distribution = "" and tested locally and it works.

I will use this override in our wrapper for now, thanks.

duckworth avatar Apr 20 '16 20:04 duckworth

+1

tejaycar avatar Apr 21 '16 18:04 tejaycar

+1

deees avatar Apr 22 '16 18:04 deees