Source code upload fails after an interrupted upload

Why an immediate retry of a source code upload returns a 422 fileUploadError after an interrupted upload, and how to resolve it

Overview

If a source code upload is interrupted before it completes - for example you refresh the browser, close the tab, or lose network connectivity - an immediate retry of the same file fails. This page explains why this happens and how to resolve it. It applies to uploads started from both the landing page Run a new scan option and the Overview New scan button.

Symptom

You upload a source code archive, the upload is interrupted, and you start the upload again. The second attempt fails and the analysis node returns a 422 Unprocessable Entity response:

{
    "code": "fileUploadError",
    "defaultMessage": "File with name 'shopizer-2.2.0.zip' already exists and is currently being processed"
}

Cause

This behavior is expected. CAST Imaging tracks activity for each upload session, keyed by the application and the file name. When the browser or the network connection is interrupted without the client explicitly cancelling the upload, the analysis node receives no signal that the session has ended, so the session remains open and continues to hold the file name.

To avoid blocking you indefinitely, the analysis node treats an in-progress upload as abandoned when no data has been received for it for 30 seconds. Once that period has elapsed, a new upload of the same file reclaims the session and succeeds.

Resolution

Wait 30 seconds and then upload the file again.