Heroku deployment with v0.6.x

69 views
Skip to first unread message

Brent Westmoreland

unread,
Nov 13, 2012, 10:35:32 AM11/13/12
to ged...@googlegroups.com
Hi All, 

It appears that with the addition of either the realtime stuff or the passport stuff in v0.6 the default hostname value of 'null' in lib/base_config.js was changed to locahost.  This causes geddy to start up and attempt to bind to 127.0.0.1 if no hostname is specified in config/<insert-environment-name>.js.  In v0.5.x the default behavior was to bind to any available address which worked fine with Heroku.

Unfortunately, now in v0.6.x leaving the default value in config/production.js to null now causes an error on deployment to Heroku:

Error R11 (Bad bind) -> Process bound to address localhost, should be 0.0.0.0


Trying to modify the value by placing the instance name in the hostname field of config/production.js also fails with an error.  Something like this, for example:


The error in this case is:

stderr.2012-11-12T20:52:10.log:[Tue, 13 Nov 2012 01:50:35 GMT] ERROR listen EADDRNOTAVAIL
stderr.2012-11-12T20:52:10.log:Error: listen EADDRNOTAVAIL

I've tried several permutations of values in the hostname field and tinkering with my forked copy of geddy in my spare time but, so far, no luck.  At this point, I just wanted to let you guys know of the issues because there are Heroku deployment instructions in the tutorial that might not work with v0.6.  Maybe someone else can fix it faster than me.  If not, I may be able to look at it over the weekend.

Regards,

-b

Matthew Eernisse

unread,
Nov 14, 2012, 8:06:18 PM11/14/12
to ged...@googlegroups.com
Brent, just fork geddy, and make your changes to docs/8-deployment.md -- that's where the Heroku stuff lives.

Also -- I'm noticing our section on NodeJitsu may be missing a few crucial pieces of information about setting the right port, and with secrets.json.

Could anybody who knows what the deal is with Jitsu deploy amend the docs?


Matthew

Brent Westmoreland

unread,
Nov 14, 2012, 9:24:44 PM11/14/12
to ged...@googlegroups.com
Hi Matthew,

Perhaps I didn't make myself entirely clear. Deploying to Heroku with v.0.6.x has been broken for me since release.  I had planned to update the docs once I got it working.  Unfortunately, the steps I had to take to make everything deploy successfully are against some best practices.  Since I just got it working in the last five minutes, I'm now ready to type out the process to get there.  Keep in mind that it's entirely possible that I'm just a n00b, and I don't know what I'm doing.  If someone has a better suggestion for deploying to Heroku with v0.6.x then I'd be happy to hear it.

Here's the path I took:
  • mkdir ~/Desktop/v6test
  • cd ~/Desktop/v6test
  • vi package.json 
{
  "name": "v6test",
  "version": "0.1.0",
  "description": "Test geddy app",
  "private": true, 
  "dependencies": {
    "geddy": "0.6.x"
  },
  "engines": {
    "node": "0.8.x",
    "npm": "1.1.x"
  }
}

  • vi start.js
var geddy = require('geddy');

geddy.start({
  environment: "production"
});

  • vi Procfile
web: node start.js

  • npm install
  • ./node_modules/bin/cli.js app .
  • vi node_modules/geddy/lib/base_config.js
, hostname: null
  • vi node_modules/geddy/lib/config.js
// ret.hostname = ret.hostname || 'localhost';

  • vi .gitignore
# Commenting this out so that my changes to base_config.js and config.js are deployed directly and not `npm install'ed
# node_modules
# Shouldn't comment this out, but don't know good way to run geddy secrets once deployed in a slug file
# config/secrets.json  

  • vi config/production.js
, hostname: null
, port: process.env.PORT || 4000

  • ./node_modules/geddy/bin/cli.js secret
  • git init
  • git add .
  • git commit -m "Initial commit"
  • heroku create
  • git push heroku master
  • heroku open
  • heroku logs -t
  • Yay!
Now the fact that I had to modify the base_config.js and config.js to remove the 'localhost' entries AND that I had to comment out the node_modules and config/secrets.json in .gitignore make me think the following:

1. I did something wrong (most likely)
2. If this the only way to get it to work, a code change might be in order to make deployment a little simpler.

Thanks,

-b


--
The official community discussion group.
website: geddyjs.org, source: https://github.com/mde/geddy, group: https://groups.google.com/d/forum/geddyjs?hl=en
 
 

Matthew Eernisse

unread,
Nov 20, 2012, 4:06:53 PM11/20/12
to ged...@googlegroups.com
Thanks so much for writing all this up in detail. I have been meaning to give our docs for Heroku and NodeJitsu a once-over. I know they're incomplete and/or plain wrong now. I'm going to try to find some time in the next couple of days to do this -- unless someone else gets to it first. :)



Matthew

On Tuesday, November 13, 2012 7:35:33 AM UTC-8, Brent Westmoreland wrote:

Brent Westmoreland

unread,
Nov 21, 2012, 7:30:25 PM11/21/12
to ged...@googlegroups.com
Hi Matthew, 

Happy to help in a small way.  I was planning to actually check out the .md file and fix it up proper, however, I wasn't sure if you wanted the steps I documented to be the official steps.  I don't like having to checkout a local copy of geddy and make changes in base_config.js and config.js, nor do I like having to add my secrets.json to my git repo.  Now that I have a few days off work, I'll try to figure out if there's a way to generate a secrets.json directly at Heroku without checking in a copy via git.

Regarding the config changes I'm just not sure what I might be breaking by changing those(passport?).  Also I haven't tried with 6.13 or 6.14 yet so maybe that's been fixed.

-b

--
Reply all
Reply to author
Forward
0 new messages