Using librarian-puppet inside a Vagrant box - why does puppetlabs/mysql fail to install?

2.6k Views Asked by At

I'm running into a problem installing puppetlabs/mysql via librarian-puppet within a Vagrant virtual machine. Following a ton of conversation, it seemed as if the most likely issue was that VirtualBox was not allowing symlinks inside the shared directory, however after applying vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"] I see no change in behavior, so I'm left to wonder what component is actually at fault here - Vagrant, Ruby, Puppet, Librarian, the puppetlabs/mysql module, or (most likely) me?

On the host:

$ vagrant --version
Vagrant 1.4.3

On the Vagrant box:

$ uname -a
Linux host 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:40:43 UTC 2013 i686 i686 i386 GNU/Linux

$ which ruby
/home/vagrant/.rbenv/shims/ruby

$ ruby --version
ruby 1.9.3p484 (2013-11-22 revision 43786) [i686-linux]

$ bundle --version
Bundler version 1.5.3

$ cat Gemfile.lock | grep -A 3 librarian-puppet
librarian-puppet (0.9.13)
  json
  librarian (>= 0.1.2)
  open3_backport

This is my Puppetfile:

forge 'http://forge.puppetlabs.com'

# Stuff that we need directly.
mod 'puppetlabs/stdlib'

# 3rd party modules we proxy.
mod 'jfryman/nginx'
mod 'puppetlabs/mysql'
mod 'saz/memcached'
mod 'thomasvandoren/redis'

And here is what happens when I attempt to apply said Puppetfile.

$ librarian-puppet install --verbose
[Librarian] Ruby Version: 1.9.3
[Librarian] Ruby Platform: i686-linux
[Librarian] Rubygems Version: 1.8.23
[Librarian] Librarian Version: 0.1.2
[Librarian] Librarian Adapter: puppet
[Librarian] Librarian Adapter Version: 0.9.13
[Librarian] Project: /vagrant
[Librarian] Specfile: Puppetfile
[Librarian] Lockfile: Puppetfile.lock
[Librarian] Git: /usr/bin/git
[Librarian] Git Version: 1.7.9.5
[Librarian] Git Environment Variables:
[Librarian]   (empty)
[Librarian] Pre-Cached Sources:
[Librarian]   [:forge, "http://forge.puppetlabs.com", {}]
[Librarian] Post-Cached Sources:
[Librarian]   [:forge, "http://forge.puppetlabs.com", {}]
[Librarian] The specfile is unchanged: nothing to do.
[Librarian] Install: dependencies resolved
[Librarian] Pre-Cached Sources:
[Librarian] Post-Cached Sources:
[Librarian]   [:forge, "http://forge.puppetlabs.com", {}]
[Librarian] Executing puppet module install for puppetlabs/stdlib 4.1.0
[Librarian] Executing puppet module install for puppetlabs/apt 1.4.1
[Librarian] Executing puppet module install for puppetlabs/concat 1.1.0-rc1
[Librarian] Executing puppet module install for jfryman/nginx 0.0.7
[Librarian] Executing puppet module install for maestrodev/wget 1.3.1
[Librarian] Executing puppet module install for puppetlabs/firewall 1.0.0
[Librarian] Failed to copy from /vagrant/.tmp/librarian/cache/source/puppet/forge/3792e516e3ff92a0ef9f5e827f8e76eb/puppetlabs/firewall/version/47cd76e43f74bbc2e1baaf194d07e1fa/firewall to /vagrant/modules/firewall preserving file types, trying again without preserving them
[Librarian] Executing puppet module install for puppetlabs/gcc 0.1.0
[Librarian] Executing puppet module install for puppetlabs/mysql 2.2.0
Error: No such file or directory - /vagrant/.tmp/librarian/cache/source/puppet/forge/3792e516e3ff92a0ef9f5e827f8e76eb/puppetlabs/mysql/version/34e90de1478e8a54af7fd56d4a3a7102/mysql/spec/fixtures/modules/mysql
Error: Try 'puppet help module install' for usage
/home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-puppet-0.9.13/lib/librarian/puppet/source/forge.rb:114:in `unlink': Directory not empty - /vagrant/.tmp/librarian/cache/source/puppet/forge/3792e516e3ff92a0ef9f5e827f8e76eb/puppetlabs/mysql/version/34e90de1478e8a54af7fd56d4a3a7102 (Errno::ENOTEMPTY)
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-puppet-0.9.13/lib/librarian/puppet/source/forge.rb:114:in `unlink'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-puppet-0.9.13/lib/librarian/puppet/source/forge.rb:114:in `cache_version_unpacked!'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-puppet-0.9.13/lib/librarian/puppet/source/forge.rb:57:in `install_version!'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-puppet-0.9.13/lib/librarian/puppet/source/forge.rb:263:in `install!'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/manifest.rb:101:in `install!'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/action/install.rb:49:in `block in install_manifests'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/action/install.rb:48:in `each'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/action/install.rb:48:in `install_manifests'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/action/install.rb:39:in `perform_installation'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/action/install.rb:12:in `run'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/cli.rb:165:in `install!'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-puppet-0.9.13/lib/librarian/puppet/cli.rb:71:in `install'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `block (2 levels) in bin!'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/cli.rb:31:in `returning_status'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `block in bin!'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/cli.rb:47:in `with_environment'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/librarian-puppet-0.9.13/bin/librarian-puppet:7:in `<top (required)>'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/bin/librarian-puppet:23:in `load'
  from /home/vagrant/.rbenv/versions/1.9.3-p484/bin/librarian-puppet:23:in `<main>'

It's worth noting that if I run this exact same command a second time it will finish through to completion:

$ librarian-puppet install --verbose
[Librarian] Ruby Version: 1.9.3
[Librarian] Ruby Platform: i686-linux
[Librarian] Rubygems Version: 1.8.23
[Librarian] Librarian Version: 0.1.2
[Librarian] Librarian Adapter: puppet
[Librarian] Librarian Adapter Version: 0.9.13
[Librarian] Project: /vagrant
[Librarian] Specfile: Puppetfile
[Librarian] Lockfile: Puppetfile.lock
[Librarian] Git: /usr/bin/git
[Librarian] Git Version: 1.7.9.5
[Librarian] Git Environment Variables:
[Librarian]   (empty)
[Librarian] Pre-Cached Sources:
[Librarian]   [:forge, "http://forge.puppetlabs.com", {}]
[Librarian] Post-Cached Sources:
[Librarian]   [:forge, "http://forge.puppetlabs.com", {}]
[Librarian] The specfile is unchanged: nothing to do.
[Librarian] Install: dependencies resolved
[Librarian] Pre-Cached Sources:
[Librarian] Post-Cached Sources:
[Librarian]   [:forge, "http://forge.puppetlabs.com", {}]
[Librarian] Failed to copy from /vagrant/.tmp/librarian/cache/source/puppet/forge/3792e516e3ff92a0ef9f5e827f8e76eb/puppetlabs/firewall/version/47cd76e43f74bbc2e1baaf194d07e1fa/firewall to /vagrant/modules/firewall preserving file types, trying again without preserving them
[Librarian] Failed to copy from /vagrant/.tmp/librarian/cache/source/puppet/forge/3792e516e3ff92a0ef9f5e827f8e76eb/puppetlabs/mysql/version/34e90de1478e8a54af7fd56d4a3a7102/mysql to /vagrant/modules/mysql preserving file types, trying again without preserving them
[Librarian] Executing puppet module install for saz/memcached 2.4.0
[Librarian] Executing puppet module install for thomasvandoren/redis 0.0.9

It seems to me that those Failed to copy from errors are probably related, but I've no idea what to make of them.

1

There are 1 best solutions below

0
On BEST ANSWER

By way of follow up, this issue repeated itself in more than one other module besides mysql - the problem is ostensibly that these modules are trying to create symlinks within the Vagrant shared directory (which doesn't work [as expected]).