kmoe/slack-pokebot

Binding to port

jakeboyles opened this issue · 20 comments

I used the deploy to heroku button and am getting a problem with it not being able to bind to port. Am I missing something?

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

Hi jakeboyles - I don't think it should bind to a port - it doesn't provide a web interface.

I didnt think so either but for some reason its crashing my app on heroku

kmoe commented

Ah I had this - are you using a free dyno?

kmoe commented

I think there's a problem with Heroku where free dynos for nodejs apps can't be of the worker type.

kmoe commented

Thanks for bringing this up - I will investigate now.

Yeah im using the free dyno. I was just going to wrap an express server around it and keep hitting the route with pingdom...

kmoe commented

@jakeboyles yeah I actually considered doing that before I upgraded to a hobby dyno (which I was going to do anyway) - seems wasteful but it genuinely seems to be a Heroku limitation/bug.

kmoe commented

If you initialise an express server you won't need to pingdom though

kmoe commented

Just having it listening is enough

I figured out what to do.
screen shot 2016-07-28 at 5 17 36 pm

That solved it. So you can use the free dyno you just need to switch your worker.

kmoe commented

Interesting, I didn't have the option to do that when I tried - but I'd accidentally initialised the Procfile with only a web worker defined so maybe it 'stuck' that way.

kmoe commented

Thank you very much for your solution - I'll add it to the README.

If it's non-intuitive, perhaps we could put an small express server there - we could even serve up stats from it...

kmoe commented

@chris-j-major that's a good extension, especially if paired with a nice frontend
you could even put Niantic server status there!

kmoe commented

@jakeboyles let me know if it works now this is resolved!

Yeah, its working fine now. I think ill still hit the sleeping issue though.

Unless the constant polling of the api solves that, so it might not sleep...

kmoe commented

Yeah, I expect you'll just end up using up your free dyno hours while the app is running.