Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Uninitialized Constant Pip #159

Closed
bbatsche opened this issue Sep 15, 2015 · 10 comments
Closed

Uninitialized Constant Pip #159

bbatsche opened this issue Sep 15, 2015 · 10 comments
Labels

Comments

@bbatsche
Copy link

I have manually enabled the pip bucket in my Vagrantfile like so:

# snip...
if Vagrant.has_plugin? "vagrant-cachier"
  config.cache.scope = :box

  config.cache.enable :apt
  config.cache.enable :apt_lists
  config.cache.enable :apt_cacher
  config.cache.enable :composer
  config.cache.enable :bower
  config.cache.enable :npm
  config.cache.enable :gem
  config.cache.enable :pip

  config.cache.enable :generic {
    "rbenv" => { cache_dir: "/usr/local/rbenv/cache" }
  }

  config.cache.synced_folder_opts = {
    type: :nfs,
    # The nolock option can be useful for an NFSv3 client that wants to avoid the
    # NLM sideband protocol. Without this option, apt-get might hang if it tries
    # to lock files needed for /var/cache/* operations. All of this can be avoided
    # by using NFSv4 everywhere. Please note that the tcp option is not the default.
    mount_options: ['rw', 'vers=3', 'nolock']
  }
end

However, this seems to be causing an error when trying to boot the guest OS. Full output below:

==> vagrant: Setting hostname...
==> vagrant: Configuring and enabling network interfaces...
==> vagrant: Exporting NFS shared folders...
==> vagrant: Preparing to edit /etc/exports. Administrator privileges will be required...
==> vagrant: Mounting NFS shared folders...
==> vagrant: Configuring cache buckets...
==> vagrant: Forcing shutdown of VM...
==> vagrant: Destroying VM and associated drives...
==> vagrant: Pruning invalid NFS exports. Administrator privileges will be required...
==> vagrant: Running cleanup tasks for 'ansible' provisioner...
/Users/USERNAME/.vagrant.d/gems/gems/vagrant-cachier-1.2.1/lib/vagrant-cachier/bucket.rb:23:in `const_get': uninitialized constant Pip (NameError)
    from /Users/USERNAME/.vagrant.d/gems/gems/vagrant-cachier-1.2.1/lib/vagrant-cachier/bucket.rb:23:in `install'
    from /Users/USERNAME/.vagrant.d/gems/gems/vagrant-cachier-1.2.1/lib/vagrant-cachier/action/install_buckets.rb:43:in `block in configure_cache_buckets'
    from /Users/USERNAME/.vagrant.d/gems/gems/vagrant-cachier-1.2.1/lib/vagrant-cachier/action/install_buckets.rb:41:in `each'
    from /Users/USERNAME/.vagrant.d/gems/gems/vagrant-cachier-1.2.1/lib/vagrant-cachier/action/install_buckets.rb:41:in `configure_cache_buckets'
    from /Users/USERNAME/.vagrant.d/gems/gems/vagrant-cachier-1.2.1/lib/vagrant-cachier/action/install_buckets.rb:19:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/provision.rb:80:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/USERNAME/.vagrant.d/gems/gems/nugrant-2.1.2/lib/nugrant/vagrant/v2/action/auto_export.rb:18:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/USERNAME/.vagrant.d/gems/gems/vagrant-cachier-1.2.1/lib/vagrant-cachier/action/configure_bucket_root.rb:20:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:15:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/set_name.rb:50:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/box_check_outdated.rb:68:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/match_mac_address.rb:16:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/import.rb:32:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/customize.rb:40:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/USERNAME/.vagrant.d/gems/gems/vagrant-auto_network-1.0.2/lib/auto_network/action/request.rb:24:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:214:in `action_raw'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:191:in `block in action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:516:in `lock'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:178:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:178:in `action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
    from /opt/vagrant/embedded/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
    from /opt/vagrant/embedded/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
@FedericoRessi
Copy link

I have the same problem. This is my Vagrant file:

Vagrant.configure("2") do |config|
  if Vagrant.has_plugin?("vagrant-proxyconf")
    config.proxy.http     = "http://proxy.ir.intel.com:911/"
    config.proxy.https    = "https://proxy.ir.intel.com:911/"
    config.proxy.no_proxy = "/var/run/docker.sock,10.237.214.139,10.237.214.141,10.237.214.149,10.237.214.247,127.0.0.1,192.168.122.1,::1,fressi1,fressi2,fressi3,intel.com,localhost"
    # config.git_proxy = config.proxy
  end

  if Vagrant.has_plugin?("vagrant-cachier")
    # Configure cached packages to be shared between instances of the same base box.
    # More info on the "Usage" link above
    config.cache.scope = :box
    config.cache.enable :pip

    # OPTIONAL: If you are using VirtualBox, you might want to use that to enable
    # NFS for shared folders. This is also very useful for vagrant-libvirt if you
    # want bi-directional sync
    # config.cache.synced_folder_opts = {
      # type: :nfs,
      # The nolock option can be useful for an NFSv3 client that wants to avoid the
      # NLM sideband protocol. Without this option, apt-get might hang if it tries
      # to lock files needed for /var/cache/* operations. All of this can be avoided
      # by using NFSv4 everywhere. Please note that the tcp option is not the default.
      # mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
    # }
  end
end

@fgrehm
Copy link
Owner

fgrehm commented Sep 22, 2015

Sorry, but there hasn't been a release with the changes to enable pip buckets yet as the plugin is currently looking for maintainers. If you want to help out, see #143

Cheers.

@bbatsche
Copy link
Author

I've forked the repository and kicked off my vagrant box with it, and it looks like everything actually works fine on the master branch. Pip cache buckets are created successfully and (after some back and for getting proper versions of python-pip installed and directory permissions set correctly) files are being cached appropriately.

I think the problem is just that the commits 1c3fcd2, 6deb452, 8615b74 aren't in the latest version of the plugin. If you just create a new tag (v1.3.0) everything should be resolved.

@FedericoRessi
Copy link

I figured how to install master branch from bash. It solved this issue for me. It requires git and gem commands installed.

git clone https://github.com/fgrehm/vagrant-cachier.git
cd vagrant-cachier
gem build vagrant-cachier.gemspec
gem install vagrant-cachier-*.gem

@cenkalti
Copy link

cenkalti commented Jan 7, 2016

@fgrehm can you release a new version please?

@fgrehm
Copy link
Owner

fgrehm commented Jul 19, 2016

@cenk sorry for the huge delay but I haven't used vagrant / vagrant-cachier in a long time, as I mentioned before the plugin is looking for maintainers. Unfortunately I'm unable to cut a release for something I'm unable to test 😢

@thenewguy
Copy link

ran into this as well. unfortunately I am not well versed in ruby to help. but wanted to add a +1 in case anyone was watching issues to determine interest.

@howardjones
Copy link

howardjones commented Oct 28, 2016

I have the same problem. In the interest of keeping it moving a little, here's where I got to. I use Vagrant on Windows, and have no clue about Ruby (Python, Perl, PHP sure..., but not Ruby).


Install ruby to match vagrant:

c:\HashiCorp\Vagrant\embedded\bin\ruby.exe -v
http://rubyinstaller.org/downloads/

For me, with latest Vagrant, that was 2.2.5 32-bit
http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.2.5.exe
which installs into c:\ruby22

Then you can get the source, and build it:

git clone https://github.com/fgrehm/vagrant-cachier.git
cd vagrant-cachier
c:\ruby22\bin\gem build vagrant-cachier.gemspec

which produces a .gem file, which you can then install as a Vagrant plugin:

vagrant plugin install vagrant-cachier-1.2.1.gem

And now Vagrant doesn't just crash anymore, but I still don't get any cache files created alongside the (working) apt cache, for any of npm, pip or bower (all in use on my box).

My config is:

if Vagrant.has_plugin?("vagrant-cachier")
  config.cache.scope = :box
  config.cache.enable :npm
  config.cache.enable :bower
  config.cache.enable :pip
end

@howardjones
Copy link

howardjones commented Oct 28, 2016

Actually, for bower and npm, it is working, but only for the vagrant user, since it uses that user's personal .cache directory. pip also caches to the user's .cache directory, but that isn't picked up by cachier. In my case, I'm using a virtualenv, so I'm probably not helping myself :-)

@fgrehm fgrehm added the ignored label Nov 22, 2022
@fgrehm
Copy link
Owner

fgrehm commented Nov 22, 2022

Hey, sorry for the silence here but this project is looking for maintainers 😅

As per #193, I've added the ignored label and will close this issue. Thanks for the interest in the project and LMK if you want to step up and take ownership of this project on that other issue 👋

@fgrehm fgrehm closed this as completed Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants