Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreman start fails on Windows: Bad file descriptor #348

Closed
corydolphin opened this issue Mar 24, 2013 · 30 comments
Closed

Foreman start fails on Windows: Bad file descriptor #348

corydolphin opened this issue Mar 24, 2013 · 30 comments

Comments

@corydolphin
Copy link

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
@johnbrett
Copy link

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

@ItalianChef
Copy link

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

@thiagopintodev
Copy link

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

@rally25rs
Copy link

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

@connorbode
Copy link

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

@thiagopintodev
Copy link

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

@g4d
Copy link

g4d commented Apr 28, 2013

thanks @ItalianChef that worked! :)

@xpertode
Copy link

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"

@thiagopintodev
Copy link

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

@jblangworthy
Copy link

Reverting to version 0.61 fixed it for me

@rmtsukuru
Copy link

@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.

@starrychloe
Copy link

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

@ddollar
Copy link
Owner

ddollar commented Sep 16, 2013

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

@ddollar ddollar closed this as completed Sep 16, 2013
@nbo44
Copy link

nbo44 commented Nov 25, 2013

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

@gilbok
Copy link

gilbok commented Dec 26, 2013

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

@thoughtpalette
Copy link

+1 @ItalianChef Thanks!

@easingthemes
Copy link

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

@jonahx
Copy link

jonahx commented Mar 29, 2014

@ItalianChef advice still going strong

@wstidolph
Copy link

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

@AndLen
Copy link

AndLen commented May 23, 2014

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

@PaulYork-GitHub
Copy link

@ItalianChef Thanks - Same problem had on 0.74.0!

@robertlagrant
Copy link

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

@titibouboul
Copy link

@ItalianChef Same here.. Thanks!

@jdx
Copy link

jdx commented Aug 19, 2014

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

@robertlagrant
Copy link

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

@jdx
Copy link

jdx commented Aug 20, 2014

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

@robertlagrant
Copy link

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

@jdx
Copy link

jdx commented Aug 21, 2014

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 notifications@github.com
wrote:

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


Reply to this email directly or view it on GitHub
#348 (comment).

@robertlagrant
Copy link

I'm spoiled by pip, it seems :)

@robertlagrant
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests