tidepool-org / tidepool-org.github.io

Tidepool's developer portal.
https://developer.tidepool.org/
15 stars 14 forks source link

Failed to build on Ubuntu 14.04.2 #69

Open ghost opened 9 years ago

ghost commented 9 years ago

I'm trying to build tidepool from the documentation at http://developer.tidepool.io/starting-up-services/. I get 3 failures.

During the tools folder get_current_tidepool_repos.sh, I get an error about the versions of node and npm; During the . tools/runservers I get errors building Blip about packages not found and a legacy binary of node.

This is my 3rd unsuccessful attempt to build Tidepool in a VM. I've found a few things along the way (like npm proxy settings need to be done with the -g flag), but I'm stumped at this point. The last time I got to a set of Blip build errors, I seemed to find myself hand-installing a set of npm dependencies that seemed more and more incorrect, with no success.

Originally I tried installing nodejs instead of nodejs-legacy, which generated other failures about not being able to find node. I went with nodejs-legacy after reading notes about how that package is meant to deal with name issues on Debian systems such as Ubuntu (that on Debian, node is named nodejs).

Any idea what I'm doing wrong? Below are the error messages, and a list of the steps I've done so far. Note: I'm a total newbie on many of the technologies (node, go, npm), so I may be making some newbie mistake.

Thanks, Brad Needham Intel Corporation ---------------- errors from running get_current_tidepool_repos.sh https://registry.npmjs.org/tideline/-/tideline-0.1.22.tgz npm ERR! 404 'blip-mock-data' is not in the npm registry. npm ERR! 404 You should bug the author to publish it npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Linux 3.16.0-40-generic npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! cwd /home/brad/Documents/tidepool/blip npm ERR! node -v v0.10.25 npm ERR! npm -v 1.3.10 npm ERR! code E404 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/brad/Documents/tidepool/blip/npm-debug.log npm ERR! not ok code 0

---------- errors from . tools/runservers Building Blip...

module.js:340 throw err; ^ Error: Cannot find module 'shelljs/global' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/home/brad/Documents/tidepool/blip/buildapp.js:2:1) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) npm ERR! weird error 8 npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0 npm ERR! weird error 1 npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0 Starting blip Started blip, pid 15107

module.js:340 throw err; ^ Error: Cannot find module 'connect' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/home/brad/Documents/tidepool/blip/server.js:4:15) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) [13]+ Exit 8 node $2 2>&1 >> ../server.log
------------------------------ my script for creating the vm and installing Tidepool on it. Create a VM

  1. Download the Ubuntu 14.04 64-bit desktop .iso file: o Browse to http://www.ubuntu.com/download/desktop o Select the 64-bit version and click Download.
  2. Use VirtualBox (or another VM manager) to create a VM with 2GB Ram, 20GB disk, and 64-bit Ubuntu 14.04 installed.
  3. Start that VM
  4. Select the downloaded Ubuntu .iso file to boot from.
  5. Wait for ubuntu to start.
  6. Click Install Ubuntu
  7. Select “install this third-party software”, but do not select “Download updates while installing”, because the proxy isn’t set up yet.
  8. Continue through the rest of the setup.
  9. Once it stops, waiting, press Enter (it’s waiting for you to “remove” the install disk. o Once the VM is restarted and up…
  10. (VirtualBox only) In the VM border select Devices / Insert guest additions CD image…. This will enable your VM screen to enlarge to something useful. Without this, you won’t be able to set the proxy, or do many other things, because the icons would be off-screen.
  11. When “Press return to close this window” appears, press Enter
  12. Scroll down to on the left menu bar to the CD icon, right click on it, and select Eject.
  13. Try to resize the window by dragging the corner. If the Ubuntu window doesn’t resize, reboot the VM and try again.
  14. Set the proxies: o In the system menu (top-right gear icon), select System Settings… o In the resultant window, click on Network. o Click Network proxy o Select Method: Manual and fill in the following proxies:  HTTP: proxy-jf-intel.com port 911  HTTPS same as HTTP  FTP same as HTTP  Socks Host – leave blank for now. XXX find our Socks5 proxy. o Click Apply system wide o Test by opening Firefox: it should show Google.
  15. (VirtualBox only) Turn on VM Client copy/past with the host: select Devices /shared clipboard / bidirectional XXXX that doesn’t seem to work; at least trying to paste into Terminal or Libre Office doesn’t. Wound up using a USB drive to transfer files between host and the VM.
  16. Because you will need it often, pin a terminal session to the left bar: o Click the “search your computer…” icon – the top icon in the left bar o Type terminal o Drag the resulting Terminal icon to the left bar
  17. Update the Ubuntu software o Click the “search your computer…” icon – the top icon in the left bar o Type Software Updater o Click on the resulting A-in-a-circle Icon, labeled Software Updater. o When it offers updates, Click Install Now o Wait for the update to complete o Restart as requested. o In a terminal window, type sudo apt-get update (this updates the package manager’s idea of what packages are where).

Install the Tidepool prerequisites

  1. Git. In a terminal, type sudo apt-get install git
  2. (skip for now – haven’t found where it’s needed) Mercurial. In a terminal, type sudo apt-get install mercurial
  3. Bazaar. In a terminal, type sudo apt-get install bzr
  4. Node. Open a Terminal. Type sudo apt-get install nodejs-legacy (“legacy” because Ubuntu installs NodeJs under a name other than the standard name, “node”. This package is supposed to fix that issue.)
  5. Npm. A Javascript (Node) package manager. In a terminal, type sudo apt-get install npm a. Configure the npm proxy See http://jjasonclark.com/how-to-setup-node-behind-web-proxy/. Type in a terminal: i. sudo npm config set –g proxy http://proxy-jf.intel.com:911 ii. sudo npm config set –g https-proxy http://proxy-jf.intel.com:911
  6. Gulp. A streaming build system: sudo npm install --global gulp
  7. Mocha, a testing framework. Open a terminal. Type sudo npm install –g mocha
  8. Mongod. The Mongo DB server (daemon). With one exception, follow the instructions at http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/#install-mongodb • Exception: The first command needs the proxy argument: --keyserver-options http-proxy=http://proxy-jf.intel.com:911
  9. The Go language. In a terminal window, type sudo apt-get install golang Pull the source
  10. Open a terminal window
  11. Create a home directory for the source and cd to it
  12. git clone https://github.com/tidepool-org/tools.git (from https://github.com/tidepool-org/tools)
  13. cd into the resultant tools folder and type: ./get_current_tidepool_repos.sh >~/tidelog 2>&1
  14. Wait a few minutes until the command completes, then look for errors in the log file (~/tidelog) a. Got npm ERR! ‘blip-mock-data’ is not in the npm registry. You should but the autor to publish it. b. Got npm ERR! Node –v v0.10.25; npm ERR! Npm –v 1.3.10 i. Additional logging details can be found in: tidepool/blip/npm-debug.log Start the server the first time
  15. In a terminal window, a. Cd to the folder you created for the Git repos. b. type (without quotes) “. tools/runservers >mylog.log 2>&1”
  16. The first run performs a lot of installation, taking about 10 minutes. a. Building Blip failed. i. Got an error about missing 'shelljs/global'. The last time I went down this path, I got to a webpack module that seemed to want to be installed both locally and globally.
ghost commented 9 years ago

The more I look into this, the more I believe it's a problem with the Node.js installation. sudo apt-get install nodejs (instead of nodejs-legacy) produced an error from get_current_tidepool_repos.sh: You must have node available on your execution path. I take that to mean Tidepool wants node.js on the path as "node" rather than the Ubuntu convention of "nodejs".

jebeck commented 9 years ago

Hi @intelbradneedham. Sorry for slow response. None of us work on a Linux machine, so it's true we're not set up for that. Let me point you to this - instructions for using Vagrant to set up our development environment in a Linux VM. An open-source contributor put this together for us, and by all reports it "just works." You have to have Vagrant and a VM provider installed to use it (VirtualBox is free).

ghost commented 9 years ago

Thanks for the pointer.

I followed the instructions your note pointed to, to install and run Vagrant. "Vagrant up..." failed because we are behind a proxy. Attempting to install the Vagrant proxy plugin also failed - I suspect ironically because we're behind a proxy. I expect the Vagrant run will also fail to setup tidepool for the same reasons: because we're behind a proxy, several setup commands require extra options to set the proxy.

I will try the Vagrant approach again, from a non-proxied network, and let you know how it goes.

Thanks, again, Brad

---------- detailed errors ----------- C:\Users\bneedham\Documents\tidepooldev\tools>vagrant up --provider virtualbox Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'puphpet/ubuntu1404-x64' could not be found. Attempting to find and install... default: Box Provider: virtualbox default: Box Version: >= 0 The box 'puphpet/ubuntu1404-x64' could not be found or could not be accessed in the remote catalog. If this is a private box on HashiCorp's Atlas, please verify you're logged in via vagrant login. Also, please double-check the name. The expanded URL and error message are shown below:

URL: ["https://atlas.hashicorp.com/puphpet/ubuntu1404-x64"] Error: Failed connect to atlas.hashicorp.com:443; No error

C:\Users\bneedham\Documents\tidepooldev\tools>vagrant plugin install vagrant-proxyconf Installing the 'vagrant-proxyconf' plugin. This can take a few minutes... Bundler, the underlying system Vagrant uses to install plugins, reported an error. The error is shown below. These errors are usually caused by misconfigured plugin installations or transient network issues. The error from Bundler is:

Could not fetch specs from http://gems.hashicorp.com/

Retrying source fetch due to error (2/3): Bundler::HTTPError Could not fetch specs from http://gems.hashicorp.com/Retrying source fetch due to error (3/3): Bundler::HTTPError Could not fetch specs from http://gems.hashicorp.com/

jebeck commented 9 years ago

Sure, let us know how it goes @intelbradneedham We probably can't be a ton of help right now in terms of support, and this isn't something we've had to figure out for ourselves...

Depending on your goals in getting things up and running, you might try just starting up blip in mock mode. This let's you see what our main web app looks like, but if you're more interested in the platform as a whole, it's not so useful.

ghost commented 9 years ago

Status update: I've successfully built and run the servers in our proxied/firewalled environment in an Ubuntu 1.404 Linux VM, in that checkServerStatus.sh prod produces all -good- responses from the server components.

There were some errors during the get and run scripts that I still need to investigate, but things are looking promising. The big issues I had to get around had to do with NodeJS version and proxy/firewall config options. I'll be happy to share my recipe (manual script) once I know it's working.