The-Network-Crew / Proxmox-VE-for-WHMCS

Proxmox VM/CT Module for the WHMCS Automation & Billing System.
https://marketplace.whmcs.com/product/6935-proxmox-ve-for-whmcs#reviews
GNU General Public License v3.0
161 stars 52 forks source link

Cron, Server Usage: Syntax error (return true ;) during scheduled tasks #40

Closed lsthompson closed 1 year ago

lsthompson commented 1 year ago

Error: ParseError: syntax error, unexpected token ";" in /home/username/public_html/modules/servers/pvewhmcs/pvewhmcs.php:759

Was caused by missing bracket in VNC Secret check - #27

Stack trace:

#0 /home/username/public_html/vendor/whmcs/whmcs-foundation/lib/Cron/Task/ServerUsageCount.php(0): WHMCS\Module\AbstractModule->load('pvewhmcs')
#1 [internal function]: WHMCS\Cron\Task\ServerUsageCount->__invoke()
#2 /home/username/public_html/vendor/whmcs/whmcs-foundation/lib/Scheduling/Task/AbstractTask.php(0): call_user_func_array(Object(WHMCS\Cron\Task\ServerUsageCount), Array)
#3 /home/username/public_html/vendor/whmcs/whmcs-foundation/lib/Scheduling/Task/AbstractTask.php(0): WHMCS\Scheduling\Task\AbstractTask->execute()
#4 /home/username/public_html/vendor/whmcs/whmcs-foundation/lib/Cron/Console/Command/AbstractCronCommand.php(0): WHMCS\Scheduling\Task\AbstractTask->run()
#5 /home/username/public_html/vendor/whmcs/whmcs-foundation/lib/Cron/Console/Command/AbstractCronCommand.php(0): WHMCS\Cron\Console\Command\AbstractCronCommand->executeCollection(Object(WHMCS\Scheduling\Task\Collection))
#6 /home/username/public_html/vendor/symfony/console/Command/Command.php(298): WHMCS\Cron\Console\Command\AbstractCronCommand->execute(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /home/username/public_html/vendor/symfony/console/Application.php(1028): Symfony\Component\Console\Command\Command->run(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /home/username/public_html/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand(Object(WHMCS\Cron\Console\Command\AllCommand), Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /home/username/public_html/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /home/username/public_html/crons/cron.php(0): Symfony\Component\Console\Application->run(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 {main}

Offending lines, with space removed post-true:

// OUTPUT: VM Statistics/Graphs render to Client Area
function pvewhmcs_vmStat($params) {
    return true;
}

May need to opt-out of WHMCS firing X functions during cron jobs?

https://developers.whmcs.com/provisioning-modules/usage-update/ https://developers.whmcs.com/provisioning-modules/usage-metrics/