• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • This community is user driven. Be polite with other users.
    • We recommend purchasing a Chevereto license to participate in this community.
    • Purchase a Community Subscription to get even faster ticket response times.
  • 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