Closed YoavGro closed 1 year ago
Hi, a couple of questions
Hi
Where are you getting your identityPoolId
from? Any chance this could have expired?
Could you post the code that is doing the upload?
Also if you put a break point here https://github.com/soto-project/soto/blob/eda662e974ab718a1932c3e4f3f0d63d2024b67b/Sources/Soto/Extensions/CognitoIdentity/CognitoIdentity%2BCredentialProvider.swift#L54
do you hit it and then if so what is the contents of response
when you do?
public func uploadRecordingSegment(fileName: String, segmentLocalPath: String) async throws {
let bucket = InjectedValues[\.enviromentService].selectedEnvironment.awsBucket
let request = S3.CreateMultipartUploadRequest(bucket: bucket, key: fileName)
_ = try await self._s3.multipartUpload(request, filename: segmentLocalPath)
}
SotoCore.CredentialProviderError._CredentialProviderError.noProvider
I'm seeing this error, only after we are getting timeouts on multiple parts
Yeah I hit this throw and the error response on my catch is SotoCore.CredentialProviderError._CredentialProviderError.noProvider
By response I meant the contents of the response
variable in the same function that throws the error. It appears AWS is returning an empty response when I ask it for credentials from your identity.
Ohh got it, sorry guess I misunderstood that. Checked it now, and it looks like it is not throwing the error from this line
Hmm not totally sure where that noProvider error is coming from. There is only two places which throw it and given the description of the bug I cannot see how either are reached. Here are some options to play with
AWSClient
you use for every transaction with AWS. This is preferable to creating a new one for every operation, especially if you are using a credential provider that runs network operations like the cognito ones.multipartUpload
should throw a S3ErrorType.multipart.abortedUpload
which can be used in resumeMultipartUpload
to resume a multipart upload. See https://soto.codes/user-guides/s3-multipart-upload.html. Although if you are getting a noProvider
error I imagine you won't be able to use the client as the credential provider attached to it won't work.AWSClient
add your own retryPolicy
. It defaults to using jitter with a maximum number of retries of 4. Maybe you could increase the number of retries so it is in effect infinite. eg
let client = AWSClient(
credentialProvider: credentialProvider,
retryPolicy: .jitter(maxRetries: 100000),
...
)
Closing as I did not get a response
Describe the bug A clear and concise description of what the bug is. If you can include a link to redacted requests or responses, that would be very helpful as well!
To Reproduce Steps to reproduce the behavior:
multipartUpload(
throws an error withCredentialProviderError.noProvider
Expected behavior
Setup (please complete the following information):
Additional context
After app restart uploads continue regularly