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

ArgumentError (all arguments must be String) when using docker-exec #13388

Closed
eszense opened this issue May 5, 2024 · 1 comment · Fixed by #13488
Closed

ArgumentError (all arguments must be String) when using docker-exec #13388

eszense opened this issue May 5, 2024 · 1 comment · Fixed by #13488

Comments

@eszense
Copy link

eszense commented May 5, 2024

This line seems to have a bug causing error when running docker-exec

output = ""
machine.provider.driver.execute(*exec_cmd, exec_options) do |type, data|
output += data

Steps to reproduce

Environment: Vagrant 2.4.1, macOS 14.2.1

  1. vagrantFile
Vagrant.configure("2") do |config|
  config.vm.provider "docker" do |d|
    d.image = "alpine"
    d.remains_running = true
    d.cmd = ["sleep", "infinity"]
  end
end
  1. vagrant docker-exec -- ls

Output

/opt/vagrant/embedded/gems/gems/childprocess-4.1.0/lib/childprocess/abstract_process.rb:44:in `initialize': all arguments must be String: ["/usr/local/bin/docker", "exec", "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", "ls", {:detach=>false, :pty=>false, :interactive=>false, :prefix=>true}] (ArgumentError)
        from /opt/vagrant/embedded/gems/gems/childprocess-4.1.0/lib/childprocess.rb:23:in `new'
        from /opt/vagrant/embedded/gems/gems/childprocess-4.1.0/lib/childprocess.rb:23:in `new'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/util/subprocess.rb:87:in `execute'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/util/subprocess.rb:25:in `execute'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/plugins/providers/docker/executor/local.rb:20:in `block in execute'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/util/busy.rb:22:in `busy'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/plugins/providers/docker/executor/local.rb:19:in `execute'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/plugins/providers/docker/driver.rb:334:in `execute'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/plugins/providers/docker/command/exec.rb:97:in `exec_command'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/plugins/providers/docker/command/exec.rb:75:in `block in execute'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/plugin/v2/command.rb:249:in `block in with_target_vms'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/plugin/v2/command.rb:238:in `each'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/plugin/v2/command.rb:238:in `with_target_vms'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/plugins/providers/docker/command/exec.rb:70:in `execute'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/cli.rb:67:in `execute'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/environment.rb:319:in `cli'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/bin/vagrant:248:in `<main>'
@allisonlarson
Copy link
Member

Thanks for making this report! This bug has been fixed, and will be available in the next release.

Cheers!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants