• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Concurrency: Target uploaded file already exists, aborting operation

twm

Chevereto Member
Same bug in new version (3.14.1)


G9ipND.png

G9iSAO.png
 
This is the relevant code:

[CODE lang="php" title="app/lib/classes/class.upload.php" highlight="24"] /*
* Set uploaded_file
* Local storage uploads will be allocated at the target destination
* External storage will be allocated to the temp directory
*/
if ($this->storage_id) {
$this->uploaded_file = G\forward_slash(dirname($this->downstream)) . '/' . Storage::getStorageValidFilename($this->fixed_filename, $this->storage_id, $this->options['filenaming'], $this->destination);
} else {
$this->uploaded_file = G\name_unique_file($this->destination, $this->options['filenaming'], $this->fixed_filename);
}

$this->source = [
'filename' => $this->source_filename, // file.ext
'name' => $this->source_name, // file
'image_exif' => $this->source_image_exif, // exif-data array
'fileinfo' => G\get_image_fileinfo($this->downstream), // fileinfo array
];

// 666 because concurrency is evil
if (stream_resolve_include_path($this->downstream) == false) {
throw new UploadException('Concurrency: Downstream gone, aborting operation', 666);
}
if (stream_resolve_include_path($this->uploaded_file) != false) {
throw new UploadException('Concurrency: Target uploaded file already exists, aborting operation', 666);
}[/CODE]

The only way to trigger concurrency is if an operation (op#2) happens to sneak between lines 12-23 (while doing op#1). This could be happening because there's too much concurrent uploading in your website. You should decrease the number of simultaneous uploads as your machine can't keep the frequency of the upload requests being made.

Other factors could be also triggering this issue, like using IDs for filenames. If you use random or mixed it should significantly decrease the chances for concurrency issues.

dashboard/settings/image-upload

1585237719087.png
 
  • Like
Reactions: twm
Back
Top