2013-07-10 5 views
6

Mam trochę skryptu dostarczania powłoki zabezpieczającej w vagrantach (aby zainstalować coś marionetki nie udaje się ..) skrypt:Błąd skryptu powłoki włóczni z niewytłumaczalnym błędem `` system plików tylko do odczytu (runtimeerror) `` `

#!/bin/bash 
echo 'provisioning librarian' 
gem install librarian-puppet 
librarian-puppet install 

działają dobrze z sh prescript.sh ale z Vagrant rezerw nie powiedzie się z:

D:/HashiCorp/Vagrant/embedded/gems/gems/net-scp-1.1.0/lib/net/scp.rb:385:in `awa 
it_response_state': ☺scp: /tmp/vagrant-shell: Read-only file system (RuntimeErro 
r) 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-scp-1.1.0/lib/net/scp.r 
b:356:in `block (3 levels) in start_command' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/c 
onnection/channel.rb:311:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/c 
onnection/channel.rb:311:in `process' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/c 
onnection/session.rb:217:in `block in preprocess' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/c 
onnection/session.rb:217:in `each' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/c 
onnection/session.rb:217:in `preprocess' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/c 
onnection/session.rb:200:in `process' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/c 
onnection/session.rb:164:in `block in loop' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/c 
onnection/session.rb:164:in `loop' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/c 
onnection/session.rb:164:in `loop' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/c 
onnection/channel.rb:269:in `wait' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/net-scp-1.1.0/lib/net/scp.r 
b:279:in `upload!' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commu 
nicators/ssh/communicator.rb:105:in `block in upload' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commu 
nicators/ssh/communicator.rb:331:in `block in scp_connect' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commu 
nicators/ssh/communicator.rb:139:in `connect' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commu 
nicators/ssh/communicator.rb:329:in `scp_connect' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commu 
nicators/ssh/communicator.rb:99:in `upload' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/provi 
sioners/shell/provisioner.rb:20:in `block (2 levels) in provision' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/provi 
sioners/shell/provisioner.rb:14:in `tap' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/provi 
sioners/shell/provisioner.rb:14:in `block in provision' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/provi 
sioners/shell/provisioner.rb:78:in `with_script_file' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/provi 
sioners/shell/provisioner.rb:12:in `provision' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/builtin/provision.rb:65:in `run_provisioner' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/builtin/provision.rb:53:in `block in call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/builtin/provision.rb:49:in `each' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/builtin/provision.rb:49:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/warden.rb:34:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/provi 
ders/virtualbox/action/check_accessible.rb:18:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/warden.rb:34:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/runner.rb:61:in `block in run' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/u 
til/busy.rb:19:in `busy' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/runner.rb:61:in `run' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/builtin/call.rb:51:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/warden.rb:34:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/runner.rb:61:in `block in run' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/u 
til/busy.rb:19:in `busy' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/runner.rb:61:in `run' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/builtin/call.rb:51:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/warden.rb:34:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/builtin/config_validate.rb:25:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/warden.rb:34:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/provi 
ders/virtualbox/action/check_virtualbox.rb:17:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/warden.rb:34:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/builder.rb:116:in `call' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/runner.rb:61:in `block in run' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/u 
til/busy.rb:19:in `busy' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/a 
ction/runner.rb:61:in `run' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/m 
achine.rb:147:in `action' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/comma 
nds/provision/command.rb:26:in `block in execute' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/p 
lugin/v2/command.rb:182:in `block in with_target_vms' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/p 
lugin/v2/command.rb:180:in `each' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/p 
lugin/v2/command.rb:180:in `with_target_vms' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/comma 
nds/provision/command.rb:25:in `execute' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/c 
li.rb:46:in `execute' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/e 
nvironment.rb:467:in `cli' 
     from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/bin/vagrant:8 
4:in `<top (required)>' 
     from D:/HashiCorp/Vagrant/bin//../embedded/../embedded/gems/bin/vagrant: 
23:in `load' 
     from D:/HashiCorp/Vagrant/bin//../embedded/../embedded/gems/bin/vagrant: 
23:in `<main>' 

po poradę here już zmienione (za pomocą sublimetext2) okna linia zakończona do ONZ IX. ale nadal nie jakieś pomysły

Odpowiedz

7

Niektóre możliwości:

Można się za pomocą udostępnionego folderu w VirtualBox, który nie obsługuje dowiązania (chyba że został ustalony). Jest podobno VBoxManage polecenie, aby naprawić to teraz, coś

VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1 

czy to do pliku Vagrant (zakładając share_name jest v-korzeń w tym):

config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"] 

Więcej możliwości patrz: https://www.virtualbox.org/ticket/10085#comment:12 lub długie forum na temat pod adresem: https://github.com/mitchellh/vagrant/issues/713 Inną możliwością jest to, że skrypt może być uruchomiony tak wcześnie w procesie rozruchu, że system plików root (lub prawdopodobnie tylko/tmp) nie został ponownie zsynchronizowany w trybie odczytu/zapisu, powiedzmy, jeśli skrypt jest uruchamiany ze skryptów /etc/rc.2/S(num)(name), a (num) jest za niski.

+0

Wierzę, że to ma być: '' 'config.vb.customize''', czyż nie? – alonisser

+0

Nie jestem pewien, czy to jest właściwa odpowiedź, ale ponieważ jest kompetentny i być może wskazuje właściwy kierunek, przyznam nagrodę za to zadanie: – alonisser

+0

@alonisser może mieć rację, zapraszam do aktualizacji :-) To może być dostępne również w więcej niż jeden sposób, nie mam konkretnych informacji. –

0

Po prostu wpadłem na ten błąd, gdy vagrant up ing maszyny wirtualnej. W moim przypadku problem polega na tym, że poprzednia kopia maszyny wirtualnej działała w tle. Trochę historii:

  • VM dla tego samego projektu wcześniej rozbił (godziny wcześniej) i musiałem zamknąć okno terminala (MacOS) i ponownie uruchomić maszynę wirtualną (używając vagrant halt + vagrant up).
  • Wygląda na to, że naprawiłem rzeczy i poszedłem normalnie i zapomniałem o tym.
  • Później, po wprowadzeniu zmian w pliku Vagrantfile i chęci upewnienia się, że wszystko działa, zniszczyłem VM i vagrant up wydałem nowy, tylko po to, aby uruchomić ten błąd.
  • Po przeczytaniu odpowiedzi przez @ AlexNorth-Keys, przypomniałem sobie, że VM wcześniej rozbił się, więc postanowiłem ponownie uruchomić komputer, a następnie wszystko działało. Jestem prawie pewien, że kopia uszkodzonej maszyny wirtualnej musiała być uruchomiona w tle, a udostępnianie folderów projektu powodowało problemy.

Oczywiście to tylko przypuszczenie, ale ponowne uruchomienie hosta naprawiło problem.

Powiązane problemy