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

vagrant up throws an error (already tested everything) #10511

Closed
eyemiru opened this issue Dec 17, 2018 · 8 comments
Closed

vagrant up throws an error (already tested everything) #10511

eyemiru opened this issue Dec 17, 2018 · 8 comments

Comments

@eyemiru
Copy link

eyemiru commented Dec 17, 2018

Vagrant version

2.2.2

Oracle version

5.2.22r126460

Host operating system

Windows 10 Pro (64 Bit)

Guest operating system

CentOS 7 / Debian

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

  VAGRANT_COMMAND = ARGV[0]

Vagrant.configure(2) do |config|
  config.vm.box_url = "url"
  config.vm.box = "centos7"
    
  if VAGRANT_COMMAND == "ssh"
      config.ssh.username = 'vagrant'
      config.ssh.password = 'vagrant'
  end
  
  config.ssh.username = "vagrant"
  config.ssh.password = "vagrant"
  
  config.ssh.forward_agent = false
  config.ssh.pty = false
 
  config.vm.network "forwarded_port", guest: 80, host: 41125
  config.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh", disabled: true
  config.vm.network :forwarded_port, guest: 22, host: 22125, auto_correct: true

  config.vm.define "project" do |project|
    project.vm.provider :virtualbox do |vb|
        vb.name = "vagrant_project"
    end

    project.vm.synced_folder "../shared", "/vagrant", type: "nfs"

    project.vm.provision "puppet" do |puppet|
      puppet.manifests_path = "puppet/manifests"
      puppet.module_path = "puppet/modules"
      puppet.manifest_file = "default.pp"
      puppet.options = "--verbose --debug"
    end

     # Additional shell commands for npm
     project.vm.provision "npm",
       type: "shell",
       inline: "npm install -g grunt-cli && npm config set loglevel error -g",
       keep_color: true

  end
end

Debug output

https://gist.githubusercontent.com/eyemiru/689097744bf83cabcedbbbd5c9b94978/raw/97d605a5a4532f92c3342d55fac08de3f7b8efc9/gistfile1.txt

Expected behavior

SSH should work properly.

Actual behavior

SSH connection won't work. Worked 3 weeks ago and tried everything explained in several issues.
Error: The following SSH command responded with a non-zero exit status.

Steps to reproduce

  1. Add centos7 in vagrant file
  2. Clean installation
  3. Vagrant up
  4. phpstorm: ssh login not possible (development)

References

See also: #1659

@briancain
Copy link
Member

Hello @eyemiru - do you still have this problem if you comment out your puppet provisioner?

@eyemiru
Copy link
Author

eyemiru commented Dec 17, 2018

Hello @eyemiru - do you still have this problem if you comment out your puppet provisioner?

Just tested it. Same error.

See log: https://gist.githubusercontent.com/eyemiru/1fa3756078059ce4fddd6fc8aa6f5e2a/raw/56d25493f878b56dab938e6da874eb8707913aae/gistfile1.txt

@briancain
Copy link
Member

Hi @eyemiru - this is a different error:

 INFO ssh: Execute: chmod +x '/tmp/vagrant-shell' && /tmp/vagrant-shell (sudo=true)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: stderr: /tmp/vagrant-shell: line 1: npm: command not found

 INFO interface: detail: /tmp/vagrant-shell: line 1: npm: command not found
 INFO interface: detail:     project: /tmp/vagrant-shell: line 1: npm: command not                                                                   found
    project: /tmp/vagrant-shell: line 1: npm: command not found
DEBUG ssh: Exit status: 127

@eyemiru
Copy link
Author

eyemiru commented Dec 17, 2018

Hi @eyemiru - this is a different error:

 INFO ssh: Execute: chmod +x '/tmp/vagrant-shell' && /tmp/vagrant-shell (sudo=true)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: stderr: /tmp/vagrant-shell: line 1: npm: command not found

 INFO interface: detail: /tmp/vagrant-shell: line 1: npm: command not found
 INFO interface: detail:     project: /tmp/vagrant-shell: line 1: npm: command not                                                                   found
    project: /tmp/vagrant-shell: line 1: npm: command not found
DEBUG ssh: Exit status: 127

Yep. Now SSH works without puppet provisioner and npm. Any idea how I can debug this?

@chrisroberts
Copy link
Member

@eyemiru The guest does not have the npm tool installed as can be seen by the stderr output:

 INFO interface: detail: /tmp/vagrant-shell: line 1: npm: command not found
 INFO interface: detail:     project: /tmp/vagrant-shell: line 1: npm: command not                                                                   found
    project: /tmp/vagrant-shell: line 1: npm: command not found
DEBUG ssh: Exit status: 127

You'll need to install npm on the guest for the provision script to succeed.

Cheers!

@eyemiru
Copy link
Author

eyemiru commented Dec 17, 2018

@eyemiru The guest does not have the npm tool installed as can be seen by the stderr output:

 INFO interface: detail: /tmp/vagrant-shell: line 1: npm: command not found
 INFO interface: detail:     project: /tmp/vagrant-shell: line 1: npm: command not                                                                   found
    project: /tmp/vagrant-shell: line 1: npm: command not found
DEBUG ssh: Exit status: 127

You'll need to install npm on the guest for the provision script to succeed.

Cheers!

Yeah, npm is not the issue. It's rather the puppet provisioner.
I kicked the npm config inside the vagrant file and it's giving me this: https://gist.github.com/eyemiru/c6c116fa30287d4027e76a742087e7b0

@briancain
Copy link
Member

Hello @eyemiru - thanks for opening an issue, but this seems to be a potential issue with your puppet manifest. This issue tracker is strictly for bugs with Vagrant. I recommend either emailing the Vagrant up mailing list which might be able to provide support. Otherwise if there's an issue with your puppet code I recommend looking up the way to get support from them, thanks!

@ghost
Copy link

ghost commented Mar 28, 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 28, 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

3 participants