Some messages failed to bill

Some messages I sent are not getting billed due to:
rate deduct failed due to unable to save to db

Why this may happened?

Hi,

Prior to that statement, search for “credit_hook_rate_setusercredit”, let me know the complete sentence when you found it

anton

Thank you for your reply @anton

in the log perior that I found:
L2 credit_hook_rate_setusercredit # unable to save uid:1 balance:323.5

Hi,

can you check this file, this block, is it the same as in your server:

anton

Yes Here is it:

  $db_query = "UPDATE " . _DB_PREF_ . "_tblUser SET c_timestamp='" . mktime() . "',credit='$balance' WHERE flag_deleted='0' AND uid='$uid'";
  if ($db_result = @dba_affected_rows($db_query)) {
  	_log("saved uid:" . $uid . " balance:" . $balance, 2, "credit_hook_rate_setusercredit");
  	return TRUE;
  } else {
  	_log("unable to save uid:" . $uid . " balance:" . $balance, 2, "credit_hook_rate_setusercredit");
  	return FALSE;
  }

Then the update query was failing, I think its because the mktime() producing the same amount and possibly the credit ($balance) is the same

Why mktime() is the same, and why credit ($balance) were not updated, I have no idea.

Is this issue persistent ? I mean everytime you send SMS you always see this log, or it happened only when sending large volume of SMS

anton

It just when sending large volumes.