PayPal PHP Fatal error can someone please explain
ZC 1.57 Bootstrap PHP 7.4
Just updated a site and and have seen this fatal php error, can anyone explain what is wrong and how to fix, thanks.
[05-May-2022 08:10:22 UTC] Request URI: /ipn_main_handler.php?type=ec&token=EC-9WK17060M91102201&PayerID=56PNFG6CD6XAN, IP address: *.*.*.*
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:171]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:143]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:270]
#4 queryFactory->Execute() called at [/includes/modules/payment/paypalwpp.php:2198]
#5 paypalwpp->ec_step2_finish() called at [/includes/modules/payment/paypalwpp.php:1900]
#6 paypalwpp->ec_step2() called at [/ipn_main_handler.php:80]
--> PHP Fatal error: 1062 Duplicate entry '15023' for key 'PRIMARY' :: INSERT INTO store_customers_info
(customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_date_of_last_logon)
VALUES (15023, 1, now(), now()) ==> (as called by) /includes/modules/payment/paypalwpp.php on line 2198 <== in /includes/classes/db/mysql/query_factory.php on line 171.
Re: PayPal PHP Fatal error can someone please explain
That's very strange, since the processing in that section of paypalwpp is creating a new customer and using the unique '$customer_id' associated with that just-created customers table for use in the customers_info table. It almost sounds like the site's customers and customers_info tables have gotten out-of-sync.
Can you create an account on the site in question? The same basic processing path would be used there, i.e. create base customer record to get the customer_id, add address_book record for the customer and create the customer_info record using the unique customer_id.
Re: PayPal PHP Fatal error can someone please explain
@lat9
Thank you for the reply, Yes I have just tried to create an account and get the error. When setting up account the Browser displayed blank page with WARNING: An Error occurred, please refresh the page and try again.
So i suspect you are right, as I imported the database customers from an older database . Hmm what to do now, Guest checkout seems to be OK
Just checked the admin area and the customer account was there, also noticed that a couple of orders have come through OK, but PHP errors keep showing.
Re: PayPal PHP Fatal error can someone please explain
Different error log, but the same underlying root-cause: The customers_info table is (I'm guessing) one record bigger than the customers table itself.
What's the largest customers_id value present in the customers table?
Re: PayPal PHP Fatal error can someone please explain
Since you "updated" the customers table, make sure that the customers_password is set to varchar with a length of 255.
I'm thinking you might have brought the old setting for that field when you copied the table.
Re: PayPal PHP Fatal error can someone please explain
@dbltoe
Thanks that's OK they are the same.
Re: PayPal PHP Fatal error can someone please explain
Quote:
Originally Posted by
lat9
Different error log, but the same underlying root-cause: The customers_info table is (I'm guessing) one record bigger than the customers table itself.
What's the largest customers_id value present in the customers table?
currently largest customer_id 15025 in customers table
So during testing I add Guest checkout and this obviously added to the database. I left that info in the database before importing the old database customers details orders, address book, etc. I think that is what has caused the problem. So I have disabled guest check out where do I remove guest entries in database? I am thinking that if clear the current database and import the old one from fresh will this clear the issue. I may be going down the wrong track.. Thanks for the help
Re: PayPal PHP Fatal error can someone please explain
@lat9 and @dbltoe Thank you both for your help. It turned out that the customer database had not updated properly so many customers where missing. I deleted all customers from the new database and did a fresh import from the old database and it appears to have fixed the problem. Thanks again .