GithubHelp home page GithubHelp logo

ysbaddaden / prax Goto Github PK

View Code? Open in Web Editor NEW
475.0 16.0 49.0 630 KB

Rack proxy server for development

Home Page: http://ysbaddaden.github.io/prax/

License: Other

Ruby 71.13% Shell 21.03% Makefile 0.52% C 5.26% HTML 2.05%

prax's Introduction

Prax

A pure Ruby alternative to Pow!!

Aka a Rack application spawner and proxy for simpler local development. Calling myapp.dev and subdomain.myapp.dev with no configuration is simpler than editing your hosts file, starting your applications manually on port 3000, etc.

State

Prax has been rewritten in Crystal, and this Ruby version is only kept for people that are still using this version, or are interested in a pure Ruby HTTP proxy and Rack application spawner.

You are highly encouraged to switch to the Crystal version, as the Ruby version isn’t maintained anymore, and I’ve been using the Crystal version for months now, without any problem (spawning Rack applications and proxying to Vagrant boxes). It should also avoid most bugs with Ruby Version Managers thought I don’t use one anymore (hence Vagrant).

Please check Prax (Crystal port)

Installing (GNU/Linux)

Refer to INSTALL.rdoc if you still want to install the original Ruby version of Prax.

Credits

  • Julien Portalier <[email protected]>

  • Sam Stephenson, Nick Quaranto, 37signals for the sub command and Pow!

  • pyromaniac for the initial NSSwitch extension

prax's People

Contributors

ali-bugdayci avatar araslanov-e avatar creature avatar dyson avatar fbernier avatar graywh avatar jmarks1enova avatar jneen avatar karlwilbur avatar knappe avatar kriechi avatar ku1ik avatar kuboon avatar neersighted avatar rlisowski avatar suan avatar ysbaddaden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prax's Issues

Prax does not use app gemsets

It appears to use the global gemset even if you have an app specific gemset.

Steps to reproduce.

  • set up new app and gemset
rails new testapp
cd testapp
prax link
rvm  use ruby@testapp --create --ruby-version
bundle install
  • remove rake from your global gemset
rvm gemset use global
gem uninstall rake
rvm gemset use testapp
  • go to http://sub.testapp.dev and you should get an error
  • open up .prax/_logs/testapp.log
  • you should see something about not having rake in the sources and you can see that it was checking in the global gemset directory, when it should be using the gemset associated with the app

Problem with set cookie

This has been working before and I am not entirely sure when this stopped working.

But when running a rails site through prax it is unable to set cookies. If I however start a server manually through rails s and access it there are no problems.

Update:
I have now come to a conclusion, it seems when running through prax it is only possible to send one Set-Cookie header, and my application recently changed so it is setting multiple cookies. This means only the first one gets set.

I cannot find any cookie-related code inside prax. Do you have any clue why it would only allow to send one Set-Cookie header?

Generate SSL keys in prax-install

The title says it all. It would be nice that the install command also generated SSL keys, so Prax is fully ready to provide SSL, without further manual work :)

Reports HTTPS server ready when it's not.

There is a prax.log log entry "Starting HTTPS server on port 20558" but there is no HTTPS server started. No SSL crt file or key file exists, so the server was not started.

Simplifying installation process

Seems to me the entire installation process can be compressed down to sudo apt-get install prax (or equivalent) if we package prax up nicely with the appropriate post-install actions. Do you think that's the case, or is there more trickery needed?

If so, I think it's a worthy thing people could contribute towards (myself included if I had the time 👅)

A test suite would be very welcome

I wrote prax as a proof-of-concept and to learn things te hard way about sockets, UNIX and the HTTP protocol.

I didn't write tests before, but there should be. To prevent stupid bugs and enhance the quality of the code (have a separated HTTP parser for instance), with CI against many rubies (mri, jruby and rubinius).

Add note about running web servers

Prax redirects traffic from port 80 to port 20559 and port 443 to port 20558 (using iptables rules), which may conflict with running web servers (like nginx or apache). We should had a note about it the README or in a FAQ on the wiki —and link to solutions to configure a webserver to proxy to Prax if we need them running.

As reported in the comments of #77.

request.ip

Hi,
I use gem turnout and it's complains because there is no IP address in request object.
I check it and controllers don't see ip either. There is no ip address in standard app logs too so I assume that's not turnout problem. Maybe prax should set X-Forwarded-For header to 127.0.0.1?

An app cannot call itself.

It seems prax has only one worker for an app, so if you make an HTTP request to yourself, it's going to hang there until your request times out. here's a simple app to reproduce:

config.ru:

require "net/http"
require "uri"

app = proc do |env|
  uri = URI.parse("http://myapp.dev/")
  http = Net::HTTP.new(uri.host, uri.port)
  request = Net::HTTP::Get.new(uri.request_uri)
  response = http.request(request)

  [200, { 'Content-Type' => 'text/html' }, ['Hello simple rack application!']]
end

run app

It would be nice if we could have at least 2 workers for each app.

Can't find gem(s) installed from git (unstable)

bundle exec ruby /home/graywh/.config/prax/bin/../lib/racker/command.rb --server /home/graywh/.prax/_sockets/lcmc2.0.sock
/usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/source/git.rb:177:in `rescue in load_spec_files': [email protected]:rails/conditional_forms-rails (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/source/git.rb:175:in `load_spec_files'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/source/path.rb:86:in `local_specs'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/source/git.rb:150:in `specs'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/lazy_specification.rb:52:in `__materialize__'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:88:in `block in materialize'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
        from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from <internal:lib/rubygems/custom_require>:29:in `require'

conditional_forms-rails is a gem installed via git to /home/graywh/.bundler/ruby/1.9.1/conditional_forms-rails-bfd7fd1b1395. It's not limited to that gem (it just happens to be listed first in Gemfile.lock).

Failing to spawn apps on unstable branch

I have a stock-generated rails app which works fine on master but on unstable I get this. Any ideas? All my apps are seeing this behavior on unstable. I'm running Debian Wheezy

$ PRAX_DEBUG=1 prax start --foreground
I, [2014-02-03T19:35:23.204300 #20031]  INFO -- : Prax is ready to receive connections on :20559.
I, [2014-02-03T19:35:31.397758 #20031]  INFO -- : Spawning application 'testy' [/home/vagrant/Projects/testy]
D, [2014-02-03T19:35:31.397903 #20031] DEBUG -- : exec bundle exec /opt/prax/bin/racker --server /home/vagrant/.prax/_sockets/testy.sock
E, [2014-02-03T19:35:31.400867 #20031] ERROR -- : Errno::ENOENT:No such file or directory - exec bundle exec /opt/prax/bin/racker --server /home/vagrant/.prax/_sockets/testy.sock
  /opt/prax/lib/prax/application.rb:97:in `spawn'
  /opt/prax/lib/prax/application.rb:97:in `spawn'
  /opt/prax/lib/prax/application.rb:17:in `start'
  /opt/prax/lib/prax/spawner.rb:49:in `spawn'
  /opt/prax/lib/prax/spawner.rb:23:in `block in get'
  <internal:prelude>:10:in `synchronize'
  /opt/prax/lib/prax/spawner.rb:17:in `get'
  /opt/prax/lib/prax/handler.rb:47:in `app'
  /opt/prax/lib/prax/handler.rb:43:in `connection'
  /opt/prax/lib/prax/handler.rb:21:in `handle'
  /opt/prax/lib/prax.rb:19:in `perform'
  /opt/prax/lib/prax/microworker.rb:84:in `block in work'
  /opt/prax/lib/prax/microworker.rb:77:in `each'
  /opt/prax/lib/prax/microworker.rb:77:in `work'
  /opt/prax/lib/prax/microworker.rb:63:in `block in spawn'
I, [2014-02-03T19:35:31.401235 #20031]  INFO -- : Respawning failed worker
/opt/prax/lib/prax/application.rb:97:in `spawn': No such file or directory - exec bundle exec /opt/prax/bin/racker --server /home/vagrant/.prax/_sockets/testy.sock (Errno::ENOENT)
    from /opt/prax/lib/prax/application.rb:97:in `spawn'
    from /opt/prax/lib/prax/application.rb:17:in `start'
    from /opt/prax/lib/prax/spawner.rb:49:in `spawn'
    from /opt/prax/lib/prax/spawner.rb:23:in `block in get'
    from <internal:prelude>:10:in `synchronize'
    from /opt/prax/lib/prax/spawner.rb:17:in `get'
    from /opt/prax/lib/prax/handler.rb:47:in `app'
    from /opt/prax/lib/prax/handler.rb:43:in `connection'
    from /opt/prax/lib/prax/handler.rb:21:in `handle'
    from /opt/prax/lib/prax.rb:19:in `perform'
    from /opt/prax/lib/prax/microworker.rb:84:in `block in work'
    from /opt/prax/lib/prax/microworker.rb:77:in `each'
    from /opt/prax/lib/prax/microworker.rb:77:in `work'
    from /opt/prax/lib/prax/microworker.rb:63:in `block in spawn'

Prax keeps zombies around

If the Rack app ever crashes (for whatever reason) the racker child process will be kept kept around, as a zombie, until Prax is killed.

The child process should be terminated correctly and not stay as a zombie.

Handle invalid config.ru more gracefully

If an application's config.ru is malformed (for example, missing a run or map), Rack::Builder.parse_file() throws an exception.

There's no user feedback in this case except the following repeatedly dumped to the log file:

D, [2013-07-23T10:37:26.208799 #22351] DEBUG -- : Building Rack app at /path/to/app/config.ru

In my case I made a stupid typo in my rackup file and ended up with a 3.5GB log file containing the above over and over.

Not working with Google Chrome

I've just installed Prax under Ubuntu 13.04. I've noticed that I can't reach myapp.dev under Google Chrome, but it works with Firefox. How is this possible?

Small typo in install instructions

Hey ysbaddaden,

Great job with prax! Working nicely for me on Ubuntu 12.04. One thing I noticed is the misspelling of 'initd' in your instructions. And also the 'data' directory has been renamed 'install'. So...

$ sudo cp data/initd /etc/initd/prax
$ sudo chmod +x /etc/initd/prax

... should be ...

$ sudo cp install/initd /etc/init.d/prax
$ sudo chmod +x /etc/init.d/prax

Appreciate your efforts with prax.

All the best,
Declan

Use with chruby

I successfully setup prax using chruby... but the solutions I got to work used specific ruby versions to start prax:

chruby-exec 2.0.0-p247 -- bin/prax start

or change https://github.com/ysbaddaden/prax/blob/master/libexec/prax#L40 to

chruby-exec 2.0.0-p247 -- "$command_path" "$@"

Does anyone have ideas or experience with using Prax and chruby together? Maybe this isn't the right place since it's not exactly a prax issue, but https://github.com/ysbaddaden/prax/blob/master/libexec/prax-start#L6-L12 does have code for rbenv and rvm, so maybe part of the solution is with prax?

Not able to spawn application with bundle specific gems (unstable branch)

I am running the unstable branch and this was working in the master one.

The debug output says the following:

I, [2014-02-04T23:34:29.565164 #4254]  INFO -- : Spawning application 'myapp' [/home/terje/Code/myapp]
D, [2014-02-04T23:34:29.565278 #4254] DEBUG -- : ["bundle", "exec", "/home/terje/.prax-dist/bin/racker", "--server", "/home/terje/.prax/_sockets/myapp.sock"]
D, [2014-02-04T23:34:59.577701 #4254] DEBUG -- : Killing myapp (4304)...

In the application specific log:

/home/terje/.rubies/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)
    from /home/terje/.rubies/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/spec_set.rb:85:in `map!'
    from /home/terje/.rubies/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/spec_set.rb:85:in `materialize'
    from /home/terje/.rubies/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/definition.rb:133:in `specs'
    from /home/terje/.rubies/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/definition.rb:178:in `specs_for'
    from /home/terje/.rubies/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/definition.rb:167:in `requested_specs'
    from /home/terje/.rubies/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/environment.rb:18:in `requested_specs'
    from /home/terje/.rubies/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/runtime.rb:13:in `setup'
    from /home/terje/.rubies/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler.rb:119:in `setup'
    from /home/terje/.rubies/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/setup.rb:17:in `<top (required)>'
    from /home/terje/.rubies/1.9.3-p392/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/terje/.rubies/1.9.3-p392/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'

Inside the project directory:

➥ gem list | grep rake
rake (10.1.1, 0.9.2.2) 
➥ bundle | grep rake
Using rake (10.1.0) 

So bascially what happens is that it tries to look for the bundled gem, but outside of the bundle. If I install that gem version globally, then it works.

I am willing to debug and fix this if you can point me in the right direction where to look.

Right now I'm mostly looking in the lib/prax/application.rb which I figured made most of this work.

Edit:
If I run this command manually from that directory it works.

bundle exec /home/terje/.prax-dist/bin/racker --server /home/terje/.prax/_sockets/kviberg.sock

Create releases/tags

I just started building a PKGBUILD for Arch Linux to easily install prax via package management.
When thinking about deriving the version number from git, I saw that there are no tags for any releases.
It would be great if you could add version information to the repository.

multiple ruby versions

Problematic use case:

  1. start prax from my home directory using default ruby (2.0.0p247)
  2. application uses 1.9.3p429 so when I go to http://app.dev I see error in log file
  3. stop prax and start it using the same ruby version as application

The second problem is: when I want to switch between apps I need stop prax and start it using another ruby. Is there any way to tell prax to respect .ruby-version file from application directory?

As far I know rvm and rbenv both are using .ruby-version files.

Per-app port forwarding supported?

Does prax support something like this?

(Pasted for convenience):

Pow's port proxying feature lets you route all web traffic on a particular hostname to another port on your computer. To use it, just create a file in ~/.pow (instead of a symlink) with the destination port number as its contents.

For example, to forward all traffic for http://proxiedapp.dev/ to port 8080:

$ echo 8080 > ~/.pow/proxiedapp

You can also use port proxying to access web apps written for other runtimes such as Python or Node.js. Remember that services behind the proxy won't automatically be started or stopped like Rack apps.

'Conflicting chdir during another chdir block' warning

Hi,

I get the following warning when the prax server is running sometimes...

/home/declan/dev/prax/lib/spawner.rb:29: warning: conflicting chdir during another chdir block

Can this be safely ignored or is it symptomatic of a real problem? I am running 2 sites at the moment using symlinks under the ~/.prax directory. Is it okay to run 2 sites using prax simultaneously or is this chdir issue an example of the two sites contending for a resource (ie. the current directory)?

Thanks again for this gem and hope to be able to contribute something once I understand its inner workings a bit better.

Ciao,
Dec

P.S. Is there any known severe performance issues with using prax instead of other types of webservers in a development environment?

Nothing in Iptables on Ubuntu 13.04

I've tried getting this to work on my machine, and not having any luck getting it to work. No errors or issues came up.

However running sudo iptables --list shows nothing. My expectation is that I would see prax's rules to redirect the :80 and :433 to its own ports.

running http://myapp.dev/ fails to resolve in either Chrome or FF.

Any ideas where I'm going wrong?

Ruby 1.8.7 (unstable)

/home/graywh/.config/prax/bin/../lib/racker/command.rb:2: undefined method `realpath' for File:Class (NoMethodError)

prax does not work on Ruby 2.1.1

I haven't looked into it further, but prax does not work on 2.1.1. It worked fine in 2.1.0. Is there a log that prax writes to when it blows up internally?

Fedora won't work

I can't seem to get Prax to work in Fedora 19. I have modified the install and uninstall scripts to use the appropriate commands ( chkconfig instead of update-rc.d ). However I am still getting a domain not found issue.

.powenv analog

Is there any possibility to set per-app environment just as pow allows?

Getting a rack exception with rack-mini-profiler

Hi,

Mini profiler is quite popular these days. I am getting the following exception both in rails 3.2 and 4.

Its working fine with rails server command. Since rails is using a rack middleware, I cant think of why its not working with prax.

Thanks in advance

TypeError: no implicit conversion of nil into String

/home/bor/.rvm/gems/ruby-2.0.0-p247/gems/rack-mini-profiler-0.1.31/Ruby/lib/mini_profiler/storage/file_store.rb:26:in `+'
/home/bor/.rvm/gems/ruby-2.0.0-p247/gems/rack-mini-profiler-0.1.31/Ruby/lib/mini_profiler/storage/file_store.rb:26:in `path'
/home/bor/.rvm/gems/ruby-2.0.0-p247/gems/rack-mini-profiler-0.1.31/Ruby/lib/mini_profiler/storage/file_store.rb:21:in `[]='
/home/bor/.rvm/gems/ruby-2.0.0-p247/gems/rack-mini-profiler-0.1.31/Ruby/lib/mini_profiler/storage/file_store.rb:73:in `block in set_unviewed'
/home/bor/.rvm/gems/ruby-2.0.0-p247/gems/rack-mini-profiler-0.1.31/Ruby/lib/mini_profiler/storage/file_store.rb:69:in `synchronize'
/home/bor/.rvm/gems/ruby-2.0.0-p247/gems/rack-mini-profiler-0.1.31/Ruby/lib/mini_profiler/storage/file_store.rb:69:in `set_unviewed'
/home/bor/.rvm/gems/ruby-2.0.0-p247/gems/rack-mini-profiler-0.1.31/Ruby/lib/mini_profiler/profiler.rb:325:in `call'
/home/bor/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
/home/bor/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
/home/bor/prax/lib/racker/handler.rb:24:in `call'
/home/bor/prax/lib/racker/handler.rb:16:in `handle_connection'
/home/bor/prax/lib/racker/server.rb:58:in `block (2 levels) in spawn_workers'
/home/bor/prax/lib/racker/server.rb:58:in `loop'
/home/bor/prax/lib/racker/server.rb:58:in `block in spawn_workers'
/home/bor/prax/lib/prax/workers.rb:30:in `call'
/home/bor/prax/lib/prax/workers.rb:30:in `block in spawn'

prax depends on mime-types which has been removed in Ruby 2.x

Hi,

I am successfully running prax on Ruby 2.0.0-p353, Ubuntu 12.04.4 LTS. It took me some time with a colleague to figure out why the home page of a local environment was downloading instead of showing the page. It was because prax depends on mime-types and defaulted to application/octet-stream.

By installing the mime-types gem (specifically 1.25.1, not sure if 2.x works), I was able to successfully run prax.

Ruby version managers

There is a problem with having Prax written in Ruby while using a ruby version manager (like rbenv, rvm, chruby or ry).

Prax is a ruby process, running one version of ruby (say 2.0.0-p247) that spawns other ruby processes which sometimes require a specific ruby version or engine (say jruby-1.7.4). A per-project version can be selected uniformly with a .ruby-version file in your project folder.

One would think that version managers will take care of that, but they don't. They modify the PATH, so the correct gems are loaded for each ruby version, and they may set some environment variables to somehow for the selected ruby version —rbenv sets RUBY_VERSION.

So, version managers are getting in the way. How to fix that once and for all?

I initially fixed rbenv because this is the one I use. I recently got a patch for RVM that does RVM's job by loading the .ruby-version and forcing RVM to use that version, and one for chruby that does the same thing. We're only missing a patch for ry —others are deprecated in favor of chruby.

But I don't like this idea of doing the version manager's job. I'd like a fresh shell environment, cleaned from the selected ruby version, so that the version managers would do their job: select and run the ruby version that the user wants when I run ruby in a project with a .ruby-version file.

Is that possible? A fresh shell environment, coupled with the existing and sourceable ~/.praxconfig where any local configuration could happen.

[unstable branch] Ruby error when using Rubinius 2.2.6

I, [2014-03-28T16:23:04.237919 #11595]  INFO -- : Forcing restart of identity.netcredit (/home/vagrant/8b/apps/identity)
I, [2014-03-28T16:23:04.238111 #11595]  INFO -- : Spawning application 'identity.netcredit' [/home/vagrant/8b/apps/identity]
E, [2014-03-28T16:23:04.261482 #11595] ERROR -- : TypeError: Coercion error: :child.to_str => String failed
  kernel/common/type.rb:26:in `execute_coerce_to'
  kernel/common/type.rb:19:in `coerce_to'
  kernel/common/kernel.rb:147:in `StringValue'
  kernel/common/type.rb:332:in `coerce_to_path'
  kernel/common/file.rb:1112:in `initialize'
  kernel/alpha.rb:94:in `new'
  kernel/common/io.rb:625:in `open'
  kernel/common/process.rb:218:in `setup_redirects'
  kernel/common/hash.rb:342:in `each'
  kernel/common/process.rb:211:in `setup_redirects'
  kernel/common/process.rb:256:in `exec'
  kernel/common/process.rb:748:in `spawn'
  kernel/common/process.rb:357:in `fork'
  kernel/common/process.rb:744:in `spawn'
  kernel/common/io.rb:712:in `pipe'
  kernel/common/process.rb:743:in `spawn'
  /opt/prax/lib/prax/application.rb:107:in `spawn'
  /opt/prax/lib/prax/application.rb:100:in `force_restart'
  /opt/prax/lib/prax/application.rb:45:in `socket'
  /opt/prax/lib/prax/handler.rb:43:in `connection'
  /opt/prax/lib/prax/handler.rb:21:in `handle'
  /opt/prax/lib/prax.rb:19:in `perform'
  /opt/prax/lib/prax/microworker.rb:84:in `work'
  kernel/bootstrap/array.rb:66:in `each'
  /opt/prax/lib/prax/microworker.rb:77:in `work'
  /opt/prax/lib/prax/microworker.rb:63:in `spawn'
  kernel/bootstrap/proc.rb:20:in `call'
  kernel/bootstrap/thread.rb:391:in `__run__'
I, [2014-03-28T16:23:04.261859 #11595]  INFO -- : Respawning failed worker

Debugging

Where can i see te server requets in a rails app for debugging. Usually when i run a rails app i can see the server's requests in the terminal, i can see tat prax is somehow running in the background. Is there any way?

Racker process should have a TTL

Apps should have a time to live (TTL) which means that if an app doesn't receive any request within 15 minutes, for instance, the rack app should be terminated cleanly.

The actual TTL should be configurable, using PRAX_TTL or PRAX_TIMEOUT environment variables.

Hard reset of environment variables VS ruby version managers

I'm hard resetting the environment variables to almost nothing, in order for ruby version managers to not be influenced by the ruby version Prax is currently running with.

The problem is that the reset is so hard that not even HOME, USER and UID are kept.

I'm wondering how to correctly fix that problem: have a whitelist of environment variables that must be kept? Keep a hash of the original environment variables? Something else?

REMOTE_ADDR is empty

Ubuntu 13.04, with a Rails app. Everything seems to work fine, except that th REMOTE_ADDR entry is empty (in Rails, request.remote_ip returns nil).

can't find "sfl" gem

I've got an application running in Ruby 1.8.7p358 (via rbenv and .ruby-version) and prax fails to load the "sfl" gem. I've installed it for that ruby version and the default ruby.

xip.io not working

hi, i could not work with xip.io on network. we have no response from server.

need's some special config for this?

thanks.

Forking / separate process / reactor-based model instead of using threads?

@ysbaddaden Have you ever considered using a separate process model instead of a threading model for each app? For a given app, pow doesn't actually use multiple threads, which allows you to run un-threadsafe code.

This is the dilemma we're having with our environment on Linux now - whether to use prax or make our multiple apps' code threadsafe. (since thus far we've only used unicorn and pow)

My thinking is that a process-based solution would be more compatible with various apps.

P/S: You've been super helpful with your quick fixes with my other issues!

suddenly no response

Has anyone else seen prax suddenly stop responding? At least once, it happened after touching tmp/restart.txt to restart an application. After stopping and starting prax, it worked normally.

Support for OpenSuse

Hi guys,

I tried to install in OpenSUSE, and figured out that

sudo: update-rc.d: command not found

In OpenSUSE it should use:

sudo /sbin/chkconfig --set prax on

getting not a rack app error

Hi,

I am getting not a rackapp error when linking both a rails 3 and 4 apps:

~/prax[master]% bin/prax link ~/sunucu/rails4
Error: this does not appear to be a rack app (config.ru is
missing) and there isn't any public/ folder either.

When I create a link by hand, I still get a not found error on my browser:
ln -sf ~/sunucu/rails4 ~/.prax/

HTTP logs

Hi ysbaddaden, I recently install Prax and I look for the /.prax/_logs folder, I check the tails and they give me information about the files involved on every request that now became handy, but not the rails style server log where I can see the HTTP or DB responses.

How can I access those?

BTW your app is great cool Job

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.