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

dd-agent package does not upgrade when previously installed #147

Closed
uduncanu opened this Issue Oct 20, 2014 · 7 comments

Comments

Projects
None yet
4 participants
@uduncanu
Copy link

uduncanu commented Oct 20, 2014

We've got a load of servers where the dd-agent package (4.3.1-522) was previously installed via Chef (v10) with this cookbook. We are attempting to upgrade it to the latest version, using the dd-agent recipe. It isn't upgrading to the latest version on its own.

The only part of the recipe I can see that would actually perform an upgrade is the package command included below, which requires dd_agent_version to be the latest version that we're trying to install, however that's set to nil in the default attributes file. The end result is that it's essentially not specifying the version to install.

The default action with the package command is :install, and as there's already a version installed and no version specified, Chef doesn't take any further action, and so the dd-agent package doesn't get upgraded.

attributes/default.rb:

default['datadog']['agent_version'] = nil

recipes/dd-agent.rb:

dd_agent_version = node['datadog']['agent_version']
...
  package 'datadog-agent' do
    version dd_agent_version
  end
@miketheman

This comment has been minimized.

Copy link
Collaborator

miketheman commented Oct 20, 2014

Related: #127

@miketheman

This comment has been minimized.

Copy link
Collaborator

miketheman commented Oct 20, 2014

@uduncanu If the version attribute is not set (nil), then Chef will default to :install the latest version.

If a version is specified, like 1:5.0.4-516 (current package version string for Ubuntu), then the Chef package provider will use this version to ensure that the package is then installed.

We've discussed adding an :upgrade action before, and haven't done it yet due to the possibility of having problems with an automatic upgrade could quickly affect an entire cluster.

Please try this approach of setting the specific version string in a node attribute and running Chef - this should upgrade the package to the desired version.

@miketheman miketheman added the feature label Oct 20, 2014

@uduncanu

This comment has been minimized.

Copy link
Author

uduncanu commented Oct 20, 2014

@miketheman Thanks for the response, and I can see why upgrading automatically would be risky. Have you considered having two channels of the agent - a stable one that can safely be upgraded without much thought, and a beta/preview one that's being tested in live environments before hitting the stable channel?

It would probably be good if this were documented somewhere, especially with upgrades to 5.0.0 being required by Friday. I've had to go digging to find out what was preventing it upgrading, and I'd guess other people will be in the same boat.

@miketheman

This comment has been minimized.

Copy link
Collaborator

miketheman commented Oct 20, 2014

@uduncanu That's something we've discussed internally before - haven't figured out the best method for that yet - but I'm certain we'll discuss the "unstable" channel again.
/cc: @remh

And documentation for the upgrade process is a good idea, not sure where we'd put this for Chef-specific upgrade path.
/cc: @alq666

@joelnn

This comment has been minimized.

Copy link

joelnn commented Oct 21, 2014

Just came across this as well. I would like to be able to choose (i.e. as a non-default option) to always upgrade the agent.

Agreed that it could be a risk in some environments to upgrade simultaneously and break the whole cluster, but I mitigate that by running chef in a rolling fashion across my machines. Idempotency is never perfect, and there is always a risk with an upgrade, whether its intentional or automatic.

In my org I'm more concerned about the risk that we'll neglect to upgrade the agent.

@akshah123

This comment has been minimized.

Copy link

akshah123 commented Nov 4, 2014

👍 for an attribute that would automatically upgrade to the latest stable version.

@miketheman miketheman added this to the Next minor milestone Nov 4, 2014

@miketheman miketheman self-assigned this Nov 4, 2014

@miketheman

This comment has been minimized.

Copy link
Collaborator

miketheman commented Jan 27, 2015

Fixed in b8518fd

@miketheman miketheman closed this Jan 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.