Zen Cart Logo
Forums / General Questions / Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

Views: 1,301

Results 1 to 11 of 11
13 Jun 2019, 4:34 PM
#1
patrioticflags avatar

patrioticflags

New Zenner

Join Date:
Oct 2012
Posts:
65
Plugin Contributions:
0

Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

I was getting e-mails from my CPanel clamoring for me to upgrade MySQL. So I upgraded to MariaDB 10.3

Now, whenever anyone places an order, it charges their credit card, but it gives them "WARNING: An Error occurred, please refresh the page and try again." Zen-Cart does not record the order.

I have restarted the MySQL server, rebooted the whole server, optimized all the tables. CPanel will not let me downgrade the MySQL database.

How do I see the actual error messages?

I am using Zen-Cart 1.5.5a

Thanks for your help.

[Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]

13 Jun 2019, 4:48 PM
#3
patrioticflags avatar

patrioticflags

New Zenner

Join Date:
Oct 2012
Posts:
65
Plugin Contributions:
0

Re: Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

mc12345678:

For that specific message, see: https://www.zen-cart.com/content.php?311-warning-an-error-occurred-please-refresh-the-page-and-try-again

I figured out why I couldn't find the errors. I didn't have a logs folder and it doesn't create one on its own. I made a logs folder and it generated a huge message. It says trigger error and "PHP Fatal error: 1366: Incorrect integer value:" in Authorize.aim module

[13-Jun-2019 12:41:06 America/New_York] Request URI: /index.php?main_page=checkout_process, IP address: 76.73.213.28
#1 trigger_error() called at [/home/patriot/public_html/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/home/patriot/public_html/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/home/patriot/public_html/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/home/patriot/public_html/includes/modules/payment/authorizenet_aim.php:753]
#5 authorizenet_aim->_debugActions() called at [/home/patriot/public_html/includes/modules/payment/authorizenet_aim.php:440]
#6 authorizenet_aim->before_process() called at [/home/patriot/public_html/includes/classes/payment.php:245]
#7 payment->before_process() called at [/home/patriot/public_html/includes/modules/checkout_process.php:83]
#8 require(/home/patriot/public_html/includes/modules/checkout_process.php) called at [/home/patriot/public_html/includes/modules/pages/checkout_process/header_php.php:14]
#9 require(/home/patriot/public_html/includes/modules/pages/checkout_process/header_php.php) called at [/home/patriot/public_html/index.php:36]

[13-Jun-2019 12:41:06 America/New_York] PHP Fatal error: 1366:Incorrect integer value: '' for column patriot_copy.authorizenet.transaction_id at row 1 :: insert into authorizenet (id, customer_id, order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) values (NULL, 11969, 14884, 1, 'This transaction has been approved.', 'auth_capture', '', 'Array\n(\n [x_login] => *******\n [x_tran_key] => *******\n [x_relay_response] => FALSE\n [x_delim_data] => TRUE\n [x_delim_char] => |\n [x_encap_char] => *\n [x_version] => 3.1\n [x_solution_id] => A1000003\n [x_method] => CC\n [x_amount] => 10.11\n [x_currency_code] => USD\n [x_market_type] => 0\n [x_card_num] => XXXXXXXXXXXXXXXX3419\n [x_exp_date] => ****\n [x_card_code] => ****\n [x_email_customer] => FALSE\n [x_email_merchant] => TRUE\n [x_cust_id] => 11969\n [x_invoice_num] => 14884-crIYTq\n

[HashMatchStatus] => PASS\n)\n', 'June 13, 2019, 12:41 pm', 'b1c9a81eb31dbd21f8bf0cfcc63cf5a3' ) ==> (as called by) /home/patriot/public_html/includes/modules/payment/authorizenet_aim.php on line 753 <== in /home/patriot/public_html/includes/classes/db/mysql/query_factory.php on line 167

13 Jun 2019, 5:06 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

Unfortunately the query provided there is written in an "older" format expecting the NULL to resolve to the next incremental number.

Would suggest at least for this to change line 738 of includes/modules/payment/authorizenet_aim.php
From:

$sql = "insert into " . TABLE_AUTHORIZENET . "  (id, customer_id, order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) values (NULL, :custID, :orderID, :respCode, :respText, :authType, :transID, :sentData, :recvData, :orderTime, :sessID )";

To:

$sql = "insert into " . TABLE_AUTHORIZENET . "  (customer_id, order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) values (:custID, :orderID, :respCode, :respText, :authType, :transID, :sentData, :recvData, :orderTime, :sessID )";

By deleting "id, " and "NULL, " at the beginning of each of those parentheses.

Looking at the code for this area even in ZC 1.5.6b, the query has not been changed. I'm not entirely sure why not and haven't yet gone back to review the server software applicability as to why this is being reported now and hasn't been reported as something needing to be fixed. :/

There may be other similar insert queries formatted that way... I know years ago I had problems with similar queries where some servers accepted NULL while others required 0. I found by not forcing one or the other that the autonumbering worked on its own and such issues no longer occurred.

13 Jun 2019, 5:21 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

patrioticflags:

I figured out why I couldn't find the errors. I didn't have a logs folder and it doesn't create one on its own. I made a logs folder and it generated a huge message.
OK, great that made it possible to see the error by creating the directory, but should also ask oneself, why was the directory missing? When creating it, were the appropriate other actions taken to secure the folder and it's contents? (ie. Files from a default install copied over to it such as .htaccess and associated index file?)

13 Jun 2019, 5:22 PM
#6
patrioticflags avatar

patrioticflags

New Zenner

Join Date:
Oct 2012
Posts:
65
Plugin Contributions:
0

Re: Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

Thanks for your help. It eliminated the null value, but unfortunately I still get the error.

[13-Jun-2019 13:17:30 America/New_York] Request URI: /index.php?main_page=checkout_process, IP address: 76.73.213.28
#1 trigger_error() called at [/home/patriot/public_html/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/home/patriot/public_html/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/home/patriot/public_html/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/home/patriot/public_html/includes/modules/payment/authorizenet_aim.php:754]
#5 authorizenet_aim->_debugActions() called at [/home/patriot/public_html/includes/modules/payment/authorizenet_aim.php:440]
#6 authorizenet_aim->before_process() called at [/home/patriot/public_html/includes/classes/payment.php:245]
#7 payment->before_process() called at [/home/patriot/public_html/includes/modules/checkout_process.php:83]
#8 require(/home/patriot/public_html/includes/modules/checkout_process.php) called at [/home/patriot/public_html/includes/modules/pages/checkout_process/header_php.php:14]
#9 require(/home/patriot/public_html/includes/modules/pages/checkout_process/header_php.php) called at [/home/patriot/public_html/index.php:36]

[13-Jun-2019 13:17:30 America/New_York] PHP Fatal error: 1366:Incorrect integer value: '' for column patriot_copy.authorizenet.transaction_id at row 1 :: insert into authorizenet (customer_id, order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) values (11969, 14884, 1, 'This transaction has been approved.', 'auth_capture', '', 'Array\n(\n [x_login] => *******\n [x_tran_key] => *******\n [x_relay_response] => FALSE\n [x_delim_data] => TRUE\n [x_delim_char] => |\n [x_encap_char] => *\n [x_version] => 3.1\n [x_solution_id] => A1000003\n [x_method] => CC\n [x_amount] => 10.11\n [x_currency_code] => USD\n [x_market_type] => 0\n

13 Jun 2019, 5:34 PM
#7
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

Yeah, I got focused on the wrong thing with the query correction.

In later versions of 1.5.5, there is this modification that addresses that issue:

      if (trim($this->transaction_id) != '') {
        $sql = $db->bindVars($sql, ':transID', substr($this->transaction_id, 0, strpos($this->transaction_id, ' ')), 'string');
      } else {
        $sql = $db->bindVars($sql, ':transID', 'NULL', 'passthru');
      }

So that if the transaction_id is empty then NULL is used to fill that value.

There may be other corrections in later sub-versions of 1.5.5 that may need to be applied. (don't need to apply each subversion one at a time, could just go to 1.5.5f or 1.5.6b)

13 Jun 2019, 5:44 PM
#8
patrioticflags avatar

patrioticflags

New Zenner

Join Date:
Oct 2012
Posts:
65
Plugin Contributions:
0

Re: Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

Where do I insert this code?

So, should I revert line 738 of includes/modules/payment/authorizenet_aim.php back to the original?

Also, I know why the logs folder was missing. At some point, I deleted the whole folder to get rid of old error messages. At the time I thought a new folder would automatically be created when the next error message was created.

mc12345678:

Yeah, I got focused on the wrong thing with the query correction.

In later versions of 1.5.5, there is this modification that addresses that issue:

  if (trim($this->transaction_id) != '') {
    $sql = $db->bindVars($sql, ':transID', substr($this->transaction_id, 0, strpos($this->transaction_id, ' ')), 'string');
  } else {
    $sql = $db->bindVars($sql, ':transID', 'NULL', 'passthru');
  }
> 
> So that if the transaction_id is empty then NULL is used to fill that value.
> 
> There may be other corrections in later sub-versions of 1.5.5 that may need to be applied. (don't need to apply each subversion one at a time, could just go to 1.5.5f or 1.5.6b)
13 Jun 2019, 5:56 PM
#9
patrioticflags avatar

patrioticflags

New Zenner

Join Date:
Oct 2012
Posts:
65
Plugin Contributions:
0

Re: Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

This line of code appears to already be present in 1.5.5a. Line 744.

mc12345678:

Yeah, I got focused on the wrong thing with the query correction.

In later versions of 1.5.5, there is this modification that addresses that issue:

  if (trim($this->transaction_id) != '') {
    $sql = $db->bindVars($sql, ':transID', substr($this->transaction_id, 0, strpos($this->transaction_id, ' ')), 'string');
  } else {
    $sql = $db->bindVars($sql, ':transID', 'NULL', 'passthru');
  }
> 
> So that if the transaction_id is empty then NULL is used to fill that value.
> 
> There may be other corrections in later sub-versions of 1.5.5 that may need to be applied. (don't need to apply each subversion one at a time, could just go to 1.5.5f or 1.5.6b)
13 Jun 2019, 6:08 PM
#10
patrioticflags avatar

patrioticflags

New Zenner

Join Date:
Oct 2012
Posts:
65
Plugin Contributions:
0

Re: Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

The only way I have gotten it to work successfully (at least in authorize.net test mode) is to completely remove the variable transaction id.

I receive a successful confirmation, a confirmation e-mail, and the order is added to MySQL and shows up in my admin panel.

$sql = "insert into " . TABLE_AUTHORIZENET . " (id, customer_id, order_id, response_code, response_text, authorization_type, sent, received, time, session_id) values (NULL, :custID, :orderID, :respCode, :respText, :authType, :sentData, :recvData, :orderTime, :sessID )";

13 Jun 2019, 6:20 PM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Error after upgrading to MSQL to MariaDB 10.3, how do I see error messages

Supposedly lines 744-748 would be replaced.

The original content though was:

      if (trim($this->transaction_id) != '') {
        $sql = $db->bindVars($sql, ':transID', substr($this->transaction_id, 0, strpos($this->transaction_id, ' ')), 'string');
      } else {
        $sql = $db->bindVars($sql, ':transID', 'NULL', 'passthru');
      }

There may still be other things to be updated if you look at the upgrade path or file for ZC 1.5.5f. For some reason I thought there was still something modified in that file to further support the range of environment expected for the 1.5.5 series.

But, I'm drawing a blank at the moment, sorry.