Setting up Production System in Vagrant Ubuntu 14 LTS with 7 Beta

So I am still facing a couple of issues with the installer scripts. Sometimes they go through, then sometimes they don’t. Right now it worked.

I am describing here how I am trying to set up Frappe in Vagrant Ubuntu 14 LTS. The beta installer won’t work with this either at the moment, this is being discussed at Error during Beta Development Setup in Ubuntu 14.

Environment Setup

vagrant init ubuntu/trusty64
vagrant up
vagrant ssh

(Make sure your VM has 1024MB of memory to avoid low memory error Error during Easy Setup in Ubuntu 14 wither in Virtual Box configuration or in your Vagrantfile.)

To make things easier instead of vagrant init and playing with the config you could just use this Vagrantfile and start it with vagrant up and then enter by using vagrant ssh:

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.network "forwarded_port", guest: 80, host: 8080
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "1024"
  end
end

Easy Setup

wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
sudo bash setup_frappe.sh --setup-production

Switching to Develop Version 7

If the setup goes through smoothly now we are switching to Develop and updating to the latest.

cd fappe-bench
bench switch-to-develop

This then throws:

vagrant@vagrant-ubuntu-trusty-64:~/frappe-bench$ bench switch-to-develop
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==3.0.0', 'console_scripts', 'bench')()
  File "/home/vagrant/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/vagrant/bench-repo/bench/commands/update.py", line 133, in switch_to_develop
    switch_to_develop(upgrade=upgrade)
  File "/home/vagrant/bench-repo/bench/app.py", line 204, in switch_to_develop
    switch_branch('develop', apps=apps, bench_path=bench_path, upgrade=upgrade)
  File "/home/vagrant/bench-repo/bench/app.py", line 174, in switch_branch
    raise MajorVersionUpgradeException("Switching to {0} will cause upgrade from {1} to {2}. Pass --upgrade to confirm".format(branch, version_upgrade[1], version_upgrade[2]), version_upgrade[1], version_upgrade[2])
bench.app.MajorVersionUpgradeException: Switching to develop will cause upgrade from 6 to 7. Pass --upgrade to confirm

So I run it again as instructed with bench switch-to-develop --upgrade

This breaks:

vagrant@vagrant-ubuntu-trusty-64:~/frappe-bench$ bench switch-to-develop --upgrade
Branch develop set up to track remote branch develop from upstream.
Switched to a new branch 'develop'
Already up-to-date.
Branch develop set up to track remote branch develop from upstream.
Switched to a new branch 'develop'
Already up-to-date.
/home/vagrant/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/home/vagrant/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
/home/vagrant/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/home/vagrant/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Command "/home/vagrant/frappe-bench/env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-LbAbKv/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Epu0tK-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/vagrant/frappe-bench/env/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-build-LbAbKv/cffi/
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==3.0.0', 'console_scripts', 'bench')()
  File "/home/vagrant/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/vagrant/bench-repo/bench/commands/update.py", line 133, in switch_to_develop
    switch_to_develop(upgrade=upgrade)
  File "/home/vagrant/bench-repo/bench/app.py", line 204, in switch_to_develop
    switch_branch('develop', apps=apps, bench_path=bench_path, upgrade=upgrade)
  File "/home/vagrant/bench-repo/bench/app.py", line 192, in switch_branch
    update_requirements()
  File "/home/vagrant/bench-repo/bench/utils.py", line 377, in update_requirements
    exec_cmd("{pip} install -q -r {req_file}".format(pip=pip, req_file=req_file))
  File "/home/vagrant/bench-repo/bench/utils.py", line 100, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q -r ./apps/frappe/requirements.txt

Tested and fixed Beta installer on vagrant ubuntu trusty64 image:

wget https://raw.githubusercontent.com/frappe/bench/develop/playbooks/install.py
sudo python install.py --production

Replace --production with --develop for development setup

1 Like