Last modified: 2014-09-17 03:41:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72646, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70646 - apt-get update does not always run on initial provision of new vm
apt-get update does not always run on initial provision of new vm
Status: RESOLVED WORKSFORME
Product: MediaWiki-Vagrant
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-10 03:50 UTC by Bryan Davis
Modified: 2014-09-17 03:41 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bryan Davis 2014-09-10 03:50:47 UTC
This has happened to me twice today while I've been testing a bug that only happens on during initial provisioning.

* Vagrant brings up a new VM using a the base image stored on my machine.
* Puppet runs in that VM.
* At some point Puppet decides it needs to install a package via apt.
* The apt cache that is baked into the VM image is used because Puppet decided that this run isn't the run to apply the once-per-hour `apt-get update` command on.
* The apt cache is old enough that the version of the package given in the cache is not available in the upstream apt repo anymore.
* `apt-get install whatever` fails with "Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?"
* The puppet run fails

The hack fix for this is to ssh into the vm and run `sudo apt-get update` followed by running `vagrant provision`.

Is there a way to keep the "schedule => hourly" parameter to Exec['update_package_index'] in Class['apt'] but still ensure that on an initial provision of a VM this is executed? If not we maybe need to switch this to an "onlyif => test `stat -c %Y /var/lib/apt/periodic/update-success-stamp` -le $(( `date +%s` - 3600 ))"
Comment 1 Bryan Davis 2014-09-17 03:41:19 UTC
Updating the base image available on my laptop seems to fix this issue:

$ vagrant box add -f --name trusty-cloud https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box

Vagrant provides a command to do this update more gracefully (`vagrant box update`) but it seems to not work with the unversioned base image that we specify in our Vagrantfile.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links