Vagrant 2.1.2
Manjaro Linux 17.1.11
any
https://github.com/coreos/coreos-vagrant/blob/master/Vagrantfile
Installing plugins: vagrant-ignition
...
Installing plugins: vagrant-ignition
Exec error: fork/exec /usr/bin/ruby: argument list too long
Installation of one or more plugins has failed. Aborting.
...
Installation of one or more plugins has failed. Aborting.
vagrant up installs plugin and completes.
Above error happens when setting up any Vagrant project that requires some plugins.
Follow steps from here:
https://github.com/coreos/coreos-vagrant
https://github.com/hashicorp/vagrant/issues/8055#issuecomment-264201024
I have the same issue, it seems when I use system("vagrant plugin install #someplugin) in my Vagrantfile, vagrant figures out it needs to install someplugin before installing someplugin, which ends up as an endless loop. Workaround it by specifying chdir in systemcall.
plugins.each do |plugin|
unless Vagrant.has_plugin?(plugin)
system("vagrant plugin install ${plugin}", :chdir=>"/tmp") || exit!
end
end
I confirm the above issue as well running Vagrant 2.1.2 on mac osx 10.13.2. the workaround from @zymzxq solved the problem for me
Thank you @zymzxq 👍
FYI, I'm using macos 10.12.6
Seeing this with 2.1.2 as well. Had the same block of code for over 2 years, just started acting up recently:
plugins.each do |plugin|
unless Vagrant.has_plugin?(plugin)
puts "Installing vagrant plugin dependency: #{plugin}"
%x(vagrant plugin install #{plugin})
end
end
Only way I've been able to work-around this successfully is by adding the following logic before the plugins loop:
if not (["plugin"].include? ARGV[0])
plugins.each do |plugin|
system("vagrant plugin install #{plugin}", :chdir=>"/tmp") || exit! unless Vagrant.has_plugin?(plugin)
end
end
Vagrant 2.1.2
macOS 10.13.6
coreos-vagrant
So , the cause of this "argument list too long" is vagrant installs plugin vagrant-ignition . I find if the path of Vagrantfile contains like "()" or Non-ASCII characters will get this error .
I change the workspace to Home or other all ascii directory , this error disappear.
I can confirm that the error does not happen on 2.1.1 I downgraded vagrant and the error message: fork/exec /opt/vagrant/embedded/bin/ruby: argument list too long no longer occure.
Thanks
I can confirm that the error does not happen with the exact same Vagrantfile after downgrading to 2.1.1.
Note this trick does not seem to work after vagrant 2.1.3, I have figured out a new one :)
unless Vagrant.has_plugin?(plugin)
# User vagrant plugin manager to install plugin, which will automatically refresh plugin list afterwards
puts "Installing vagrant plugin #{plugin}"
Vagrant::Plugin::Manager.instance.install_plugin plugin
puts "Installed vagrant plugin #{plugin}"
end
Closing this up as these issues were fixed in 2.1.5
Cheers!
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
I have the same issue, it seems when I use
system("vagrant plugin install #someplugin)in my Vagrantfile, vagrant figures out it needs to installsomepluginbefore installingsomeplugin, which ends up as an endless loop. Workaround it by specifyingchdirinsystemcall.