Lepozepo / cloudinary

MIT License
94 stars 42 forks source link

Stream upload doesn't work in some circumstances #20

Closed joegoldbeck closed 9 years ago

joegoldbeck commented 9 years ago

Worked fine on localhost, but then on my deployment on Modulus (which uses SSL) it hangs at 100% for 60 seconds and then gives a 504 error. Standard upload works fine both local and deployed.

Error: Server returned unexpected status code - 504 cloudinary Stacktrace:

    at a.extend._livedata_result (https://definitelynotmywebsite.com/f18e6a2b024aeb52ce862d994c0f882c6c2cfd44.js:44:22670)
    at o (https://definitelynotmywebsite.com/f18e6a2b024aeb52ce862d994c0f882c6c2cfd44.js:44:9774)
    at https://definitelynotmywebsite.com/f18e6a2b024aeb52ce862d994c0f882c6c2cfd44.js:44:395
    at Array.forEach (native)
    at Function.A.each.A.forEach (https://definitelynotmywebsite.com/f18e6a2b024aeb52ce862d994c0f882c6c2cfd44.js:1:865)
    at t.socket.onmessage (https://definitelynotmywebsite.com/f18e6a2b024aeb52ce862d994c0f882c6c2cfd44.js:44:353)
    at r.dispatchEvent (https://definitelynotmywebsite.com/f18e6a2b024aeb52ce862d994c0f882c6c2cfd44.js:42:1023)
    at T._dispatchMessage (https://definitelynotmywebsite.com/f18e6a2b024aeb52ce862d994c0f882c6c2cfd44.js:42:14589)
    at T._didMessage (https://definitelynotmywebsite.com/f18e6a2b024aeb52ce862d994c0f882c6c2cfd44.js:42:15476)
    at WebSocket.o.ws.onmessage (https://definitelynotmywebsite.com/f18e6a2b024aeb52ce862d994c0f882c6c2cfd44.js:42:17574)"
Lepozepo commented 9 years ago

Good to know, I'll keep it in mind on the next package update round I do. Hope to update my Cloudinary package in the next couple of weeks, it's been a long time coming, lol. Still, that's strange considering the server is the one doing the upload in chunks. Maybe the file is being sent to the server encrypted because of the SSL? Have you tried solving it yet by modifying the package directly?

joegoldbeck commented 9 years ago

Thanks @Lepozepo for the quick response and great package!

I haven't tried digging into the package yet since reverting to regular upload solved the primary issue. I can try to run a test in the next week or so to see if SSL is the issue though. I suspect it's not, at least not directly, and certainly it shouldn't change how the server receives the file. That said, Modulus does use a proxy for SSL, so it could be related to #16?

Another possible culprit could be demeteorizer since Modulus uses that to prepare the app for deploy.

Lepozepo commented 9 years ago

Sweet, no problem. If you want to look into cheaper alternatives, have a look at my S3 package as well, I updated that one recently and it works pretty well.

joegoldbeck commented 9 years ago

Yup, we've been using that package too :-). Having our image processing pipeline (mostly resizing at the moment but who knows) handled by an external service, and getting the storage and cdn wrapped in to boot, seems super worth the cost for the time being though. We should be so lucky to have such costs become our limiting factor :)

Lepozepo commented 9 years ago

I've completely upgraded this package, it now streams the file directly from the client to Cloudinary. This is way more efficient ^_^. You shouldn't have much of a problem with incomplete files and weird things like that anymore but if you do let me know.