Foreman: Foreman start fails on Windows: Bad file descriptor

Created on 24 Mar 2013  Â·  30Comments  Â·  Source: ddollar/foreman

I am having issues running Foreman on Windows using ruby 1.93, standard install, on Windows 8 Pro, installed both directly, i.e. gem install foreman and by building edge foreman manually.

It seems to actually run the application (a simple python webapp, in this case, but nothing written to stdout is actuall displayed, and it seems to fail silently on other occasions.

Is this expected behavior? The README lists support for Windows, but it seems to be a non-blocking issue in this version of foreman/ruby.

I do not believe the Procfile is actually the issue, as it works well on Linux. I made sure that there were not weird line endings, and my ruby path contains no spaces, etc which may trip up paths on Windows.

Please let me know if there is anything I can do to help, sadly I am not very familiar with Ruby and nonblocking reading on Windows.

C:\>foreman start
Bad file descriptor
C:/ruby193/lib/ruby/gems/1.9.1/gems/foreman-.62.0/lib/foreman/engine.rb:377:inread_nonblock
C:/ruby193/lib/ruby/gems/1.9.1/gems/foreman-0.62.0/lib/foreman/engine.rb:377:inblock (2 levels) in watch_for_output
C:/ruby193/lib/ruby/gems/1.9.1/gems/foreman-0.62.0/lib/foreman/engine.rb:373:inloop
C:/ruby193/lib/ruby/gems/1.9.1/gems/foreman-0.62.0/lib/foreman/engine.rb:373:inblock in watch_for_output

Procfile:

web: python run.py

All 30 comments

I'm having the exact same problem, please let me know if you find a solution!

There seems to be an issue with the current version 0.62.0 of foreman. I found the following post on stackoverflow suggesting to use version 0.61.0 instead

http://stackoverflow.com/questions/15399637/cant-start-foreman-in-heroku-tutorial-using-python

Just some hint: Ensure that version 0.62.0 is removed completely by invoking

gem uninstall foreman

and selecting version 0.62.0 (if multiple versions are installed).

Then, install version 0.61.0 via

gem install foreman -v 0.61

your production server is going to be linux,
please stop using windows

foreman v0.63 has the same issue, need to go back to .61

@yakko My work machine is Windows based. Linux isn't always an option.

@connorbode so is mine, I run a very light debian 6 in an oracle virtualbox :)

thanks @ItalianChef that worked! :)

I also have the same problem but downgrading to foreman v0.61 didn't worked.
It spits out an error saying
"18:54:59 web.1 | unknown command: gunicorn hellodjango.wsgi"
My procfile is
"web: gunicorn hellodjango.wsgi"

hey @ddollar, could you take a look this please?

Reverting to version 0.61 fixed it for me

@ItalianChef Thank you very much, that was precisely the answer I needed! I'm glad you're patient enough to deal with us developers who go to all the trouble of setting up on a Windows development machine despite the predominance of POSIX systems.

Hope this is fixed soon in the most recent release.

I have this issue too.

C:\Users\Chloe\Documents\FakeLove\virgin-color-grabber-temp-repo>foreman start
Bad file descriptor
C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/engine.rb:372:in `read_nonblock'
C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/engine.rb:372:in `block (2 levels) in
 watch_for_output'
C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/engine.rb:368:in `loop'
C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/engine.rb:368:in `block in watch_for_
output'
C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/engine.rb:88:in `rescue in notice_sig
nal': uninitialized constant Errno::EINT (NameError)
        from C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/engine.rb:85:in `notice_
signal'
        from C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/engine.rb:69:in `block (
2 levels) in register_signal_handlers'
        from C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/engine.rb:401:in `call'
        from C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/engine.rb:401:in `wait2'

        from C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/engine.rb:401:in `watch_
for_termination'
        from C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/engine.rb:60:in `start'
        from C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/lib/foreman/cli.rb:41:in `start'
        from C:/ruby200/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
        from C:/ruby200/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_c
ommand'
        from C:/ruby200/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
        from C:/ruby200/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
        from C:/ruby200/lib/ruby/gems/2.0.0/gems/foreman-0.63.0/bin/foreman:7:in `<top (required)>'
        from C:/ruby200/bin/foreman:23:in `load'
        from C:/ruby200/bin/foreman:23:in `<main>'
Terminate batch job (Y/N)? ^C
C:\Users\Chloe\Documents\FakeLove\virgin-color-grabber-temp-repo>ruby -v
ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
C:\Users\Chloe\Documents\FakeLove\virgin-color-grabber-temp-repo>gem list foreman

*** LOCAL GEMS ***

foreman (0.63.0)
C:\Users\Chloe\Documents\FakeLove\virgin-color-grabber-temp-repo>chocolatey version ruby


found         : 2.0.0.24700
name          : ruby
latestCompare : 000000000002.000000000000.000000000000.000000024700
verMessage    : Latest version installed
latest        : 2.0.0.24700
foundCompare  : 000000000002.000000000000.000000000000.000000024700

C:\Users\Chloe\Documents\FakeLove\virgin-color-grabber-temp-repo>type Procfile
web: bundle exec ruby server.rb -p 4567 -o 0.0.0.0
osc: bundle exec ruby dummy_osc_server.rb

Due to a number of issues with the Ruby implementation, I have rewritten Foreman in Go. Please check it out at https://github.com/ddollar/forego

I changed my version from 0.63 to 0.61 on Windows device and it works !!
Thanks

+1, you guys saved me. thanks a lot.

+1 @ItalianChef Thanks!

almost a year after, @ItalianChef helped again.
And I did a fresh install of everything.

@ItalianChef advice still going strong

Same problem with v0.63 (on Windows 7 x64) and same solution, v0.61 - thanks, @ItalianChef!

Thanks, fixed the same problem with v0.67. Note you need to run it as admin.

@ItalianChef Thanks - Same problem had on 0.74.0!

@ItalianChef I also had this problem - thanks for the workaround! Now we just need postgresql on Windows properly!

@ItalianChef Same here.. Thanks!

I put a patch in for this #477, so the next release should be resolved

Thanks! Do we wait for Heroku Toolbelt to be updated, or is there a way to upgrade within that?

we should do a release of the toolbelt soon, but I want to get a couple of people to test it. Would you mind? You'll need to install it with bundler with reference to the master branch on github http://bundler.io/git.html and run it with bundle exec

I can; can I install it without killing my current install?

Yeah, but you'll need to do it via bundler. You can't just gem install
something from git

On Thursday, August 21, 2014, robertlagrant [email protected]
wrote:

I can; can I install it without killing my current install?

—
Reply to this email directly or view it on GitHub
https://github.com/ddollar/foreman/issues/348#issuecomment-52904551.

I'm spoiled by pip, it seems :)

I know this sounds ridiculous, but I don't know how to set up a gemfile etc to use Bundler. When I get half an hour I'll investigate.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kurtnovack picture kurtnovack  Â·  5Comments

chagar picture chagar  Â·  15Comments

dunkstewart picture dunkstewart  Â·  12Comments

wireframe picture wireframe  Â·  23Comments

maxehmookau picture maxehmookau  Â·  5Comments