2015-05-15 4 views
0

Я пытался запустить бродягу для существующей настройки бродяг. Я получаю следующее сообщение об ошибке:Vagrant ssh обнаружил неизвестную ошибку.

PLAY [main] ******************************************************************* 

    GATHERING FACTS *************************************************************** 
    fatal: [xxx.xxx.xx.xx] => SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue 

    TASK: [install python-software-properties] ************************************ 
    FATAL: no hosts matched or all hosts have already failed -- aborting 


    PLAY RECAP ******************************************************************** 
       to retry, use: --limit @/Users/mdobrenko/playbook.retry 

    xxx.xxx.xx.xx    : ok=0 changed=0 unreachable=1 failed=0 

    Ansible failed to complete successfully. Any error output should be 
    visible above. Please fix these errors and try again. 

Запуск бродячую -vvvv вверх раскрывает:

Mareks-MBP:rsvp_vagrant mdobrenko$ sudo vagrant -vvvv up 
Bringing machine 'default' up with 'virtualbox' provider... 
==> default: Checking if box 'hashicorp/precise32' is up to date... 
==> default: VirtualBox VM is already running. 
==> default: Checking for host entries 
Mareks-MBP:rsvp_vagrant mdobrenko$ sudo vagrant destroy 
    default: Are you sure you want to destroy the 'default' VM? [y/N] y 
==> default: Forcing shutdown of VM... 
==> default: Destroying VM and associated drives... 
==> default: Removing hosts 
==> default: Running cleanup tasks for 'ansible' provisioner... 
Mareks-MBP:rsvp_vagrant mdobrenko$ sudo vagrant -vvvv up 
Bringing machine 'default' up with 'virtualbox' provider... 
==> default: Importing base box 'hashicorp/precise32'... 
==> default: Matching MAC address for NAT networking... 
==> default: Checking if box 'hashicorp/precise32' is up to date... 
==> default: Setting the name of the VM: rsvp_vagrant_default_1431710679543_35240 
==> default: Fixed port collision for 22 => 2222. Now on port 2200. 
==> default: Clearing any previously set network interfaces... 
==> default: Preparing network interfaces based on configuration... 
    default: Adapter 1: nat 
    default: Adapter 2: hostonly 
==> default: Forwarding ports... 
    default: 22 => 2200 (adapter 1) 
==> default: Booting VM... 
==> default: Waiting for machine to boot. This may take a few minutes... 
    default: SSH address: 127.0.0.1:2200 
    default: SSH username: vagrant 
    default: SSH auth method: private key 
    default: Warning: Connection timeout. Retrying... 
==> default: Machine booted and ready! 
==> default: Checking for guest additions in VM... 
    default: The guest additions on this VM do not match the installed version of 
    default: VirtualBox! In most cases this is fine, but in rare cases it can 
    default: prevent things such as shared folders from working properly. If you see 
    default: shared folder errors, please make sure the guest additions within the 
    default: virtual machine match the version of VirtualBox you have installed on 
    default: your host and reload your VM. 
    default: 
    default: Guest Additions Version: 4.2.0 
    default: VirtualBox Version: 4.3 
==> default: Checking for host entries 
==> default: adding to (/etc/hosts) : 192.168.33.10 rsvp # VAGRANT: 6778d1189c76a655929c20349162f9c4 (default)/4d4353fa-c6e5-4346-b003-78d02ed54989 
==> default: adding to (/etc/hosts) : 192.168.33.10 rsvp.dev # VAGRANT: 6778d1189c76a655929c20349162f9c4 (default)/4d4353fa-c6e5-4346-b003-78d02ed54989 
==> default: Setting hostname... 
==> default: Configuring and enabling network interfaces... 
==> default: Mounting shared folders... 
    default: /vagrant => /Users/mdobrenko/Sites/rsvp_vagrant 
    default: /srv/rsvp_v2 => /Users/mdobrenko/Sites/rsvp_vagrant/vagrant 
==> default: Running provisioner: ansible... 

PLAY [main] ******************************************************************* 

GATHERING FACTS *************************************************************** 
fatal: [192.168.33.10] => SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue 

TASK: [install python-software-properties] ************************************ 
FATAL: no hosts matched or all hosts have already failed -- aborting 


PLAY RECAP ******************************************************************** 
      to retry, use: --limit @/Users/mdobrenko/playbook.retry 

192.168.33.10    : ok=0 changed=0 unreachable=1 failed=0 

Ansible failed to complete successfully. Any error output should be 
visible above. Please fix these errors and try again. 

Я бегу hashicorp/точный 32 коробки, и IP-адрес в моем файле конфигурации является 192.168.33.10.

EDIT:

После редактирования моего vagrantfile -> ansible.verbose = 'VVVV' Это был выход SUDO бродяга вверх:

Mareks-MBP:rsvp_vagrant mdobrenko$ sudo vagrant up 
Bringing machine 'default' up with 'virtualbox' provider... 
==> default: Importing base box 'hashicorp/precise32'... 
==> default: Matching MAC address for NAT networking... 
==> default: Checking if box 'hashicorp/precise32' is up to date... 
==> default: Setting the name of the VM: rsvp_vagrant_default_1431727399798_16186 
==> default: Fixed port collision for 22 => 2222. Now on port 2200. 
==> default: Clearing any previously set network interfaces... 
==> default: Preparing network interfaces based on configuration... 
    default: Adapter 1: nat 
    default: Adapter 2: hostonly 
==> default: Forwarding ports... 
    default: 22 => 2200 (adapter 1) 
==> default: Booting VM... 
==> default: Waiting for machine to boot. This may take a few minutes... 
    default: SSH address: 127.0.0.1:2200 
    default: SSH username: vagrant 
    default: SSH auth method: private key 
    default: Warning: Connection timeout. Retrying... 
==> default: Machine booted and ready! 
==> default: Checking for guest additions in VM... 
    default: The guest additions on this VM do not match the installed version of 
    default: VirtualBox! In most cases this is fine, but in rare cases it can 
    default: prevent things such as shared folders from working properly. If you see 
    default: shared folder errors, please make sure the guest additions within the 
    default: virtual machine match the version of VirtualBox you have installed on 
    default: your host and reload your VM. 
    default: 
    default: Guest Additions Version: 4.2.0 
    default: VirtualBox Version: 4.3 
==> default: Checking for host entries 
==> default: adding to (/etc/hosts) : 192.168.33.10 rsvp # VAGRANT: b9809e905749d56ff4836d1021c101f9 (default)/504dd053-7a44-42ce-af87-24331dc6783d 
==> default: adding to (/etc/hosts) : 192.168.33.10 rsvp.dev # VAGRANT: b9809e905749d56ff4836d1021c101f9 (default)/504dd053-7a44-42ce-af87-24331dc6783d 
==> default: Setting hostname... 
==> default: Configuring and enabling network interfaces... 
==> default: Mounting shared folders... 
    default: /vagrant => /Users/mdobrenko/Sites/rsvp_vagrant 
    default: /srv/rsvp_v2 => /Users/mdobrenko/Sites/rsvp_vagrant/vagrant 
==> default: Running provisioner: ansible... 
ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false PYTHONUNBUFFERED=1 ansible-playbook --private-key=/Users/mdobrenko/.vagrant.d/insecure_private_key --user=vagrant --inventory-file=inventory -vvvv --limit='all' provisions/playbook.yml 

PLAY [main] ******************************************************************* 

GATHERING FACTS *************************************************************** 
<192.168.33.10> ESTABLISH CONNECTION FOR USER: vagrant 
<192.168.33.10> REMOTE_MODULE setup 
<192.168.33.10> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/mdobrenko/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o IdentityFile="/Users/mdobrenko/.vagrant.d/insecure_private_key" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 192.168.33.10 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1431727421.02-64963608760193 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1431727421.02-64963608760193 && echo $HOME/.ansible/tmp/ansible-tmp-1431727421.02-64963608760193' 
fatal: [192.168.33.10] => SSH encountered an unknown error. The output was: 
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 
debug1: Reading configuration data /etc/ssh_config 
debug1: /etc/ssh_config line 20: Applying options for * 
debug1: /etc/ssh_config line 102: Applying options for * 
debug1: auto-mux: Trying existing master 
debug1: Control socket "/Users/mdobrenko/.ansible/cp/ansible-ssh-192.168.33.10-22-vagrant" does not exist 
debug2: ssh_connect: needpriv 0 
debug1: Connecting to 192.168.33.10 [192.168.33.10] port 22. 
debug2: fd 3 setting O_NONBLOCK 
debug1: fd 3 clearing O_NONBLOCK 
debug1: Connection established. 
debug3: timeout: 10000 ms remain after connect 
debug1: permanently_set_uid: 0/0 
debug3: Incorrect RSA1 identifier 
debug3: Could not load "/Users/mdobrenko/.vagrant.d/insecure_private_key" as a RSA1 public key 
debug1: identity file /Users/mdobrenko/.vagrant.d/insecure_private_key type -1 
debug1: identity file /Users/mdobrenko/.vagrant.d/insecure_private_key-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
write: Broken pipe 


TASK: [install python-software-properties] ************************************ 
FATAL: no hosts matched or all hosts have already failed -- aborting 


PLAY RECAP ******************************************************************** 
      to retry, use: --limit @/Users/mdobrenko/playbook.retry 

192.168.33.10    : ok=0 changed=0 unreachable=1 failed=0 

Ansible failed to complete successfully. Any error output should be 
visible above. Please fix these errors and try again. 
Mareks-MBP:rsvp_vagrant mdobrenko$ 

Бродячей Файл:

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

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 
VAGRANTFILE_API_VERSION = "2" 

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 
    # All Vagrant configuration is done here. The most common configuration 
    # options are documented and commented below. For a complete reference, 
    # please see the online documentation at vagrantup.com. 

    # Every Vagrant virtual environment requires a box to build off of. 
    config.vm.box = "hashicorp/precise32" 

    # Disable automatic box update checking. If you disable this, then 
    # boxes will only be checked for updates when the user runs 
    # `vagrant box outdated`. This is not recommended. 
    # config.vm.box_check_update = false 

    # Create a forwarded port mapping which allows access to a specific port 
    # within the machine from a port on the host machine. In the example below, 
    # accessing "localhost:8080" will access port 80 on the guest machine. 
    # config.vm.network "forwarded_port", guest: 80, host: 8080 

    # Create a private network, which allows host-only access to the machine 
    # using a specific IP. 
    config.vm.hostname = 'rsvp' 
    config.hostsupdater.aliases = ["rsvp.dev"] 
    config.vm.network :private_network, ip: "192.168.33.10" 

    # Create a public network, which generally matched to bridged network. 
    # Bridged networks make the machine appear as another physical device on 
    # your network. 
    # config.vm.network "public_network" 

    # If true, then any SSH connections made will enable agent forwarding. 
    # Default value: false 
    # config.ssh.forward_agent = true 

    # Share an additional folder to the guest VM. The first argument is 
    # the path on the host to the actual folder. The second argument is 
    # the path on the guest to mount the folder. And the optional third 
    # argument is a set of non-required options. 
    # config.vm.synced_folder "../data", "/vagrant_data" 
    config.vm.synced_folder "vagrant/", "/srv/rsvp_v2", :mount_options => ["dmode=777","fmode=666"] 

    # Provider-specific configuration so you can fine-tune various 
    # backing providers for Vagrant. These expose provider-specific options. 
    # Example for VirtualBox: 
    # 
    # config.vm.provider "virtualbox" do |vb| 
    # # Don't boot with headless mode 
    # vb.gui = true 
    # 
    # # Use VBoxManage to customize the VM. For example to change memory: 
    # vb.customize ["modifyvm", :id, "--memory", "1024"] 
    # end 
    # 
    # View the documentation for the provider you're using for more 
    # information on available options. 

    # Enable provisioning with CFEngine. CFEngine Community packages are 
    # automatically installed. For example, configure the host as a 
    # policy server and optionally a policy file to run: 
    # 
    # config.vm.provision "cfengine" do |cf| 
    # cf.am_policy_hub = true 
    # # cf.run_file = "motd.cf" 
    # end 

    config.vm.provision "ansible" do |ansible| 
     ansible.verbose = 'vvvv' 
     ansible.limit = 'all' 
     ansible.inventory_path = 'inventory' 
     ansible.playbook = "provisions/playbook.yml" 
    end 

    # 
    # You can also configure and bootstrap a client to an existing 
    # policy server: 
    # 
    # config.vm.provision "cfengine" do |cf| 
    # cf.policy_server_address = "10.0.2.15" 
    # end 

    # Enable provisioning with Puppet stand alone. Puppet manifests 
    # are contained in a directory path relative to this Vagrantfile. 
    # You will need to create the manifests directory and a manifest in 
    # the file default.pp in the manifests_path directory. 
    # 
    # config.vm.provision "puppet" do |puppet| 
    # puppet.manifests_path = "manifests" 
    # puppet.manifest_file = "default.pp" 
    # end 

    # Enable provisioning with chef solo, specifying a cookbooks path, roles 
    # path, and data_bags path (all relative to this Vagrantfile), and adding 
    # some recipes and/or roles. 
    # 
    # config.vm.provision "chef_solo" do |chef| 
    # chef.cookbooks_path = "../my-recipes/cookbooks" 
    # chef.roles_path = "../my-recipes/roles" 
    # chef.data_bags_path = "../my-recipes/data_bags" 
    # chef.add_recipe "mysql" 
    # chef.add_role "web" 
    # 
    # # You may also specify custom JSON attributes: 
    # chef.json = { mysql_password: "foo" } 
    # end 

    # Enable provisioning with chef server, specifying the chef server URL, 
    # and the path to the validation key (relative to this Vagrantfile). 
    # 
    # The Opscode Platform uses HTTPS. Substitute your organization for 
    # ORGNAME in the URL and validation key. 
    # 
    # If you have your own Chef Server, use the appropriate URL, which may be 
    # HTTP instead of HTTPS depending on your configuration. Also change the 
    # validation key to validation.pem. 
    # 
    # config.vm.provision "chef_client" do |chef| 
    # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME" 
    # chef.validation_key_path = "ORGNAME-validator.pem" 
    # end 
    # 
    # If you're using the Opscode platform, your validator client is 
    # ORGNAME-validator, replacing ORGNAME with your organization name. 
    # 
    # If you have your own Chef Server, the default validation client name is 
    # chef-validator, unless you changed the configuration. 
    # 
    # chef.validation_client_name = "ORGNAME-validator" 
end 

Любая идея, в чем проблема? Я не совсем уверен, почему это произойдет, так как все прошло отлично всего несколько месяцев назад - я не коснулся этого проекта через некоторое время.

+0

Произошла ошибка, но коробка должна быть в любом случае. Что происходит, когда вы пытаетесь использовать SSH с помощью 'vagrant ssh'? –

+0

Кажется, ssh в бродягу без проблем .. это очень странно ... Проект laravel, над которым я работаю, работает некорректно (я пытаюсь получить доступ к корневому URL-адресу, и он не будет загружен) – mdobrenko

+0

Попробуйте установить 'ansible. verbose = 'vvvv'' в вашем [Vagrantfile] (http://docs.vagrantup.com/v2/provisioning/ansible.html). Когда вы делаете это в командной строке 'vagrant up', аргумент идет к Vagrant, а не Ansible. –

ответ

1

Ну, я чувствую себя немного глупо, потому что в конечном итоге решения моих собственных ошибок, работая над чем-то, что не было точно, связанных с проектом ..

По существу другой день, когда я столкнулся с некоторыми ключевыми вопросами конфигурации SSH - - Кажется, что один из моих ключей делал что-то действительно странное. Я создал новые ключи, избавившись от старых, обновление конфигурации для моих веб-серверов и т.д.

Сегодня, когда вновь visting нить, я понял, что «бродяга вверх» работает просто отлично ...

Раньше мне всегда приходилось запускать «sudo», потому что я получал бы какие-то странные ошибки, указывающие, что у меня нет разрешения.

Теперь я могу запустить его без sudo, и он работает как шарм.

Спасибо всем, кто внес свой вклад!

0

Это немного выстрел в темноте, так как у нас нет подробной информации о вашем Vagrantfile или вашей конфигурации ssh, но вы, вероятно, не должны запускать vagrant up как sudo.

Если работает vagrant up вместо sudo vagrant up не решить вашу проблему, пожалуйста, напишите результат vagrant ssh-config команды и секции инициализации анзибль от вашего Vagrantfile.

+0

Спасибо за ответ - я решил просто дать вам щедрость, так как я не мог никого сделать. – mdobrenko

+0

Хорошо, спасибо! –

1

Прежде всего, извините, но я не смог опубликовать комментарий для вашего ответа.

В любом случае, если это проблема, связанная с разрешением, возможно, это связано с тем, что в какой-то момент вы победили бродягу с sudo.

Vagrant затем создает файлы в качестве пользователя root, и любые будущие попытки будут сталкиваться с проблемами разрешения.

Простое использование .vagrant в папке проекта для текущего пользователя должно работать, хотя вам также может потребоваться обычная папка .vagrant.d в вашем домашнем каталоге.

Надеюсь, это поможет кому-то!

Смежные вопросы