vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

`infer_package': undefined method `size' for nil:NilClass (NoMethodError)

Open torarnv opened this issue 3 years ago • 6 comments

Vagrant 2.3.0/2.3.1 is broken on macOS:

❯ brew install vagrant                                                                                                                                                                                                    29s
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
sambamba

You have 18 outdated formulae and 5 outdated casks installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

==> Downloading https://releases.hashicorp.com/vagrant/2.3.1/vagrant_2.3.1_darwin_amd64.dmg
Already downloaded: /Users/torarne/Library/Caches/Homebrew/downloads/87fc24796f15a694c589d149e0c706d763126d4e6464ec6b72eb50febab5fe01--vagrant_2.3.1_darwin_amd64.dmg
==> Installing Cask vagrant
==> Running installer for vagrant; your password may be necessary.
Package installers may write to any location; options such as `--appdir` are ignored.
installer: Package name is Vagrant
installer: Installing at base path /
installer: The install was successful.
🍺  vagrant was successfully installed!

❯ vagrant                                                                                                                                                                                                                 18s
Vagrant failed to initialize at a very early stage:

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
an invalid or undefined variable.

Path: /opt/vagrant/embedded/gems/2.3.1/gems/google-protobuf-3.21.7-x86_64-darwin/lib/google/protobuf/descriptor_dsl.rb
Line number: 0
Message: undefined method `size'

torarnv avatar Oct 04 '22 10:10 torarnv

❯ vagrant list                                                                                                                                                                                                             6s
Traceback (most recent call last):
	31: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/bin/vagrant:211:in `<main>'
	30: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/bin/vagrant:211:in `new'
	29: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/environment.rb:189:in `initialize'
	28: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/environment.rb:998:in `process_configured_plugins'
	27: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/environment.rb:817:in `vagrantfile'
	26: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/environment.rb:817:in `new'
	25: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/vagrantfile.rb:31:in `initialize'
	24: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/config/loader.rb:116:in `load'
	23: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/config/loader.rb:116:in `each'
	22: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/config/loader.rb:119:in `block in load'
	21: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/config/loader.rb:119:in `each'
	20: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/config/loader.rb:191:in `block (2 levels) in load'
	19: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/config/v2/loader.rb:57:in `merge'
	18: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/registry.rb:48:in `each'
	17: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/registry.rb:48:in `each'
	16: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/registry.rb:49:in `block in each'
	15: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/registry.rb:27:in `get'
	14: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/plugins/kernel_v2/plugin.rb:39:in `block in <class:Plugin>'
	13: from /opt/vagrant/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	12: from /opt/vagrant/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	11: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/plugins/kernel_v2/config/vm.rb:15:in `<top (required)>'
	10: from /opt/vagrant/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	 9: from /opt/vagrant/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	 8: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/protobufs/proto/protostructure_pb.rb:6:in `<top (required)>'
	 7: from /opt/vagrant/embedded/gems/2.3.1/gems/google-protobuf-3.21.7-x86_64-darwin/lib/google/protobuf/descriptor_dsl.rb:460:in `build'
	 6: from /opt/vagrant/embedded/gems/2.3.1/gems/google-protobuf-3.21.7-x86_64-darwin/lib/google/protobuf/descriptor_dsl.rb:460:in `instance_eval'
	 5: from /opt/vagrant/embedded/gems/2.3.1/gems/vagrant-2.3.1/lib/vagrant/protobufs/proto/protostructure_pb.rb:7:in `block in <top (required)>'
	 4: from /opt/vagrant/embedded/gems/2.3.1/gems/google-protobuf-3.21.7-x86_64-darwin/lib/google/protobuf/descriptor_dsl.rb:43:in `add_file'
	 3: from /opt/vagrant/embedded/gems/2.3.1/gems/google-protobuf-3.21.7-x86_64-darwin/lib/google/protobuf/descriptor_dsl.rb:63:in `internal_add_file'
	 2: from /opt/vagrant/embedded/gems/2.3.1/gems/google-protobuf-3.21.7-x86_64-darwin/lib/google/protobuf/descriptor_dsl.rb:284:in `build'
	 1: from /opt/vagrant/embedded/gems/2.3.1/gems/google-protobuf-3.21.7-x86_64-darwin/lib/google/protobuf/descriptor_dsl.rb:245:in `fix_nesting'
/opt/vagrant/embedded/gems/2.3.1/gems/google-protobuf-3.21.7-x86_64-darwin/lib/google/protobuf/descriptor_dsl.rb:106:in `infer_package': undefined method `size' for nil:NilClass (NoMethodError)

torarnv avatar Oct 04 '22 10:10 torarnv

Samme issue when installing package from official website

torarnv avatar Oct 04 '22 10:10 torarnv

2.2.19 works

torarnv avatar Oct 04 '22 10:10 torarnv

2.3.0 fails

torarnv avatar Oct 04 '22 10:10 torarnv

heya @torarnv could you provide some extra information about what version of macOS you are running.

soapy1 avatar Oct 04 '22 20:10 soapy1

Sorry, here's the info, let me know if you need more:

  • macOS 12.6 (21G115)
  • x86_64
  • Xcode 13.4.1

torarnv avatar Oct 05 '22 09:10 torarnv

Closing this, as the cause seems to be a Vagrantfile that was in the directory I was running the command from, and that file included custom ruby helper files.

torarnv avatar Oct 25 '22 13:10 torarnv