Closed jzacsh closed 7 years ago
I have the same issue. The hostname error can be fixed by adding 127.0.0.1 ubuntu-xenial
to /etc/hosts
. Run the following commands (instead of nano you can you any editor you like):
vagrant up --no-provision
vagrant ssh
sudo nano /etc/hosts
After adding the line to /etc/hosts
, exit the vagrant box and run
vagrant up --provision
Unfortunately, the directory /vagrant
is still missing and the provisioning fails. I have no idea yet how to fix that.
Debugging vagrant issues is always hard for me since I've never been able to get vagrant to work on my box :/
I'll find a coworker with vagrant next week and see if I can get the Vagrantfile working again. More likely than not I just made a silly mistake at some point.
The solution to this would be to add the line
config.vm.synced_folder "./", "/vagrant", disabled: false
to the Vagrantfile
. However, the person building the Ubuntu Xenial images screwed up and didn't install Virtualbox Guest Additions into the image and it's been a problem for quite a few months now (see https://bugs.launchpad.net/cloud-images/+bug/1565985).
If you want @dgonyeo, I have a workaround, implemented in https://github.com/freedomofpress/FingerprintSecureDrop/blob/master/Vagrantfile, which I can make work with your Vagrantfile. It's a bit of annoyance because it requires the user do a couple extra steps versus just vagrant up
, but afaik there's not really a better way to handle this until Ubuntu fixes their Xenial Vagrant image.
I'm downloading the latest Xenial box and then testing the build with the modified Vagrantfile
. Will update with how it goes.
Okay, so that fixed the original problem this issue was started with, but just uncovered further problems in the provisioning scripts (specifically, in scripts/vagrant-install-go.sh
).
==> default: Running provisioner: shell...
default: Running: /tmp/vagrant-shell20160808-5907-9ugdfb.sh
==> default: + export DEBIAN_FRONTEND=noninteractive
==> default: + DEBIAN_FRONTEND=noninteractive
==> default: + VERSION=1.4.2
==> default: + OS=linux
==> default: + ARCH=amd64
==> default: + prefix=/usr/local
==> default: + '[' -e /usr/local/go ']'
==> default: + wget -q https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz
==> default: + sudo tar -C /usr/local -xzf go1.4.2.linux-amd64.tar.gz
==> default: sudo
==> default: :
==> default: unable to resolve host ubuntu-xenial
==> default: + echo 'export GOROOT=/usr/local/go'
==> default: + sudo tee /etc/profile.d/01go.sh
==> default: sudo: unable to resolve host ubuntu-xenial
==> default: export GOROOT=/usr/local/go
==> default: + cat
==> default: + sudo tee -a /etc/profile.d/go.sh
==> default: sudo: unable to resolve host ubuntu-xenial
==> default:
==> default: export GOPATH=$HOME/.gopath
==> default:
==> default: [ -e $GOPATH ] || mkdir -p $GOPATH
==> default:
==> default: export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
==> default: + which git
==> default: /usr/bin/git
==> default: Running provisioner: shell...
default: Running: /tmp/vagrant-shell20160808-5907-5ul8rv.sh
==> default: + export DEBIAN_FRONTEND=noninteractive
==> default: + DEBIAN_FRONTEND=noninteractive
==> default: + pushd /vagrant
==> default: /vagrant ~
==> default: + ./build
==> default: Building acbuild...
==> default: gopath/src/github.com/appc/acbuild/lib/begin.go:32:2: cannot find package "github.com/appc/docker2aci/lib" in any of:
==> default: /usr/local/go/src/github.com/appc/docker2aci/lib (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/appc/docker2aci/lib (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/lib/begin.go:33:2: cannot find package "github.com/appc/docker2aci/lib/common" in any of:
==> default: /usr/local/go/src/github.com/appc/docker2aci/lib/common (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/appc/docker2aci/lib/common (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/util/files.go:23:2: cannot find package "github.com/appc/spec/aci" in any of:
==> default: /usr/local/go/src/github.com/appc/spec/aci (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/appc/spec/aci (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/registry/fetch.go:32:2: cannot find package "github.com/appc/spec/discovery" in any of:
==> default: /usr/local/go/src/github.com/appc/spec/discovery (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/appc/spec/discovery (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/registry/fetch.go:33:2: cannot find package "github.com/appc/spec/pkg/acirenderer" in any of:
==> default: /usr/local/go/src/github.com/appc/spec/pkg/acirenderer (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/appc/spec/pkg/acirenderer (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/util/manifest.go:25:2: cannot find package "github.com/appc/spec/schema" in any of:
==> default: /usr/local/go/src/github.com/appc/spec/schema (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/appc/spec/schema (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/engine/common.go:18:2: cannot find package "github.com/appc/spec/schema/types" in any of:
==> default: /usr/local/go/src/github.com/appc/spec/schema/types (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/appc/spec/schema/types (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/registry/fetch.go:35:2: cannot find package "github.com/coreos/ioprogress" in any of:
==> default: /usr/local/go/src/github.com/coreos/ioprogress (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/coreos/ioprogress (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/engine/chroot/chroot.go:24:2: cannot find package "github.com/coreos/rkt/pkg/fileutil" in any of:
==> default: /usr/local/go/src/github.com/coreos/rkt/pkg/fileutil (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/coreos/rkt/pkg/fileutil (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/engine/chroot/chroot.go:25:2: cannot find package "github.com/coreos/rkt/pkg/multicall" in any of:
==> default: /usr/local/go/src/github.com/coreos/rkt/pkg/multicall (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/coreos/rkt/pkg/multicall (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/util/files.go:24:2: cannot find package "github.com/coreos/rkt/pkg/tar" in any of:
==> default: /usr/local/go/src/github.com/coreos/rkt/pkg/tar (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/coreos/rkt/pkg/tar (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/engine/chroot/chroot.go:26:2: cannot find package "github.com/coreos/rkt/pkg/user" in any of:
==> default: /usr/local/go/src/github.com/coreos/rkt/pkg/user (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/coreos/rkt/pkg/user (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/engine/chroot/chroot-child.go:25:2: cannot find package "github.com/spf13/cobra" in any of:
==> default: /usr/local/go/src/github.com/spf13/cobra (from $GOROOT)
==> default: /vagrant/gopath/src/github.com/spf13/cobra (from $GOPATH)
==> default: gopath/src/github.com/appc/acbuild/registry/fetch.go:36:2: cannot find package "xi2.org/x/xz" in any of:
==> default: /usr/local/go/src/xi2.org/x/xz (from $GOROOT)
==> default: /vagrant/gopath/src/xi2.org/x/xz (from $GOPATH)
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.
So now this is a problem between the build
bash script and how you've set up the VM. The libraries it's looking for do seem to exist under vendor/
(/vagrant/vendor
in the VM).
At @freedomofpress we've switched to using bento boxes for all our Ubuntu Vagrant images. They're all the packages you get in a default Ubuntu server install plus the VirtualBox Guest Additions packages.
tl;dr problem running
vagrant up
from the readme, below (debugging info at the bottom)..Hi, I'm guessing this might be an easy fix, and I'm happy to help debug the scripts - though I don't see anything obvious, looking myself...
I can't tell if the problem is the
unable to resolve host ubuntu-xenial
error (or maybe that's harmless?) or thepushd: /vagrant: No such file or directory
, below:more debug info: