-
Notifications
You must be signed in to change notification settings - Fork 61
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
Uploading fails on Linux/Docker in production mode #45
Comments
Also seeing this issue. |
This issue started around the 8th of April for me, used to work fine before that. |
that is really strange as we haven't done any changes ... we do have one production app in development on Linux and the thing works ... To put it simply, this error appears if you sign the data you will send to S3 (including headers) and then you change the headers or anything in the actual payload |
Hm yeah, this has probably something to do with Vapor or one of it's dependencies; stuff like vapor/core get's updated automatically on every fresh build, e.g. when using continuous deployment. I'm testing this now with older versions of vapor/core etc. to define the issue a bit better. Tried to remove the content-length header, or send |
Alright it's working again now; downgraded dependencies multipart to 3.0.3, http to 3.1.11, core to 3.7.1 and crypto to 3.3.2. So something broke in those changes; are you using the multipart functionality? Looks like #34 might be the problem. Updating the rest of the dependencies right now to pin point the issue. |
Alright, updated all the other dependencies, so i'm almost certain #34 is the culprit here. Still not sure why this breaks the uploading (probably the sha256 payload hashing), only on production, since my unit tests run fine. |
Quick fix for now; Package(
dependencies: [
.package(url: "https://github.com/vapor/multipart.git", .exact("3.0.3"))
.... etc
],
targets: [
.target(name: "App", dependencies: [
"Multipart",
"Vapor",
...etc
]),
]
) |
Interesting, the data I’m uploading to S3 is fact being received from a multipart post. |
right ... now we actually getting somewhere me thinks. I remember I've had an issue where URLSession was actually adding a header to the request (potentially caching but please do not take my word for it, will have to verify again). I have even had a Vapor PR to fix this on a I have been able to debug this using Charles proxy as you get access to all that goes in or out. I'll check later too but it would be absolutely amazing if you could check this is the problem on your side @jagreenwood? |
I've got another clue and workaround for using current versions of dependencies. Copying the data before sending it seems to work.
|
When trying to upload to S3 on a linux + production environment, an error is thrown;
This might have something to do with sending the
Content-Length
header, as suggested hereI'm using Swift 4.2 with Vapor 3.3.0, and the 'master' branch from this repo (might be nice to tag a new release #35 )
Testing the removal of the
Content-Length
header on my fork, will create a PR when this fixes things :)The text was updated successfully, but these errors were encountered: