Jump to content

_UsageUpdate broken


Recommended Posts

Hi:

 

Since last upgrade 5.8.3(can't confirm if it was working in 5.3.6) i'm unable to query the database from the _UsageUpdate method on cronjob. I'm able to query the db with same code in the other methods(create,suspend,etc) but not with _UsageUpdate broken. This example code should return a list of services but returns NULL:

 

   $serverid = $params['serverid'];
   $serverPackId = $params['serveraccesshash'];
   $sql = "SELECT * FROM  tblhosting";
   $query = mysql_query( $sql );
   $row = mysql_fetch_assoc( $query );
var_dump($sql,$query,$row);die();


Result:

string(41) "SELECT * FROM  tblhosting"
bool(false)
NULL

 

I opened a support ticket but they told me that since the update stats in the cpanel addon works in their side it was not a bug but it's quite strange for me. Anyone else having same problem?

Link to comment
Share on other sites

this is my php version if that help:

 

PHP 5.4.4-14+deb7u12 (cli) (built: Jun 30 2014 13:15:11)

Copyright © 1997-2012 The PHP Group

Zend Engine v2.4.0, Copyright © 1998-2012 Zend Technologies

with the ionCube PHP Loader v4.2.2, Copyright © 2002-2012, by ionCube Ltd., and

with Xdebug v2.2.1, Copyright © 2002-2012, by Derick Rethans

Link to comment
Share on other sites

Hello,

 

When mysql_query() returns FASLE, you can get the actual error that happened from mysql_error(). Can you post what the exact error message you are getting from that is, it will help me track down the error you are having.

 

Nate

Link to comment
Share on other sites

It's a vanilla whmcs install just for development purposes

 

php -q admin/cron.php
Starting
Running Pre-Cron Hooks
Starting Updating Currency Exchange Rates
- Updated AUD Exchange Rate to 1.07006
- Updated EUR Exchange Rate to 0.73899
- Update Failed for MX Exchange Rate
- Updated MXN Exchange Rate to 12.94554
- Done
Starting Generating Invoices
Invoicing Loop Domain ID 13 - 1 of 6
Invoicing Loop Domain ID 14 - 2 of 6
Invoicing Loop Domain ID 17 - 3 of 6
Invoicing Loop Domain ID 15 - 4 of 6
Invoicing Loop Domain ID 16 - 5 of 6
Invoicing Loop Domain ID 18 - 6 of 6
- 0 Invoices Created
Starting Applying Late Fees
- Late Invoice Fees added to 0 Invoices
Starting Processing Credit Card Charges
Processing Capture for Invoice #132
Capture Failed
Processing Capture for Invoice #131
Capture Failed
- Credit Card Payments Processed (0 Captured, 2 Failed)
Starting Processing Invoice Reminder Notices
- Sent 0 Unpaid Invoice Payment Reminders
- Sent 0 Reminders
Starting Processing Domain Renewal Notices
- Sent 0 Notices
Starting Processing Cancellation Requests
- Processed 0 Cancellations
Starting Processing Overdue Suspensions
- Processed 0 Suspensions
Starting Performing Automated Fixed Term Service Terminations
- Processed 0 Terminations
Starting Auto Closing Inactive Tickets
Starting Processing Email Marketer Rules
Starting Updating Disk & Bandwidth Usage Stats

string(41) "SELECT * FROM  tblhosting"
bool(false)
NULL
string(26) "MySQL server has gone away"

 

I had no issues with my mysql server, no error logs, no firewall and the rest of the cronjob runs perfectly. The production whmcs also runs in same machine with no issues. Also used the php-cgi php.ini with the php-cli just in case it was a php.ini issue but same result.

Edited by Nathanael
Link to comment
Share on other sites

Hello Nathanael,

 

Thanks for sharing your fix with the community.

 

Please keep in mind that this solution has not been tested or approved by WHMCS. Please test this solution before implementing it in a live environment.

 

--Thanks

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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