Question

I am trying to start faye with foreman. My procfile lookd like this:

web: bundle exec rails server thin -p $PORT -e $RACK_ENV
worker: bundle exec sidekiq
redis: bundle exec redis-server
faye: bundle exec rackup faye.ru -s thin -E production

When I run bundle exec foreman start

the web, worker and redis servers all start correctly, but not the faye server.

In the console I get: 10:53:56 faye.1 | started with pid 10907

and then nothing more from faye.

If I run the faye server using the command in the procfile: bundle exec rackup faye.ru -s thin -E production, faye starts correctly. What am I doing wrong?

Was it helpful?

Solution

When you run this locally:

bundle exec rackup faye.ru -s thin -E production

rackup will use it's default port, which is 9292.

When it's run on Herkou, it may not start if that port is already in use. Heroku dynamically assigns the $PORT variable to a valid free port as far as I am aware.

My guess is that Faye is either starting on a different port or not starting at all.

OTHER TIPS

It looks like faye is running OK. Try to visit http://localhost:{PORT}/faye.js to see if it's responding. It should come back with JS. Make sure you use the right port when calling faye server. Once you start making requests you should see faye logs being spit by foreman.

This is Foreman's missing output issue.

If you are not seeing any output from your program, there is a likely chance that it is buffering stdout. Many languages such as Ruby and Python buffer stdout by default.

Faye doesn't set $stdout.sync = true and therefore its output is missing.

I've had the same issue some time ago and tried to fix it but my pull request was rejected.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top