Error with Middelman and Rack Lint

Hi, dont know why, but two Middleman project generate error when building, the error refer to content header lenght. Any one can help me? Related to DatoCMS?

@mat_jack1 Can I send you the repo link so that you can look for what is causing this error?


Is the problem can come from Faraday version in your Dato gem? Because this is the second Dato project that output : Rack::Lint::LintError: Content-Length header was XXXXX, but should be XXXXX

I’ve seen some console errors relating to Faraday when running middleman-dato, but it didn’t cause the build to fail so I had to ignore it for the time being. Not sure what my particular error was, will post when I get a chance.

Thanks. This is really weird because the build issue is no longer happening on my side. But this is the second time this week that a client site fail to build with content header length error.

hey @guillaume if that happens again please send over the repo link so that I can try.

But yesterday we’ve changed something in the headers that we return back, by removing unnecessary content that was blowing up the headers size and that was maybe causing the issue. The headers were internal messages regarding cache invalidation, so they were unnecessary outside our network.

So it shouldn’t happen again, but if it does please let me know!

1 Like

Ok, thanks. This is working now.

Hey @mat_jack1, here is a project that cause problem. This zip is officially a functionnable Netlify version, so if you start it like that, it will work. But, if you update gem or bundle update, you’ll see that you won’t be able to reach home page on the localhost, and if you do bundle exec middleman build --verbose, you’ll see the Content Header Length issue appear and the build fail.

I have tried to update gem, clean gem, change bundler to bundler-2.1.4, without success.

Yes, I can reproduce. I have a doubt about that, let us have a look and we’ll be in touch soon. Sorry for that.

1 Like

I’ve found another project that is broken, if you wish to investigate more, here is the dropbox link.

Another one :

If you start the server, it work, but if you do a bundle install, and that Gem are updated, it’s failing.


yep, thank you, we are able to reproduce, we’ll work on it as soon as possible

1 Like

hi @guillaume

please try to lock rack version to 2.0.8 like reported here:

Add this to your Gemfile

gem 'rack', '2.0.8'

This works on your apchq-6781-master project, even after I updated middleman-dato gem.

Let us know!

Had very same issue on a new site being ported to MM 4 and datoCMS. I can confirm that downgrading rack and fixing version to 2.0.8 fixes the issue and allows the build to complete!


Thank you @cleanwell-ni for reporting this :slight_smile: