Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exec error: fork/exec /usr/bin/ruby: argument list too long #9972

Closed
karmux opened this issue Jul 1, 2018 · 10 comments
Closed

Exec error: fork/exec /usr/bin/ruby: argument list too long #9972

karmux opened this issue Jul 1, 2018 · 10 comments

Comments

@karmux
Copy link

karmux commented Jul 1, 2018

Vagrant version

Vagrant 2.1.2

Host operating system

Manjaro Linux 17.1.11

Guest operating system

any

Vagrantfile

https://github.com/coreos/coreos-vagrant/blob/master/Vagrantfile

Debug output

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.

Expected behavior

vagrant up installs plugin and completes.

Actual behavior

Above error happens when setting up any Vagrant project that requires some plugins.

Steps to reproduce

Follow steps from here:
https://github.com/coreos/coreos-vagrant

Workaround

#8055 (comment)

@zymzxq
Copy link

zymzxq commented Jul 2, 2018

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

@websitesca
Copy link

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

@adolfoabegg
Copy link

adolfoabegg commented Jul 16, 2018

Thank you @zymzxq 👍

FYI, I'm using macos 10.12.6

@tonylambiris
Copy link

tonylambiris commented Jul 27, 2018

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

@staylet
Copy link

staylet commented Jul 28, 2018

Vagrant version

Vagrant 2.1.2

Host operating system

macOS 10.13.6

Guest operating system

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.

@jifbrodeur
Copy link

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

@JMLX42
Copy link

JMLX42 commented Aug 5, 2018

I can confirm that the error does not happen with the exact same Vagrantfile after downgrading to 2.1.1.

@zymzxq
Copy link

zymzxq commented Sep 3, 2018

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

@chrisroberts
Copy link
Member

Closing this up as these issues were fixed in 2.1.5

Cheers!

@ghost
Copy link

ghost commented Mar 29, 2020

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.

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants