-
Notifications
You must be signed in to change notification settings - Fork 53
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
The html output cuts off at a random point of the analytics script insertion #31
Comments
uhm. nothing that directly comes to my mind. what rails version are you using? any other middlewares in your stack that might mess up the response? |
I use rails I tried to set it up in development as well and it does the same thing of cutting the html output at a random point inside the analytics script element. For example the first time I loaded the page it cut there:
And the second time there:
|
which application server do you use? |
locally I use thin (version |
still no luck ;) what ruby version? can you also please supply the output of |
I'm using ruby version > rake middleware
use ActionDispatch::Static
use Rack::Lock
use #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007f9be3b97770>
use Rack::Runtime
use Rack::MethodOverride
use ActionDispatch::RequestId
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use ActionDispatch::DebugExceptions
use ActionDispatch::RemoteIp
use ActionDispatch::Reloader
use ActionDispatch::Callbacks
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
use ActionDispatch::Cookies
use ActionDispatch::Session::CookieStore
use ActionDispatch::Flash
use ActionDispatch::ParamsParser
use ActionDispatch::Head
use Rack::ConditionalGet
use Rack::ETag
use ActionDispatch::BestStandardsSupport
use Rack::GoogleAnalytics
run MyApp::Application.routes |
and this happens on every request? or just sometimes or on specific actions? |
It happens on every request and it seems to cut at the exact same place for a given page and at a different place for different pages (but always inside one of the two script elements inserted by the gem). I tried the gem on a different project and it did not cut. There must be something very specific with my app that does not play well with it. |
I've spent the last 2 days digging into a similar issue before finally fixing it and finding this issue. We run nginx + unicorn + rails 4.x with this gem on production and we were seeing truncated output. After a lot of debugging, I was able to deduce that Unicorn was sending back an incorrect
It turns out that nginx was correct, and using
Looking at the code for this gem, it does appear to be doing some pretty low level munging/injecting of the content at the last second, which could certainly explain some of this. In either case, I've removed the gem for now because it fixes the problem. Without changing anything else but this middleware, it changes the behavior of Unicorn ( |
When using this on heroku, the html output is randomly cut off before the end of the document like so:
The markup is cut at a random point and the remaining markup is not closed.
Any idea why?
The text was updated successfully, but these errors were encountered: