soto: S3 getObject fails in macOS Mojave
Describe the bug A have a simple func that downloads a file/object from AWS S3, in macOS Catalina the download works just fine, the problem is with macOS Mojave (10.14.6) where the download will almost always fail with an EOF error(11). Looking into the stacktrace I was able to figure out that the file is actually downloaded as I see the byte count is exactly the same as my file. The weird thing is, on a clean macOS Mojave install, when I run the code for the first time, it will download the file and after that it will always fail no matter what file I try to get.
To Reproduce Steps to reproduce the behavior:
- Create an S3 client in useast1
- Use the following code to get an object from a bucket (my bucket was public, but that doesnt seem to affect this behavior)
let getObjectRequest = S3.GetObjectRequest(bucket: "bucket-name", key: "filename")
let req = s3.getObject(getObjectRequest)
req.whenFailure({ error in
print(error)
})
req.whenSuccess({ response in
if response.body != nil {
print("Hey, we got a body here!")
} else {
print("Failed to download template document.")
}
})
- Add a Swift Error breakpoint.
- Run the code, if the first time succeeds, try to download the file one more time, or try to download a different file.
- The code should stop at line 375 in HTTPDecoder.swift where it throws the EOF error.
Expected behavior The expected behavior is that the getObject request should always succeed like it does in macOS Catalina 10.15.3
Setup (please complete the following information):
- OS: macOS Mojave 10.14.6
- Version of aws-sdk-swift 4.1.1
- Authentication mechanism: hard-coded credentials
- Xcode 11.3.1
Additional context I’m not sure about this bug, looking at the stracktrace is seems to be a Swift NIO issue rather than an AWS-SDK-Swift bug.
Additional context 2 I want to say a big Thank You to the authors of this awesome framework for their amazing work!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 26 (15 by maintainers)
@andyzaharia as an aside I have defaulted Mojave to use MultithreadedEventLoopGroup instead of NIOTSEventloopGroup here https://github.com/swift-aws/aws-sdk-swift-core/commit/b15c12e1946fe4837038c777d518577c54095abe
@andyzaharia thanks I think that is enough for us to go on. This is obviously as aws-sdk-swift issue not NIO. Not sure what yet though. I’m guessing the lack of region in the URL will be it