1 Attachment(s)
Checkout Problems - Database Insert Errors
Site is www.atomicworkshop.co.uk, server running PHP 5.4.45, Database: MySQL 10.5.12-MariaDB-cll-lve. No apparent changes caused either problem...
I have two problems, the first started several months ago and was more of an inconvenience but may be related to the second more serious so I'll detail it too.
Problem 1
Several months ago I noticed that some of the entries in the customer table had the appearance of being corrupt - this only applies to the first and last name fields. Screen shot of zen_orders:
Attachment 19755
I'm not too sure if this affected customers logging in but I had no complaints
Problem 2 (a bit more serious!)
A couple of weeks ago I had an instance whereby I had received payment vi PayPal but no order saved in the store - TBH, this has happened very rarely in the past and I've put it down to a checkout glitch.
Then I had another instance and I asked the customer to place the order again but select "Cheque/Money order" as the payment method, the customer reported the error message "WARNING: An Error occurred, please refresh the page and try again" and no order had been saved.
I then placed a dummy order and received the same error message and at this point extracted the following log file:
Code:
[11-Oct-2021 15:21:23 UTC] PHP Fatal error: 1406:Data too long for column 'shipping_method' at row 1 :: INSERT INTO zen_orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, payment_module_code, shipping_method, shipping_module_code, coupon_code, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, order_total, order_tax, currency, currency_value, ip_address) VALUES ('15', 'Jonathan Crossley', '', '2 Harrisons Farm', '', 'Oby', 'NR29 3BW', 'Norfolk', 'United Kingdom', '01493 369317', '[email protected]', '6', 'Jonathan Crossley', '', '2 Harrisons Farm', '', 'Oby', 'NR29 3BW', 'Norfolk', 'United Kingdom', '6', 'Jonathan Crossley', '', '2 Harrisons Farm', '', 'Oby', 'NR29 3BW', 'Norfolk', 'United Kingdom', '6', 'Cheque/Money Order', 'moneyorder', 'Royal Mail 1<sup>st</sup> Class <span style=\"font-weight: normal; font-style: italic\">"Large Letter"</span> (Great Britain and Northern Ireland only)', 'rm1stlargeletter', '', '', '', '', '', now(), '1', '2.45', '0', 'GBP', '1.00000000', '213.205.240.5 - 213.205.240.5') in /home/tuskerfu/public_html/atomicws/catalog/includes/classes/db/mysql/query_factory.php on line 101
I then decided to clean out the admin activity log (taking a backup of the database first). This had the unfortunate result of then preventing me from logging in to the admin site - took a snapshot of the log after the login attempt:
Code:
[11-Oct-2021 17:14:59 UTC] PHP Fatal error: 1364:Field 'gzpost' doesn't have a default value :: insert into zen_admin_activity_log (access_date, admin_id, page_accessed, page_parameters, ip_address) values (now(), '0', 'Log found to be empty. Logging started.', '', '213.205.240.5') in /home/tuskerfu/public_html/atomicws/catalog/includes/classes/db/mysql/query_factory.php on line 101
Luckily with the database backup re-instated I can at least log in as admin.
Any/all help greatly appreciated.
Thanks, Jonathan
Re: Checkout Problems - Database Insert Errors
#1 is junk accounts being created by bad guys. You can use Delete Spam Customers to clean these up.
With issue #2 the problem is likely that you're running such an old version of Zen Cart. You should really upgrade. PHP 5.4/Zen Cart 1.5.0 is long out of service.
Re: Checkout Problems - Database Insert Errors
Quote:
Originally Posted by
swguy
#1 is junk accounts being created by bad guys. You can use Delete Spam Customers to clean these up.
With issue #2 the problem is likely that you're running such an old version of Zen Cart. You should really upgrade. PHP 5.4/Zen Cart 1.5.0 is long out of service.
while i agree with the above statement, it does seem that your shipping code is made for a newer version of ZC. if you want to solve this problem, you can backup your database and then run the following sql statement (part of the v156 upgrade process):
Code:
ALTER TABLE zen_orders MODIFY shipping_method VARCHAR(255) DEFAULT NULL;
i take no responsibility for any data loss. backup your data prior to doing any sql statements.
best.
Re: Checkout Problems - Database Insert Errors
Quote:
Originally Posted by
carlwhat
while i agree with the above statement, it does seem that your shipping code is made for a newer version of ZC. if you want to solve this problem, you can backup your database and then run the following sql statement (part of the v156 upgrade process):
Code:
ALTER TABLE zen_orders MODIFY shipping_method VARCHAR(255) DEFAULT NULL;
i take no responsibility for any data loss. backup your data prior to doing any sql statements.
best.
Also note that by doing so, may disrupt a future proper upgrade as that change was a specific change for the database upgrade to that version. Reason it may "disrupt" the future upgrade (depending on how/to what upgrading) is that the installer/version checker may specifically look for that setting having already been changed to that configuration...
Re: Checkout Problems - Database Insert Errors
Software is not like a fine wine that gets better with age. You should really dodge all these issues by doing an upgrade and getting current.
Re: Checkout Problems - Database Insert Errors
Firstly, many thanks for the responses/suggestion to date and the time taken to reply - the Delete Spam Customers looks interesting but now I know it's not more serious. less of a priority right now.
As for 'Problem 2' yes I do realise I am out of date zencart/PHP wise and an upgrade is on the cards but I would like to figure the problem first to ensure I don't carry something forward to the new install.
On the face of it, I can see @carlwhat statement, it does loo like something is wrong with the table format but why does the affect the admin activity table 'gzpost'?
I guess what I'm trying to understand is what has changed - the site was working fine one minute but now it's not.
Re: Checkout Problems - Database Insert Errors
Your hoster has updated your MySQL version. Surprise!
The newer versions of Zen Cart handle this issue properly.
Re: Checkout Problems - Database Insert Errors
Quote:
Originally Posted by
AtomicWS
On the face of it, I can see @carlwhat statement, it does loo like something is wrong with the table format but why does the affect the admin activity table 'gzpost'?
I guess what I'm trying to understand is what has changed - the site was working fine one minute but now it's not.
i did not even look at your 2nd log error. my apologies.
gzpost is not a table. it is a field within a table that does not have a default value.
your easiest solution is to turn strict mode off.
if you want to understand why one minute you are not getting errors, the next minute are, i would suggest reading here:
https://stackoverflow.com/questions/...r-column-mysql
there is also info there on turning strict mode off.
your hosting company may also be able to help you.
best.
Re: Checkout Problems - Database Insert Errors
... bearing in mind that turning STRICT mode off is really not a long term solution.
https://docs.zen-cart.com/user/troub...b_strict_mode/