Upload to S3 started before the file is closed

Issue #4 on hold
Jiří Žaloudek created an issue

I tried to upload a large file (about 300M) and the S3 upload failed with following error:

2017-07-18 16:57:27 - Moving file /home/myuser/home/myuser/uploads/test.zip.filepart to s3...
2017-07-18 16:57:27 - Failed to move file /home/myuser/home/myuser/uploads/test.zip.filepart to s3

The upload started before the zip file was completely closed, it has .filepart extension.

Comments (5)

  1. Jeff Thorn

    The .filepart extension is something that is added by WinSCP and is known to interfere with the proper execution of the SFTP Gateway. https://winscp.net/eng/docs/message_transfer_finished_could_not_rename

    As a work around, please disable this feature in WinSCP as described here - https://winscp.net/eng/docs/ui_pref_resume

    For large files, we have a custom feature that will verify MD5 checksums. This will be available in a few weeks in a new release of the SFTP Gateway. Upgrading is very easy and we will notify you when it is available.

  2. Greg Roberts

    Would really appreciate this being looked into. Am using this for getting data from a vendor and WinSCP is their only choice.

    Since our use case is very simple (1 user uploading 1 file per day, same format each time), I've come up with a workaround for this for now:

    shopt -s nullglob
    for file in  /home/<user name>/home/<user name>/uploads/*
    do
            sudo bash /usr/local/bin/movetos3.sh /home/<user name>/home/<user name>/uploads "$(basename -- $file)" IN_CLOSE_WRITE
    done
    shopt -u nullglob
    

    which cycles through all the files in a given dir and just uploads them manually. Add execution of this to root's crontab to be run once per hour.

    Hopefully sorts it out for now, but would be great to have a proper fix!

  3. Log in to comment