• 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

Cron Jobs

Mortgage

Chevereto Member
Hi,

Trying to fix Crons from my other thread. Running Cron Job command and I get an error in the error_log.

Is this Chevereto side or server?

Cron Job Tried/Tested:
Code:
/usr/local/bin/php /public_html/cli.php -C cron
Code:
/usr/local/bin/alt-php74 /public_html/cli.php -C cron

Code:
[15-Nov-2021 20:45:04 Europe/London]
Aw, snap! Internal Server Error [debug @ print,error_log] - https://chv.to/v3debug

** errorId # **
>> PDOException [42000]: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
At /public_html/lib/G/classes/class.db.php:155

Stack trace:
#0 /public_html/lib/G/classes/class.db.php(155): PDOStatement->execute()
#1 /public_html/app/lib/classes/class.queue.php(223): G\DB->exec()
#2 /public_html/app/lib/classes/class.queue.php(195): CHV\Queue::logAttempt(Array)
#3 /public_html/app/cron.php(50): CHV\Queue::process(Array)
#4 /public_html/app/cron.php(32): storageDelete()
#5 /public_html/app/loader.php(233): require_once('/public_html/app/cron.php')
#6 /public_html/cli.php(36): include_once('/public_html/app/loader.php')

This only broke after updating (fresh install) to v3.20.14.

Apologies I didn't reply never got a notification of your response until today's email informing ticket closed. I'll be purchasing extra support for the CDN shortly.
 
Last edited by a moderator:
Hi,

This is Chevereto related, this is the function causing issues:

PHP:
    public static function logAttempt($ids)
    {
        if (!is_array($ids)) {
            $ids = [$ids];
        }
        $db = DB::getInstance();
        $db->query('UPDATE ' . DB::getTable('queues') . ' SET queue_attempts = queue_attempts + 1, queue_status = IF(queue_attempts > 3, "failed", "pending") WHERE queue_id IN (' . implode(',', $ids) . ')');
        $db->exec();
    }

Chances are that $ids is [] so the WHERE clause ends like WHERE queue_id IN ().

1. Open this file app/lib/classes/class.queue.php

2. Change this:

PHP:
        if (!is_array($ids)) {
            $ids = [$ids];
        }

To this:

PHP:
        if (!is_array($ids)) {
            $ids = [$ids];
        }
        if($ids === []) {
            return;
        }

Does it fix the issue?
 
To this:

PHP:
        if (!is_array($ids)) {
            $ids = [$ids];
        }
        if($ids === []) {
            return;
        }

Does it fix the issue?
Hi @Rodolfo,

Yes, I can confirm that fixed the issue. Cron last ran 2021-11-19 16:03:03 UTC.

Although the cron is now running for the first time ever, queues table is still full. Think this is going to require extra support package.

I've some other stuff in error_log, should I share that here or new thread?
 
Okay, so emptying the queues table via:

SQL:
TRUNCATE TABLE queues;

This then allows deleting to work without issues and cron is also removing from BunnyCDN.

Is this okay? As I'm assuming all the other queues are just dead and sitting due to been manually deleted over the yrs so it's getting suck.

This also seems to cause local disk used stats to be negative (-32118297 B) value.

1637702586407.png
 
Last edited:
Back
Top