Trouble with Vagrant?

(Yamikuronue) #1

I’m trying to get a test environment set up on my machine. Since you have a vagrantfile already, I copied that, made a few tweaks, and ran it, but it doesn’t seem to be running. What have I done wrong?

My vagrantfile began identical to yours, but I added:

#Hosts file plugin
	#To install: vagrant plugin install vagrant-hostsupdater
	#This will let you access the VM at discourse.local once it's up "private_network", ip: ""
	config.vm.hostname = "discourse.local"

##Run our provisioner to install Discourse
	config.vm.provision "shell", path: ""

And my provision script:

#!/usr/bin/env bash

#Git and docker
sudo apt-get -y install git
wget -qO- | sh

#Fake mail server
mailcatcher --http-ip

sudo mkdir -p /var/discourse
sudo git clone /var/discourse
cd /var/discourse
sudo cp /vagrant/config.yml containers/app.yml
sudo ./launcher bootstrap app
sudo ./launcher start app

I get the following error when installing docker:

==> default: Error: you are not using a 64bit platform.
==> default: Docker currently only supports 64bit platforms.

And then I get:

==> default: Cloning into '/var/discourse'...
==> default: Device "docker0" does not exist.
==> default: Your Docker installation is not using a supported filesystem if we
were to proceed you may have a broken install.
==> default: aufs is the recommended filesystem you should be using (zfs/btrfs a
nd overlay may work as well)

(probably because Docker isn’t installed?)

(Zack Piper) #2

Mind giving us the output of:

  • uname -a on the host.
  • uname -a on the VM.
  • mount on the VM.


(Yamikuronue) #3

I’m running Vagrant in my Windows 7 laptop, so uname won’t do much there.

The VM comes up Linux discourse 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux

mount gives me

/dev/mapper/precise32-root on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
/dev/sda1 on /boot type ext2 (rw)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw)
vagrant-root on /vagrant type vboxsf (uid=1000,gid=1000,rw)

(Zack Piper) #4

i686 is 32 bit, as stated in:

It won’t work, mind looking in Start menu -> Right click computer -> Properties (I think) and tell me if it says “64 bit system” or “32 bit system” somewhere.

(Yamikuronue) #5

I’m on 64-bit windows 7, but as you can see in the mount output, the discourse vagrant base image appears to be based off Precise32, a 32-bit Precise Pangolin base image? If discourse requires a 64-bit OS, why is the dev machine 32-bit?

Again, I didn’t put together my own base image, I’m using the one listed under the instructions for creating a dev environment with Vagrant on Github.

(Mittineague) #6

Did you install everything as detailed in that Install Guide with no problems?

I have Windows 7

I’m not sure it’s the best way, but it works for me.

I created a folder under C: and named it VirtualBox
I unzipped a copy of Discourse from GitHub into it .
I used the GitHub Gui to make that folder a Repo
I used the VirtualBox GUI to tie that folder to a virtual machine

(Yamikuronue) #7

How do you mean? I’ve been using git and vagrant for a long time in my own development, they were already installed. I’m not trying to work on the discourse source code, I am trying to install discourse using docker onto a VM using vagrant, but I used the dev vagrantfile as launching point because it already has the environment set up how I’d want, including mailcatcher, which I had a rough time setting up with Trusty64 as my base image.

I guess the answer is that you can’t install discourse in the recommended way on the recommended dev machine, but must instead build from source. After a frustrating half hour trying to get it to build, I guess I’m back to square one with configuring my own base image instead of using the one provided.

As an aside, @Xack apparently is too low a trust level to reply again, but he pointed out in PM:

Anyway, Please add info about the vagrant box architecture by rubo77 · Pull Request #3362 · discourse/discourse · GitHub seems to be the only mention of it on the GitHub issues.

(Yamikuronue) #8

The use case you listed here is entirely different than the method I’m trying to use. I’m trying to use Vagrant.

In general, if you’re not familiar with the stack involved, your ability to provide help will be limited :slight_smile: I’m fine waiting until someone who knows the software stack is around, this isn’t urgent.

(Mittineague) #9

I am using Vagrant
When I installed it on my machine it was added to my PATH variables and I use it from a PowerShell CLI opened from the GitHub GUI

Are you sure simply copying a Vagrantfile makes all the needed interconnections and permissions etc. ?

(Yamikuronue) #10

…yes. That’s the point of Vagrant.

Again, I’m happy to wait for someone who knows more about this use case.

(Yamikuronue) #11

@Xack ran out of PMs for the day, but he contacted me on Github to add,

Concerning Trouble with Vagrant?

I have a feeling Docker isn’t meant to be installed on it at all. The docs mentioned in the Vagrantfile don’t say anything about Docker, and it apparently comes with Discourse installed.

I agree that it’s probably not meant to have docker. The more I look at it, the more I get that feeling. It doesn’t come with Discourse installed, though; the directions say to run some rake tasks with bundle, which are erroring for me, and which I didn’t want to debug just to get up and running. The beauty of using Docker is I can install a stable version and go about my testing.

If that’s the case, and this is entirely unsupported, I could use some help getting Discourse to integrate with mailcatcher. I had Trusty64 installing both of them, but Discourse didn’t send mail through it, despite being set up to use as the SMTP host. Thankfully, my vagrantfile is in my git repo, so I can easily roll back to what I had before I found the discourse dev base image, but then I still have that issue hanging over my head.

(Kane York) #12

I don’t think anybody on the development team actually uses the Vagrant setup. Those of us on Linux or Macs use rbenv + ruby-build, and those on Windows don’t do much in the way of developing new code.

There’s some nasty performance problems with shared folders and VirtualBox; if I recall correctly the recommendation is to run a virtual machine, put the Discourse code in the virtual machine, and use NFS mounts or shared folders to do Git operations from Windows. Either way, it’s still too slow for real development (page load times of 20+ seconds were common).

(Régis Hanol) #13

@sam runs Windows but does all his dev work inside a VM (not Vagrant-based though)

(Kane York) #14

Oops. Guess I hadn’t caught that…

(Yamikuronue) #15

…so what is it there for?

Anyway, I’ve gone back to using my Trusty64 base instead. Does anyone have experience with Mailcatcher setup for Discourse using Docker? I’m wondering if the reason it’s not seeing the Mailcatcher SMTP server has to do with the Docker container being inside the VM and some separation of concerns thing…

(Sam Saffron) #16

Mailcatcher is super easy…

Just run gem install mailcatcher and then run it with mailcatcher … if you need to expose it to the host do a mailcatcher --help to see how you can bind it to non

We are already configured to automatically talk to mailcatcher port with no fussing on your side.

Now, if you want that for docker, you are going to have to:

  1. Run mailcatcher somewhere
  2. Configure mail in the docker container to go to mailcatcher.

But… I strongly recommend a dev setup if you want to do any kind of development … developing in RAILS_ENV=production has tons of drawbacks.

For one you would be using better_errors and an pile of other diagnostics gems.

(Yamikuronue) #17

Is this more complicated than setting the config.yml file to use for the SMTP host? That might be where I did it wrong.

I’m not looking to do development on Discourse; I want an environment to test settings and plugins and things when I’m looking for information that can then go away when I’m done with it. If I was going to do Discourse development I’d agree I’d want to get a dev ruby environment set up :slight_smile:

(Yamikuronue) #18

In case it helps anyone else, I just needed to start Discourse with ./launcher start app --docker-args --net="host". That made it able to see mailcatcher on the IP of the host, and probably also on localhost (but I’d already set a static IP so I used that).

(Kane York) #19

You want to tell the container to use a routable IP for the host machine, as it gets its own IP in

(Pad Pors) #20

I have followed the instruction on this: to run a localhost. things goes well, until the step to run bundle install in the vagrant folder.

after running bundle install, I get the following error:

and after following the error to install version 10.5.0 of rake, I get the following error:

after 1-2 hours struggling, I couldn’t solve it. any suggestion what’s happening?