Como corrigir erros de provisão vagrant: script inline, ttyname failed, inapp

0

Contexto : Tentando configurar um ambiente de desenvolvimento VM Ethereum em uma nova instalação do Ubuntu 17.04 com as versões mais recentes do Vagrant e VirtualBox instaladas. Mais detalhes são aqui , mas a tentativa mais recente de vagrant up falhou, com o que parece ser o erros mais importantes sendo:

There was an error while executing 'VBoxManage', a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "b5460c8c-142b-4dc8-a942-176aee800148", "--type", "headless"]

Stderr: VBoxManage: error: Could not open the medium'/home/james/VirtualBox VMs/james_default_1504917176677_87192/ubuntu-zesty-17.04-cloudimg.vmdk'.
VBoxManage: error: VMDK: inconsistency between grain table and backup grain table in '/home/james/VirtualBoxV Ms/james_default_1504917176677_87192/ubuntu-zesty-17.04-cloudimg.vmdk' (VERR_VD_VMDK_INVALID_HEADER).
VBoxManage: error: VD: error VERR_VD_VMDK_INVALID_HEADER opening image file '/home/james/VirtualBox VMs/james_default_1504917176677_87192/ubuntu-zesty-17.04-cloudimg.vmdk' (VERR_VD_VMDK_INVALID_HEADER)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MediumWrap, interface IMedium

Ou mais sucintamente, um dos arquivos do disco não está acessível (este aqui: / home / james / VMs do VirtualBox / james_default_1504917176677_87192 / ubuntu-zesty-17.04-cloudimg.vmdk).

Mais detalhes / solução de problemas

$ vagrant -v
Vagrant 1.9.1

O Vagrant up falhou, não consigo executá-lo novamente e sugere executar vagrant provision .

james@james-Streacom:~$ vagrant provision
==> default: Running provisioner: shell...
default: Running: inline script
==> default: mesg: 
==> default: ttyname failed
==> default: : 
==> default: Inappropriate ioctl for device
==> default: WARNING: 
==> default: apt
==> default:  
==> default: does not have a stable CLI interface. 
==> default: Use with caution in scripts.
==> default: Get:1 http://security.ubuntu.com/ubuntu zesty-security InRelease [89.2 kB]
==> default: Hit:2 http://archive.ubuntu.com/ubuntu zesty InRelease
==> default: Get:3 http://archive.ubuntu.com/ubuntu zesty-updates InRelease [89.2 kB]
==> default: Get:4 http://archive.ubuntu.com/ubuntu zesty-backports InRelease [89.2 kB]
==> default: Fetched 268 kB in 16s (16.2 kB/s)
==> default: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: 5 packages can be upgraded. Run 'apt list --upgradable' to see them.
==> default: WARNING: 
==> default: apt
==> default:  
==> default: does not have a stable CLI interface. 
==> default: Use with caution in scripts.
==> default: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: g++ is already the newest version (4:6.3.0-2ubuntu1).
==> default: make is already the newest version (4.1-9.1).
==> default: python-minimal is already the newest version (2.7.13-2).
==> default: silversearcher-ag is already the newest version (1.0.2-2).
==> default: git is already the newest version (1:2.11.0-2ubuntu0.2).
==> default: 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
==> default: --2017-09-09 02:53:39--  https://nodejs.org/dist/v8.3.0/node-v8.3.0-linux-x64.tar.xz
==> default: Resolving nodejs.org (nodejs.org)... 
==> default: 104.20.23.46
==> default: , 
==> default: 104.20.22.46
==> default: Connecting to nodejs.org (nodejs.org)|104.20.23.46|:443... 
==> default: connected.
==> default: HTTP request sent, awaiting response... 
==> default: 200 OK
==> default: Length: 
==> default: 11527336
==> default:  (11M)
==> default:  [application/x-xz]
==> default: Saving to: ‘node-v8.3.0-linux-x64.tar.xz.2’
==> default: 
==> default:      0K

Seguido por muitas linhas vermelhas do status de carregamento, muitas outras linhas de arquivos e subpastas em:

  • node-v8.3.0-linux-x64 /
  • node-v8.3.0-linux-x64 / lib /
  • node-v8.3.0-linux-x64 / lib / node_modules /
  • node-v8.3.0-linux-x64 / lib / node_modules / npm /
  • node-v8.3.0-linux-x64 / bin /
  • node-v8.3.0-linux-x64 / CHANGELOG.md
  • node-v8.3.0-linux-x64 / include /
  • node-v8.3.0-linux-x64 / include / node /
  • node-v8.3.0-linux-x64 / include / node / libplatform /
  • node-v8.3.0-linux-x64 / include / node / openssl /
  • node-v8.3.0-linux-x64 / compartilhamento /

Então, finalmente, a saída terminou com:

==> default: mv: 
==> default: cannot move 'node-v8.3.0-linux-x64/lib/node_modules' to '/usr/lib/node_modules'
==> default: : Directory not empty
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Eu considerei excluir /usr/lib/node_modules e executar vagrant provision novamente, mas ainda não o fiz. Em vez disso, tentei vagrant reload .

james@james-Streacom:~$ vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'ubuntu/zesty64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
There was an error while executing 'VBoxManage', a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "b5460c8c-142b-4dc8-a942-176aee800148", "--type", "headless"]

Stderr: VBoxManage: error: Could not open the medium'/home/james/VirtualBox VMs/james_default_1504917176677_87192/ubuntu-zesty-17.04-cloudimg.vmdk'.
VBoxManage: error: VMDK: inconsistency between grain table and backup grain table in '/home/james/VirtualBoxV Ms/james_default_1504917176677_87192/ubuntu-zesty-17.04-cloudimg.vmdk' (VERR_VD_VMDK_INVALID_HEADER).
VBoxManage: error: VD: error VERR_VD_VMDK_INVALID_HEADER opening image file '/home/james/VirtualBox VMs/james_default_1504917176677_87192/ubuntu-zesty-17.04-cloudimg.vmdk' (VERR_VD_VMDK_INVALID_HEADER)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MediumWrap, interface IMedium

Quando abri o Virtual Box, recebi a mensagem de erro:

One or more disk image files are not currently accessible. As a result, you will not be able to operate virtual machines that use these files until they become accessible later. Press Check to open the Virtual Media Manager window and see which files are inaccessible, or press Ignore to ignore this message.

Relacionado : link

Eu excluí as pastas manualmente no aplicativo de arquivos: VMs do VirtualBox, .vagrant e .vagrantd e o vagrantfile . Então, eu corri vagrant init , editei o vagrantfile para ser como este aqui , exceto com zesty em vez de fiel, em seguida, executou vagrant up .

Enquanto os arquivos mencionados anteriormente são carregados (em verde), a saída terminou (em vermelho) com:

==> default: cp: 
==> default: cannot stat '/vagrant/.tmux.conf'
==> default: : No such file or directory
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Postando aqui:

link

    
por James Ray 09.09.2017 / 05:28

1 resposta

0

Eu tive que clonar o diretório aqui: link , em seguida, navegue até a pasta nesse diretório no terminal com o arquivo vagrant e execute vagrant up . O gateway do meu roteador não tem o SSH habilitado, então eu preciso fazer isso.

    
por James Ray 24.09.2017 / 09:44