Skip to content

Using SotoS3FileTransfer copy from occasional HTTP disconnects? #50

@vade

Description

@vade

Hello

We are using the latest swift SPM version of SOTO / SotoS3 and are having an occasional HTTP disconnect when using the sync from local folder to destination S3.

The error:

Got Error: uploadFailed(HTTPClientError.remoteConnectionClosed, SotoS3FileTransfer.S3FileTransferManager.UploadOperation(transfers: [(from: SotoS3FileTransfer.S3FileTransferManager.FileDescriptor(name: "/var/folders/4k/1wv3k9bj65q4_64fnw814n480000gn/T/job-55d334b4-05c2-4c70-bdee-48432fc32502/2025-03-18:20-14-04.jpg", modificationDate: 2025-03-18 20:14:06 +0000, size: 52143), to: s3://ozu-development-application-asset-bucket/users/0194be2c-47dc-7c93-b27b-48797cb81215/jobs/55d334b4-05c2-4c70-bdee-48432fc325022025-03-18:20-14-04.jpg)]))
HTTP connection closed on the s3 side

The code:

    private func uploadExportToS3() async throws
    {
        guard
            let destS3Folder = S3Folder(url: "s3://\(self.jobData.destS3Bucket)/\(self.jobData.destS3Key)"),
            let parentS3Folder = destS3Folder.parent()
        else
        {
            throw RenderError.invalidS3Destination
        }
        
        
        try await self.s3FileTransfer.sync(from: self.tempJobFolder().path(percentEncoded: false),
                                           to:parentS3Folder, delete: true)
    }

This error occurs VERY seldomly, but weve yet to find a cause.

My understanding is SOTO has retry 'built in' - do I need to be cautious and roll my own retry by catching and re-trying here?

Thanks for SOTO! Its made a lot of complicated stuff way less compliated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions