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

Support for Windows Subsystem for Linux (WSL) #2036

Closed
kule opened this issue Feb 27, 2018 · 9 comments
Closed

Support for Windows Subsystem for Linux (WSL) #2036

kule opened this issue Feb 27, 2018 · 9 comments

Comments

@kule
Copy link
Contributor

kule commented Feb 27, 2018

Issue report

I came across this issue trying to get our Rails app running on a colleagues Windows machine. I know it's probably low priority (can't imagine there's a huge amount of users with this setup) but thought I'd post it incase it's something that's worth fixing (or at least be of use for the next person trying to find a fix).

I worked around this by forcing Passenger to use tcp sockets instead of unix sockets by setting _PASSENGER_FORCE_HTTP_SESSION to true.

( fyi https://stackoverflow.com/questions/48160275/cannot-start-rails-app-on-nginx-with-passenger-and-https-under-wsl-port-in-use/49009318#49009318 )

Question 1: What is the problem?
Passenger fails with Address already in use when running under Ubuntu WSL

Address already in use - listen(2) (Errno::EADDRINUSE)
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:303:in `listen'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:303:in `block in create_unix_socket_on_filesystem'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:65:in `block in retry_at_most'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:63:in `times'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:63:in `retry_at_most'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:299:in `create_unix_socket_on_filesystem'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:101:in `initialize'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:135:in `new'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:135:in `negotiate_spawn_command'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:158:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'

Question 2: Passenger version and integration mode:
We tried with open source 5.1.11 standalone and via Apache 2.4.18
(also tried with the latest 5.2.0 standalone and had the same issue)

Question 3: OS or Linux distro, platform (including version):
Windows 10 Pro. v 1709. build 16299.192
Windows Subsystem for Linux (using Ubuntu)

Question 4: Passenger installation method:

Your answer:
[X] RubyGems + Gemfile
[ ] RubyGems, no Gemfile
[ ] Phusion APT repo
[ ] Phusion YUM repo
[ ] OS X Homebrew
[ ] source tarball
[ ] Other, please specify:

Question 5: Your app's programming language (including any version managers) and framework (including versions):
Ruby 2.4.2
Rails 4.2.10
Node.js 8.9.4

Question 6: Are you using a PaaS and/or containerization? If so which one?
Windows Subsystem for Linux (using Ubuntu)

@OnixGH OnixGH changed the title Address already in use error with Windows Subsystem for Linux (WSL) Support for Windows Subsystem for Linux (WSL) Feb 27, 2018
@OnixGH
Copy link
Contributor

OnixGH commented Feb 27, 2018

Thanks for sharing! I renamed it as a feature request since it's not an officially supported setup, but it's very useful to see your experiences.

@kule
Copy link
Contributor Author

kule commented Feb 27, 2018

@OnixGH thanks, yeah not expecting much on this one.

Just to add it looks like I was a bit too quick on the workaround above - it seems to stall on ajax post requests.

@meixiaofei
Copy link

@kule yes, sure it is, it's still not work with the request method post...
and you have any solution? thanks a lot for your share, QaQ

@kule
Copy link
Contributor Author

kule commented May 1, 2018

@meixiaofei I've updated my pull request - if you manually make the changes I did there it'll work in WSL.

@CamJN
Copy link
Contributor

CamJN commented Jun 19, 2018

We've tinkered around with this a bit, and haven't found Passenger on WSL to be stable enough yet to merge at this time. @FooBarWidget might be able to elaborate if he has a second.

@kule
Copy link
Contributor Author

kule commented Jun 19, 2018

@CamJN thanks for the update. The pull request works for us, but it's only for limited development purposes.

It'd save some hassle if it could work out of the box, however, I can imagine it's a whole other issue to pull it in and having users expect it to be production-worthy and have to support something that doesn't work in all cases.

I don't work on Windows usually but if there's something you need me to change let me know I'll have a look at the Pull Request again.

@CamJN
Copy link
Contributor

CamJN commented May 9, 2019

in WSL2 passenger should "just work", can someone verify this?

@somesayinice
Copy link

in WSL2 passenger should "just work", can someone verify this?

Appears to be working. Thanks for this reply. Was about to give up on passenger for wsl.

@CamJN
Copy link
Contributor

CamJN commented Oct 4, 2021

PR is merged

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

No branches or pull requests

6 participants