-
Notifications
You must be signed in to change notification settings - Fork 548
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
Not a Passenger Issue (was: Standalone w/ Nginx engine responds 502 to requests for Webpacker assets when Webpack Dev Server compression is disabled) #2038
Comments
Issue remains present in OSS Passenger 5.2.1 |
You said you are running this in Docker, would it be too much trouble to get a Dockerfile that reproduces the issue? That'd save a bunch of time. |
No problem. I just pushed up a repo demonstrating the issue: https://github.com/cmbankester/passenger-issue-demo |
i am not sure if my issue stems from the same root cause however i wanted to chime in here and add that i am seeing this exception when when trying to retrieve an image asset via a webpacker enabled rails app as well. it even happens when my particular setup is in a rails 4.2.10 app, and i can confirm it doesn't work with passenger 5.1.12 as well as 5.2.1. happy to provide any more information if it is helpful. |
@gardelea Do you know what the size of the asset you're trying to retrieve is? It's possible that the image is too small to be gzipped. I have the same problem (i.e. with compress set to true) with assets that are too small to be gzipped (in fact that's how I originally discovered this issue). |
@cmbankester yes, the particular image i was tracing is exactly 107,689 bytes. |
@gardelea I'm able to serve files smaller than that. For me, anything smaller than around 1kilobyte throws the error, and anything larger serves fine. Also, to reiterate, this is only when compress is turned on. When off, the error happens for all assets served by the dev server. |
I've trawled through a few packages and I think this is being caused by rack-proxy - sending a transformed Fixed here - ncr/rack-proxy#65 / ncr/rack-proxy#73 Switching to master branch of rack-proxy (in Gemfile) fixed this issue for me. |
Issue report
Question 1: What is the problem?
rails new testapp --skip-puma --webpack
)development.dev_server.compress
setting fromtrue
tofalse
inconfig/webpacker.yml
./bin/webpack-dev-server
)passenger start -a 0.0.0.0 -p 3000
)localhost:3000/packs/application-8d71e5035f8940a9e3d3.js
)The error that I receive (from log) is:
Question 2: Passenger version and integration mode:
Your answer: Open source 5.2.0 standalone (engine: Nginx 1.12.2)
Question 3: OS or Linux distro, platform (including version):
Your answer: Linux version 4.9.75-linuxkit-aufs (root@2f6b74ae1d9a) (gcc version 6.4.0 (Alpine 6.4.0) ) #1 SMP Tue Jan 9 10:58:17 UTC 2018
Question 4: Passenger installation method:
Your answer:
[ ] RubyGems + Gemfile
[x] 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):
Your answer: ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux-musl], Rails 5.1.5, Node.js 8
Question 6: Are you using a PaaS and/or containerization? If so which one?
Your answer: Running inside a Docker (version 18.02.0-ce) container (base image: alpine:3.7)
Question 7: Anything else about your setup that we should know?
Your answer: I first noticed this issue when running OSS Passenger 5.1.11 (Ruby 2.2, Alpine 3.6, Node 8). The issue also happens when Webpack dev server compression is enabled but the requested file is small enough that gzipping does not happen. I was able to determine that the responses that cause the
thread_handler_extension.rb#process_body
method to fail with the provided error/stack are those that have the Content-Length header set. When Webpack dev server compression is disabled, all of the responses from the dev server have the Content-Length header set. Thus, disabling compression (within the webpacker.yml file) is an easy way to reproduce the issue.The text was updated successfully, but these errors were encountered: