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

apt-get throws exit code 100 when upgrading docker #30

Closed
jayofdoom opened this issue Dec 3, 2013 · 4 comments
Closed

apt-get throws exit code 100 when upgrading docker #30

jayofdoom opened this issue Dec 3, 2013 · 4 comments

Comments

@jayofdoom
Copy link
Contributor

Hey,

When I'm using the cookbook to upgrade docker, it fails with exit code 100. Upon logging into the machine and running "apt-get -f install" I see this:

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up lxc-docker-0.7.0 (0.7.0) ...

Configuration file `/etc/init/docker.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** docker.conf (Y/I/N/O/D/Z) [default=N] ? 
Installing new version of config file /etc/init.d/docker ...
Setting up lxc-docker (0.7.0) ...

This is obviously expected, as the chef cookbook overwrites this file. I think we need to somehow preseed dpkg to know what to do in this scenario, then ensure we overwrite the docker.conf + restart docker again AFTER the package installs.

I'm not sure how to do this though, but I can look into it when I have time if you aren't sure either.

@bflad
Copy link
Contributor

bflad commented Dec 3, 2013

The recipe is using the --force-yes option for the package resource, which is not the same as -f (fix broken) like you have above. What happens when you run with --force-yes? Can you post the DEBUG output from the Chef run? I'll test later this evening myself.

@bflad
Copy link
Contributor

bflad commented Dec 4, 2013

Okay, I could confirm and create a reproducible case of the behavior you were seeing by:

  • set['docker']['version'] = '0.6.7'
  • Run Chef to install lxc-docker-0.6.7
  • set['docker']['package']['action'] = 'upgrade' # not necessary on Ubuntu due to how Docker PPA doesn't use real package version tags, but good habit
  • set['docker']['version'] = '0.7.0'
  • Run Chef to try and upgrade, see above apt-get/dpkg error

In your case and judging from your bug report, I imagine you actually might have been seeing this issue even without specifying node['docker']['version'] after a new Docker is released.

In any event, the fix is specifying some additional dpkg options to the package installation/upgrade:
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"

I'm pushing out 0.19.1 shortly with this fix. Can you please test this out? Thanks!

Aside: The Docker folks could switch to submitting to the Ubuntu repositories or a better packaging tool that allows using real version tags (lxc-docker=0.7.0) instead of renaming the packages (lxc-docker-0.7.0). Wouldn't necessarily have helped here, but would make things slightly easier IMO for everyone. See/vote here: moby/moby#979

@jayofdoom
Copy link
Contributor Author

+1 to that fix. It corrected the issues for me

@bflad
Copy link
Contributor

bflad commented Dec 16, 2013

Awesome. Going to close this out, but please don't hesitate to reopen if things are still not working.

@bflad bflad closed this as completed Dec 16, 2013
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

2 participants