Automattic / wp-calypso-bootstrap

Development environment for Calypso - built with Vagrant and Puppet
GNU General Public License v2.0
33 stars 10 forks source link

Update package sources before performing `puppet` install #10

Closed jeremysawesome closed 7 years ago

jeremysawesome commented 7 years ago

An issue can occur during the puppet install where certain packages are not found. This results in a 404 error which causes the puppet install to fail.

This ulimately results in the following output:

The `puppet` binary appears not to be in the PATH of the guest. This
could be because the PATH is not properly setup or perhaps Puppet is not
installed on this guest. Puppet provisioning can not continue without
Puppet properly installed.

Running apt-get update beforehand helps to mitigate these 404 issues by ensuring that the sources are up to date.

Full Sample Command Line Output

C:\projects\wp-calypso-bootstrap [master ≡]> vagrant provision
==> wp-calypso-1.2: Running provisioner: shell...
    wp-calypso-1.2: Running: C:/.../AppData/Local/Temp/vagrant-shell20170823-12584-ho68c9.sh
==> wp-calypso-1.2: > Installing Puppet
==> wp-calypso-1.2: Reading package lists...
==> wp-calypso-1.2: Building dependency tree...
==> wp-calypso-1.2: Reading state information...
==> wp-calypso-1.2: The following additional packages will be installed:
==> wp-calypso-1.2:   augeas-lenses debconf-utils facter fonts-lato hiera javascript-common
==> wp-calypso-1.2:   libaugeas0 libjs-jquery libruby2.3 libxslt1.1 libyaml-0-2 puppet-common rake
==> wp-calypso-1.2:   ruby ruby-augeas ruby-deep-merge ruby-did-you-mean ruby-json ruby-minitest
==> wp-calypso-1.2:   ruby-net-telnet ruby-nokogiri ruby-power-assert ruby-rgen ruby-safe-yaml
==> wp-calypso-1.2:   ruby-selinux ruby-shadow ruby-test-unit ruby2.3 rubygems-integration unzip
==> wp-calypso-1.2:   virt-what zip
==> wp-calypso-1.2: Suggested packages:
==> wp-calypso-1.2:   augeas-doc mcollective-common apache2 | lighttpd | httpd augeas-tools
==> wp-calypso-1.2:   puppet-el vim-puppet etckeeper ruby-rrd ri ruby-dev bundler
==> wp-calypso-1.2: The following NEW packages will be installed:
==> wp-calypso-1.2:   augeas-lenses debconf-utils facter fonts-lato hiera javascript-common
==> wp-calypso-1.2:   libaugeas0 libjs-jquery libruby2.3 libxslt1.1 libyaml-0-2 puppet
==> wp-calypso-1.2:   puppet-common rake ruby ruby-augeas ruby-deep-merge ruby-did-you-mean
==> wp-calypso-1.2:   ruby-json ruby-minitest ruby-net-telnet ruby-nokogiri ruby-power-assert
==> wp-calypso-1.2:   ruby-rgen ruby-safe-yaml ruby-selinux ruby-shadow ruby-test-unit ruby2.3
==> wp-calypso-1.2:   rubygems-integration unzip virt-what zip
==> wp-calypso-1.2: 0 upgraded, 33 newly installed, 0 to remove and 0 not upgraded.
==> wp-calypso-1.2: Need to get 2,998 kB/8,457 kB of archives.
==> wp-calypso-1.2: After this operation, 38.8 MB of additional disk space will be used.
==> wp-calypso-1.2: Err:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libruby2.3 amd64 2.3.1-2~16.04
==> wp-calypso-1.2:   404  Not Found [IP: 91.189.91.23 80]
==> wp-calypso-1.2: Err:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 ruby2.3 amd64 2.3

.1-2~16.04
==> wp-calypso-1.2:   404  Not Found [IP: 91.189.91.23 80]
==> wp-calypso-1.2: E
==> wp-calypso-1.2: :
==> wp-calypso-1.2: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/r/ruby2.3/libruby2.3_2.

3.1-2~16.04_amd64.deb  404  Not Found [IP: 91.189.91.23 80]
==> wp-calypso-1.2: E
==> wp-calypso-1.2: :
==> wp-calypso-1.2: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/r/ruby2.3/ruby2.3_2.3.1

-2~16.04_amd64.deb  404  Not Found [IP: 91.189.91.23 80]
==> wp-calypso-1.2: E
==> wp-calypso-1.2: :
==> wp-calypso-1.2: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
==> wp-calypso-1.2: ! Unable to install Puppet
==> wp-calypso-1.2: Running provisioner: puppet...
The `puppet` binary appears not to be in the PATH of the guest. This
could be because the PATH is not properly setup or perhaps Puppet is not
installed on this guest. Puppet provisioning can not continue without
Puppet properly installed.
jeremysawesome commented 7 years ago

/cc: @stephanethomas for review 😄

stephanethomas commented 7 years ago

Thanks for your pull request @jeremysawesome!

If we decide to update the package lists from this shell script then we most probably want to remove that step from the Puppet system manifest since there is no need to perform that process twice:

https://github.com/Automattic/wp-calypso-bootstrap/blob/afedb4339364ae15d375a031287405116bc95d9c/puppet/production/modules/system/manifests/init.pp#L14-L17

I'm just wondering if we really need that change. That's the first time we see that specific issue arise, and it looks to me more like an intermittent network failure, or a Vagrant box that needs to be updated. I'm on the fence I suppose, so I'll trust your judgement :).

stephanethomas commented 7 years ago

Closing since I didn't get any answer. Feel free to reopen it later.

stephanethomas commented 6 years ago

I finally encountered this particular issue, and fixed it in https://github.com/Automattic/wp-calypso-bootstrap/commit/3d53997d5aac0a7a35e7edabf8661712ea516b22.