• 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.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and 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

How to fix "Can't get target upload source info" during bulk import?

user_81b0c

Chevereto Member
Hi All,

I have copied a bunch of directories containing jpg files into the ./importing/parse-albums/ directory like:

./importing/parse-albums/2021/01/image.jpg (lots of them)
./importing/parse-albums/2021/02/image.jpg (lots of them)
...and so on

I then chmod -R to www-data:www-data so they are all owned correctly.

Then I run sudo -u www-data php /var/www/html/cli.php -C importing

The problem is that it creates the directories, but says throws the subject error for each image and therefore does not imort. I end up with just a bunch of empty albums.

I looked at the class.upload.php file on line 138 and I see where the private function is called, but my PHP is not good enough to see what it does.

Here is one such error from the logs.

Can anyone help me understand what is wrong?
Code:
1637940740 - [Thread #0] --------------------------------------------------------------------------------
1637940740 - [Thread #0] Current iteration: /var/www/html/importing/parse-albums/2021/05/Bike 2021/20210515_151828.jpg
1637940740 - [Thread #0] About to get DB importing lock for /var/www/html/importing/parse-albums/2021/05/Bike 2021/20210515_151828.jpg
1637940740 - [Thread #0] Component is: 2021/05/Bike 2021/20210515_151828.jpg
1637940740 - [Thread #0] About to parse component for 2021/05/Bike 2021/20210515_151828.jpg (root: albums)
1637940740 - [Thread #0] Parse has been set to: image
1637940740 - [Thread #0] Previous working directory is: /var/www/html/importing/parse-albums/2021/05/Bike 2021
1637940740 - [Thread #0] Current working directory is: /var/www/html/importing/parse-albums/2021/05/Bike 2021
1637940740 - [Thread #0] Path handle is: /var/www/html/importing/parse-albums/2021/05/Bike 2021
1637940740 - [Thread #0] About to get DB importing lock for /var/www/html/importing/parse-albums/2021/05/Bike 2021
1637940740 - [Thread #0] Path handle /var/www/html/importing/parse-albums/2021/05/Bike 2021 is already locked in DB
1637940740 - [Thread #0] Content ID (album): 3 (taken from DB lock)
1637940740 - [Thread #0] About to parse image: /var/www/html/importing/parse-albums/2021/05/Bike 2021/20210515_151828.jpg
1637940740 - [Thread #0] Using DB lock for content context data (id and type)
1637940740 - [Thread #0] Failed to insert image, exception thrown: Can't get target upload source info
1637940740 - [Thread #0] Image insertion failed for /var/www/html/importing/parse-albums/2021/05/Bike 2021/20210515_151828.jpg
1637940740 - [Thread #0] CHV\UploadException Can't get target upload source info ~ #0 /var/www/html/app/lib/classes/class.upload.php(138): CHV\Upload->validateSourceFile()
#1 /var/www/html/app/lib/classes/class.image.php(504): CHV\Upload->exec()
#2 /var/www/html/app/lib/classes/class.image.php(646): CHV\Image::upload()
#3 /var/www/html/app/lib/classes/class.import.php(690): CHV\Image::uploadToWebsite()
#4 /var/www/html/app/importing.php(42): CHV\Import->process()
#5 /var/www/html/app/loader.php(242): require_once('/var/www/html/a...')
#6 /var/www/html/cli.php(36): include_once('/var/www/html/a...')
#7 {main}
1637940740 - [Thread #0] ! Failed to remove /var/www/html/importing/parse-albums/2021/05/Bike 2021/20210515_151828.jpg from importing path
1637940740 - [Thread #0] ! Failed to remove /var/www/html/importing/parse-albums/2021/05/Bike 2021/20210515_151828.jpg from importing path
1637940740 - [Thread #0] --------------------------------------------------------------------------------
 
Hi,

Perhaps the issue is that the path contains space. Try with a path without spaces to see if the issue persist.
 
Hi

I guess I chose a poor example. Most of the folders are YYYY/MM format, like 2021/01 so there are no spaces. I get the same error when there are no spaces.

Can you elaborate on the type of things that cause that function to determine the path or filename is invalid? Maybe that will create some ideas.

Thank you
 
PHP:
    function get_image_fileinfo($file)
    {
        clearstatcache(true, $file);
        $info = getimagesize($file);
        $filesize = @filesize($file);
        if (!$info || $filesize === false) {
            return false;
        }
        $mime = strtolower($info['mime']);
        $extension = mime_to_extension($mime);
        return array(
            'filename' => basename($file), // image.jpg
            'name' => basename($file, '.' . get_file_extension($file)), // image
            'width' => intval($info[0]),
            'height' => intval($info[1]),
            'ratio' => $info[0] / $info[1],
            'size' => intval($filesize),
            'size_formatted' => format_bytes($filesize),
            'mime' => $mime,
            'extension' => $extension,
            'bits' => $info['bits'],
            'channels' => $info['channels'] ?? '',
            'url' => absolute_to_url($file),
            'md5' => md5_file($file),
        );
    }

Either $info and/or $filesize are returning false. Reasons for getting false there aren't caused by the software, something odd is either on your server setup or your files are corrupted.
 
Back
Top