Jump to content

Cron job Tenant Usage Metrics error with Directadmin


tpark

Recommended Posts

Hello everyone!

After Updating my WHMCS to 7.10.2 , I've got this error in cron jobs (php -q cron.php -F all -vvv):

[ERROR] Exception: Unable to get stats: You cannot execute that command in
         /home/user/domains/domain.com/public_html/members/modules/servers/directadmin/directadmin.php:0
         Stack trace:
         #0 /home/user/domains/domain.com/public_html/members/modules/servers/directadmin/directadmin.php(0): directadmin_GetStats(Array)
         #1 /home/user/domains/domain.com/public_html/members/vendor/whmcs/whmcs-foundation/lib/UsageBilling/Metrics/Providers/CallbackUsage.php(0): {closure}(Object(WHMCS\UsageBilling\Metrics\Providers\CallbackUsage))
         #2 /home/user/domains/domain.com/public_html/members/vendor/whmcs/whmcs-foundation/lib/Product/Server.php(0): WHMCS\UsageBilling\Metrics\Providers\CallbackUsage->usage()
         #3 /home/user/domains/domain.com/public_html/members/vendor/whmcs/whmcs-foundation/lib/Cron/Task/TenantUsageMetrics.php(0): WHMCS\Product\Server->syncAllUsage()
         #4 /home/user/domains/domain.com/public_html/members/vendor/whmcs/whmcs-foundation/lib/Scheduling/Task/AbstractTask.php(0): WHMCS\Cron\Task\TenantUsageMetrics->__invoke()
         #5 /home/user/domains/domain.com/public_html/members/vendor/whmcs/whmcs-foundation/lib/Scheduling/Task/AbstractTask.php(0): WHMCS\Scheduling\Task\AbstractTask->execute()
         #6 /home/user/domains/domain.com/public_html/members/vendor/whmcs/whmcs-foundation/lib/Cron/Console/Command/AbstractCronCommand.php(0): WHMCS\Scheduling\Task\AbstractTask->run()
         #7 /home/user/domains/domain.com/public_html/members/vendor/whmcs/whmcs-foundation/lib/Cron/Console/Command/AbstractCronCommand.php(0): WHMCS\Cron\Console\Command\AbstractCronCommand->executeCollection(Object(WHMCS\Scheduling\Task\Collection))
         #8 /home/user/domains/domain.com/public_html/members/vendor/symfony/console/Command/Command.php(259): WHMCS\Cron\Console\Command\AbstractCronCommand->execute(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
         #9 /home/user/domains/domain.com/public_html/members/vendor/symfony/console/Application.php(844): Symfony\Component\Console\Command\Command->run(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
         #10 /home/user/domains/domain.com/public_html/members/vendor/symfony/console/Application.php(192): Symfony\Component\Console\Application->doRunCommand(Object(WHMCS\Cron\Console\Command\DoCommand), Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
         #11 /home/user/domains/domain.com/public_html/members/vendor/symfony/console/Application.php(123): Symfony\Component\Console\Application->doRun(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
         #12 /home/user/domains/WHMCS/crons/cron.php(0): Symfony\Component\Console\Application->run(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
         #13 {main}

is this error related to Permissons or Owner Group?

Permissions are 777 for cron files&folder and 755 for modules & vendor folders(644 for whmcs files).

User and group is user:user 

how can i fix this?

any help whould be greatly appreciated

Regards

Edited by tpark
Link to comment
Share on other sites

  • 3 months later...
  • WHMCS Support Manager

Hi @tpark.

The error message "You cannot execute that command" is being returned by DirectAdmin.

Details "The request you've made cannot be executed because it does not exist in your authority level."

Please ensure the DirectAdmin user entered into the WHMCS server configuration page (Setup > Products/Services > Servers > Edit), has permission to execute the `CMD_API_SHOW_USER_USAGE` and `CMD_API_RESELLER_STATS` API commands on your server.

DirectAdmin support will be able to assist in configuring the appropriate permissions on your server to facilitate this.
Once appropriate permissions have been granted to the user, WHMCS will be able to collect metric statistics for hosting accounts.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated