Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Critical error processing my request  (Read 19592 times)

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +27/-1
    • View Profile
    • Assistech
Critical error processing my request
« on: June 21, 2016, 11:05:19 PM »
I got a critical error message when testing a new extension. Any leads on how to fix the problem will be greatly appreciated. Here's a summary of the error message:

There has been a critical error processing your request

SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0 store_id = '0', store_name = 'Assistech', store_url = 'https' at line 2
Error No: 1064
SQL: INSERT INTO `ac_orders` SET 0 store_id = '0', store_name = 'Assistech', store_url = 'https://assistech.com/up127/', customer_id = '0', customer_group_id = '1', firstname = 'Oliver', lastname = 'Simoes', email = 'ollie@assistech.com', telephone = '15208838600', fax = '5208838600', total = '187.6167', language_id = '1', currency = 'USD', currency_id = '1', value = '1', coupon_id = '0', ip = '73.24.199.186', shipping_firstname = 'Oliver', shipping_lastname = 'Simoes', shipping_company = '', shipping_address_1 = '1234 Main Street', shipping_address_2 = '', shipping_city = 'Tucson', shipping_postcode = '85721', shipping_zone = 'Arizona', shipping_zone_id = '3616', shipping_country = 'United States', shipping_country_id = '223', shipping_address_format = '{firstname} {lastname}\r\n{company}\r\n{address_1}\r\n{address_2}\r\n{city}, {zone} {postcode}\r\n{country}', shipping_method = 'Priority Mail 1-Day', payment_firstname = 'Oliver', payment_lastname = 'Simoes', payment_company = '', payment_address_1 = '1234 Main Street', payment_address_2 = '', payment_city = 'Tucson', payment_postcode = '85721', payment_zone = 'Arizona', payment_zone_id = '3616', payment_country = 'United States', payment_country_id = '223', payment_address_format = '{firstname} {lastname}\r\n{company}\r\n{address_1}\r\n{address_2}\r\n{city}, {zone} {postcode}\r\n{country}', payment_method = 'Credit Card / Debit Card (Authorize.Net)', comment = '', date_modified = NOW(), date_added = NOW() in /home/assistec/public_html/xx/core/database/amysqli.php on line 106
« Last Edit: June 23, 2016, 08:58:01 AM by Ollie »
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2050
  • Karma: +320/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Critical error processing my request
« Reply #1 on: June 22, 2016, 05:30:37 AM »
what php version do you use?
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +27/-1
    • View Profile
    • Assistech
Re: Critical error processing my request
« Reply #2 on: June 22, 2016, 08:44:57 AM »
what php version do you use?

phpMyAdmin shows Server version: 5.6.29.
« Last Edit: June 22, 2016, 10:00:56 AM by Ollie »
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2050
  • Karma: +320/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Critical error processing my request
« Reply #3 on: June 22, 2016, 10:22:17 AM »
looks like you use 1.2.0 version..
try to replace file storefront/model/checkout/order.php with attached.
this bug was fixed in next versions.
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +27/-1
    • View Profile
    • Assistech
Re: Critical error processing my request
« Reply #4 on: June 22, 2016, 02:50:16 PM »
looks like you use 1.2.0 version..
try to replace file storefront/model/checkout/order.php with attached.
this bug was fixed in next versions.

No, I'm using v 1.2.7 at https://assistech.com/up127/ That's where I installed the extension.
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2050
  • Karma: +320/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +27/-1
    • View Profile
    • Assistech
Re: Critical error processing my request
« Reply #6 on: June 23, 2016, 04:15:18 AM »
for 1.2.7 try this one
https://github.com/abantecart/abantecart-src/blob/96efc4463539397c763d221e1822148a60e8ca02/public_html/storefront/model/checkout/order.php

I replaced the file and it seems to work at the first time I tried. When I tried again, it took a long time to process, then it gave me this error message:

SQL Error: MySQL server has gone away
Error No: 2006
SQL: SELECT e.*, s.value as status FROM ac_extensions e LEFT JOIN ac_settings s ON ( s.`group` = e.`key` AND s.`key` = CONCAT(e.`key`,'_status') ) WHERE e.`type` = 'payment' AND s.`value`='1' AND s.store_id = '0' in
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +27/-1
    • View Profile
    • Assistech
Re: Critical error processing my request
« Reply #7 on: June 23, 2016, 04:54:56 AM »
I restored my shopping cart and database, tried a new order and now I'm getting this error message: SQL Error: MySQL server has gone away
Error No: 2006
SQL: DELETE FROM `ac_online_customers` WHERE `date_added`< (NOW() - INTERVAL 1 HOUR) in /home/assistec/public_html/up127/core/database/amysqli.php on line 106

Why is this happening?
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2050
  • Karma: +320/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Critical error processing my request
« Reply #8 on: June 23, 2016, 05:25:36 AM »
Usually message "SQL Error: MySQL server has gone away" means you have small mysql connection timeout.
Also check table  size of `ac_online_customers`.
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +27/-1
    • View Profile
    • Assistech
Re: Critical error processing my request
« Reply #9 on: June 23, 2016, 08:43:50 AM »
Usually message "SQL Error: MySQL server has gone away" means you have small mysql connection timeout.
Also check table  size of `ac_online_customers`.

As I said, I restored my cart and database, and the error is gone. I'm no longer using the file you recommended. I compared your file with the one from a 1.2.7 installation and I noticed a couple of differences between them (as explained below).

Your file has this addition: $set_order_id = (int)$set_order_id;

And instead of this: $set_order_id = "order_id = '" . $this->db->escape($set_order_id) . "', ";

it has this: $set_order_id = "order_id = '" . (int)$set_order_id . "', ";

I replaced my file with the one from 1.2.7 and that seems to have solved the problem. The order process flows smoothly and the "MySQL server has gone away" error is gone!
« Last Edit: June 29, 2016, 01:24:46 AM by Ollie »
Assistive technologies for people with special needs:
https://assistech.com/store/

 

Powered by SMFPacks Social Login Mod