meteorhacks / cluster

Clustering solution for Meteor with load balancing and service discovery
https://meteorhacks.com/cluster-a-different-kind-of-load-balancer-for-meteor.html
MIT License
631 stars 80 forks source link

Any ideas on solving nginx ERR_CONTENT_LENGTH_MISMATCH with CollectionFS? #64

Open adamgins opened 9 years ago

adamgins commented 9 years ago

Hi, I am using Cluster with nginx reverse proxy (Docker install thanks to Sunsama). I am using nginx to serv files via s3 and I am getting some random errors on serving files ons3 via collectionsFS. I am just struggling to debug/pinpoint where the actual issue is. As Cluster is part of the equation wondering if anytone has any thoughts on this, please?

Basically, sometimes, an uploaded file will initially show a 200 OK and then a few seconds later show a net::ERR_CONTENT_LENGTH_MISMATCH in the browser console.

So the image shows up and then disappears a few seconds later.

on the server side nginx is throwing a [error] 26#0: *759 upstream prematurely closed connection while reading upstream,

I think this is just nginx saying there's an issue with the backend and the error is deeper within the server.

Is there something in Cluster that would be doing two request, where the first is OK and the second has an issue?

Here's the detail of the error logged with CollectionFS which has some screenshots and additional info https://github.com/CollectionFS/Meteor-CollectionFS/issues/690

bitomule commented 9 years ago

I have this issue too, any ideas?

adamgins commented 9 years ago

I am about to try and bypass the issue with Cloudflare. I'll let you know if it works.

adamgins commented 9 years ago

@bitomule similar issue with Cloudflare... it just took longer to get the broken link

bitomule commented 9 years ago

I'm not even using nginx. Just Cluster and trying to connect to the server throws that error only on chrome, safari just shows the broken image.

adamgins commented 9 years ago

@arunoda any thoughts, pls?

arunoda commented 9 years ago

I didn't got these kind of issues. May be since I don't use longer files. Could you please create a isolated case for me to work on?

adamgins commented 9 years ago

@arunoda thanks. Will try and setup something... not that simple as it's tied to s3. @bitomule were you experiencing the issue with AWS s3 or using another CFS connector?

bitomule commented 9 years ago

@adamgins yeah, I'm also using S3.

adamgins commented 9 years ago

@arunoda trying to setup a test environment for you... what's the best way to do this? I have a base project that I have deployed to meteor.com but not sure how to setup cluster in that environment currently it's running at http://tests3cfs.meteor.com/ (No cluster)

You can just drop an image on and then it shows it below... so pretty basic.

I have the code here https://github.com/Buzzy-Buzz/meteor-debug note I have taken out the s3 keys in the Images(collection/images.js) . It's just a test bucket, so I can send you this privately if you email me adam.ginsburg@buzzy.buzz or you can use your own if you have them.

Also, as I understand it, I cant get this running with the graphicsMagick transformations on meteor.com (it has to be installed on the server). It's these images that seem to mess up. @bitomule not sure if you're seeing this too? ie is it with the transformed images only or the original ones?

thanks for the help

bitomule commented 9 years ago

I think there's a big issue with cluster and collectionFS, I can upload or download files and the same code works outside cluster. @arunoda is there anything in cluster that can be blocking access to S3?

mitar commented 8 years ago

In my case I solved the issue by increasing the send_timeout in Nginx.