Ran into this funny little bug and didn't find too much about it on the interwebs, so for prosperities' sake here are the gory details...
The error is "RuntimeError: PhusionPassenger::Utils::RewindableInput is not a valid input stream. It must walk like either a String, an IO, or a Source."
The offending line of code occures when using REXML to parse an XML document as part of a webhook controller:
doc = REXML::Document.new request.body()
Under the covers, it is this line of code that generates the error:
/opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/1.8/rexml/source.rb:21:in `create_from'
This is a rails 3 app, running under Phusion Passenger 3.0.10 and REE 1.8.7.
The solution, courtesy of jsierles, is to fixup Passenger with an ImprovedRewindableInput: https://gist.github.com/281126 Basically, create a /config/initializers/phusion-rexml-phixup.rb file and paste the code from that gist.
Comments
You can follow this conversation by subscribing to the comment feed for this post.