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

Site broken: all served files get truncated #1073

Closed
stomar opened this issue May 25, 2015 · 10 comments
Closed

Site broken: all served files get truncated #1073

stomar opened this issue May 25, 2015 · 10 comments
Labels

Comments

@stomar
Copy link
Contributor

stomar commented May 25, 2015

Almost all served content seems to get truncated. This affects pages (html), RSS feeds, images, ...

This doesn't seem to be caused by a size limit; even very small files like the hamburger logo (109 bytes) are affected.

Generating and serving the site locally works fine.

This should be the common reason for #1053, #1069, #1070.

cc @hsbt

@stomar
Copy link
Contributor Author

stomar commented May 25, 2015

Regarding the timeline:

  • Heroku release v285 (06b30b1, deployed 2015/04/15 23:26:54) seems to have been ok, at least regarding problems with the ruby pattern image
  • Heroku release v286 (65ba0b7) showed problems with above mentioned image and was rolled back to v285
  • Next deploy: v290 (08e7f27, at 2015/05/03 11:16:42); this matches the statement that RSS feeds started being broken at about May 2nd; truncated pages were observed at May 5th

So the problem seems to have been introduced between these commits:

  • 06b30b1 Thu Apr 16 15:18:04 2015 +0900
  • 65ba0b7 Fri Apr 17 18:12:37 2015 +0000

@stomar
Copy link
Contributor Author

stomar commented May 25, 2015

@hsbt Between these commits was the switch to Jekyll 2:

9b90c45 Thu Apr 16 15:48:20 2015 +0900

😢

Update: Jekyll 2 itself is not the problem, see below.

@stomar
Copy link
Contributor Author

stomar commented May 25, 2015

Update: It's an issue with rack-jekyll 0.3.5 !!!

Serving locally with jekyll serve does work, but actually that's not what the server does.
So I tried with rackup config.ru and got internal server errors, e.g.

ERROR Rack::Lint::LintError: Content-Length header was 107, but should be 109

This was for the file images/hamburger.png; note that for this file using curl or wget results in a downloaded file with only 107 of the total 109 bytes.

So it seems that the files get served with wrong Content-Length headers, so that they are truncated by the clients.

Update: This is fixed in rack-jekyll 0.4.0 or higher (namely 0.4.1 as of now), but both versions are not compatible with Jekyll 2. The current master branch of rack-jekyll is.

Note: I needed to (locally) remove SSL in config.ru, since I didn't know how to get it running with SSL.

@stomar
Copy link
Contributor Author

stomar commented May 25, 2015

I tried to fix this with 06d990e, but this caused an application error, and I needed to reverted 😢

With a local dummy application it worked...

Update: It seems the development version of rack-jekyll always regenerates the site; this crashes on Heroku. I already opened an issue there.

@stomar
Copy link
Contributor Author

stomar commented May 25, 2015

To sum up: rack-jekyll is the problem.

  • < 0.4.0 calculates wrong Content-Length headers (length instead of bytesize)
  • 0.4.0 and 0.4.1 should work fine, but require Jekyll <2.0 (IMO for no particular reason)
  • master works with Jekyll 2, but introduces automatic (re)generation of the site, which crashes on Heroku

@stomar
Copy link
Contributor Author

stomar commented May 26, 2015

Fixed with c01e59d: uses rack-jekyll 0.4.1, but a patched version that allows Jekyll 2.

@stomar
Copy link
Contributor Author

stomar commented May 26, 2015

@hsbt Please review.

@hsbt
Copy link
Member

hsbt commented May 26, 2015

@stomar Thanks for your investigation! I confirmed you only changes jekyll version from v0.4.1. It's ok to our website.

@JuanitoFatas
Copy link
Member

This issue can be closed right? Seems all good now! 👏

@stomar
Copy link
Contributor Author

stomar commented May 28, 2015

Fixed for the time being.

But we need to observe the future development of rack-jekyll, I would prefer switching back to the 'official' releases.

@stomar stomar closed this as completed May 28, 2015
yasulab added a commit to yasslab/railsguides.jp that referenced this issue Jan 1, 2017
yasulab added a commit to yasslab/railsguides.jp that referenced this issue Jan 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants