Zen Cart Logo
Forums / Upgrading to 1.5.x / WARNING: An Error occurred, please refresh the page and try again.

WARNING: An Error occurred, please refresh the page and try again.

Views: 47,322

Results 1 to 14 of 14
16 Jan 2012, 4:26 AM
#1
l3ackdraft avatar

l3ackdraft

New Zenner

Join Date:
May 2005
Location:
Pennsylvania
Posts:
30
Plugin Contributions:
0

WARNING: An Error occurred, please refresh the page and try again.

OK, I need some help, and I am not sure if this is the correct spot.
I have upgraded to v1.5.

I am doing a re-write for purchase orders, which is essential for my clients store.

everything up to this point is working fine until i try to view the order in admin.

I have traced my error to the order class in admin.

I have successfully added a new column in zen_orders however under function query, when I insert the purchase_order_number. It just crashes the view/edit order.

original

    function query($order_id) {
      global $db;
      $order = $db->Execute("select cc_cvv, customers_name, customers_company, customers_street_address,
                                    customers_suburb, customers_city, customers_postcode, customers_id,
                                    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,
                                    coupon_code, payment_method, payment_module_code, shipping_method, shipping_module_code,
                                    cc_type, cc_owner, cc_number, cc_expires, currency,
                                    currency_value, date_purchased, orders_status, last_modified,
                                    order_total, order_tax, ip_address
                             from " . TABLE_ORDERS . "
                             where orders_id = '" . (int)$order_id . "'");

after i insert purchase order

    function query($order_id) {
      global $db;
      $order = $db->Execute("select cc_cvv, customers_name, customers_company, customers_street_address,
                                    customers_suburb, customers_city, customers_postcode, customers_id,
                                    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,
                                    coupon_code, payment_method, payment_module_code, shipping_method, shipping_module_code,
                                    cc_type, cc_owner, cc_number, cc_expires, currency,
                                    currency_value, date_purchased, orders_status, last_modified,
                                    order_total, order_tax, ip_address, purchase_order_number
                             from " . TABLE_ORDERS . "
                             where orders_id = '" . (int)$order_id . "'");

i get "WARNING: An Error occurred, please refresh the page and try again." when I try to look at the order in admin.

Help what am I doing wrong or missing.

Thanks

16 Jan 2012, 4:59 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: WARNING: An Error occurred, please refresh the page and try again.

l3ackdraft:

"WARNING: An Error occurred, please refresh the page and try again."
A search in the FAQs for your error message brings up this article: https://www.zen-cart.com/tutorials/index.php?article=412

16 Jan 2012, 12:57 PM
#3
l3ackdraft avatar

l3ackdraft

New Zenner

Join Date:
May 2005
Location:
Pennsylvania
Posts:
30
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again.

Well let me ask you this Doc.
Can you tell me or point me into a direction, where i can include the the purchase_order_number from the sql without "hacking" the orders.php class file.
Is this even possible.

16 Jan 2012, 6:10 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: WARNING: An Error occurred, please refresh the page and try again.

What's the actual SQL error message?

You can't merely add a random field name to a query if that field doesn't exist in the table you're querying. So, if you're getting an SQL error that tells you a certain field doesn't exist, then ... well ... it doesn't exist. Maybe you've got a typo on the field name. Maybe you added the field to the wrong table or the wrong database. All kinds of things could be wrong with what you've done. Without the actual SQL error, it's just a guess.

As for whether you need to hack the core code, that all depends on whether you need the functionality you're hacking into the code. Maybe you can live without it? If not, then unless there's a notifier hook in the code you'll need to alter the code. In v1.x there aren't many notifier hooks in the admin side, for technical reasons.

1 Apr 2012, 4:06 PM
#5
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again.

I just upgraded from v1.39g to 1.5 and I experienced the same problem.

I did as DR recommended and checked the cache log files. It told me that there was no order_status file in DB. I updated the db sucessfully but for some reason order_status disappeared.

I have updated 5 other sites and never experienced the probelm.

I just copied the order_status file from a working v1.5 DB thru my control panel phpmyadmin.

Check your cache log files, its probably something very similar.

29 Nov 2012, 8:03 PM
#6
bouncerfl avatar

bouncerfl

New Zenner

Join Date:
Mar 2007
Location:
sunny Florida, USA
Posts:
80
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again.

Just an FYI for anyone having this issue, here's what happened to me and why.

I was getting this error as well, after making a change to allow for PHP to run within EZ-Pages (private site, no security risks that are major - beware when doing this, however).

The error, after viewing the log files in /cache turned out to be that the database I was referring to within my PHP code was a different one than Zen uses, and it was throwing an error from the query_factory.php file. So, I prefixed the tables from my foreign database and imported them to the database running Zen (different prefix so that anyone would know at a glance that they're not zen tables) and voila!, no more error displayed and all looks swell.

The moral of the story is: this project (Zen) is simply wonderful. The community is helpful and if you are diligent and read everything about any problems which others experience which are at all similar to yours, you'll likely find the answer.

Thank you Zen team...coffee's on me come payday. :D

-R

6 Jun 2016, 8:57 PM
#8
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again.

Hacked. Somehow thru csf they got me.

I had done some research because mysql was effected. One suggestion was to delete the ibdata files. Well, I saved them locally and then deleted them on the server. .frm files were not touched. I have since restored the original ibdata files.

Nothing really damaged though.

but pages arent loading. log says missing table. Ordinarilly not a problem. But its CEON uri. Install dow not come with tables. It creates them.

I checked the server, and they are there in var/lib/mysql. In phpmyadmin, table is named but when I click on it it says missing table.

So. How can I refresh phpmyadmin to pickup the tables?

6 Jun 2016, 10:42 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: WARNING: An Error occurred, please refresh the page and try again.

pixelpadre:

I had done some research because mysql was effected. One suggestion was to delete the ibdata files. Well, I saved them locally and then deleted them on the server. .frm files were not touched. I have since restored the original ibdata files.

Nothing really damaged though.

but pages arent loading. log says missing table. Ordinarilly not a problem. But its CEON uri. Install dow not come with tables. It creates them.

I checked the server, and they are there in var/lib/mysql. In phpmyadmin, table is named but when I click on it it says missing table.

So. How can I refresh phpmyadmin to pickup the tables?
phpMyAdmin simply reports what it reads from MySQL.
And MySQL usually reports everything automatically, except occasionally when things are damaged.
Sometimes restarting MySQL is enough.

Sometimes repairing the tables manually from the command-line is necessary:```
mysqlcheck --all-databases -r #repair

6 Jun 2016, 11:18 PM
#10
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again.

Yea i had already tried the repair. All that did was show me all the bad tables. :( Its weird how all of the zc databases only had the ceon table effected. I have 5-6 zc installs

7 Jun 2016, 12:42 AM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: WARNING: An Error occurred, please refresh the page and try again.

If all the original ZC tables were MyISAM and the Ceon tables were the only InnoDB tables, then your ibdata files (the InnoDB data) were probably the culprit there.

And ibdata files are only "copyable" when MySQL is shut down. Otherwise they're "open" and rarely ever copy cleanly or completely. So backups of files for InnoDB data are rarely reliable unless MySQL is shut down first. For InnoDB it's better to do a database dump/export instead.

11 Jun 2016, 7:31 PM
#12
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again.

OK, you are right. Lost a lot of sleep over this. I still dont know what happened other than the mysql shutdown. It could have been an attack that overwhelmed the server or ......insufficient memory...1gb. or a combination.

I was able to get sql running again by renaming the 3 ibdata files in mysql directory. That was a start. But upon inspection in the database files...all that remained were .frm files. It was really weird how only the ceon files were affected on all of my ZC sites. On my other sites, I lost most of my tables. I stumbled upon /backups in my directory and found all of the dbase backups made several hours before the crash.

Two days later it happened all over again. Exactly the same files affected. How strange is that? Since the second crash, I moved half of my stuff to another server and everything seems to be running without any problem. I also set up CSF config file to block bad logins for 1 hours and notify me via email. Lots of blocking going on for bad logins. China and Vietnam seem to be at the top of the list.

I am leaning towards insufficient memory at the heart of the problem. But my gut tells me, someone made that happen in an unnatural way.

11 Jun 2016, 8:12 PM
#13
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again.

Huh...I just read dr. last post more closely. So you are saying that ceon is innodb and ZC is myisam. Thats amazing. And it appears that all files that were myisam were left untouched. I even had non-ZC databases that were mixed with the two types. In those the same thing happened. ibdata was destroyed while the other data was fine. Sound like myisam is the only way to go. So now that we know that myisam was not vulnerable, can we say what caused the crash and/or damage?

And can I convert the ibdata to myisam?

Big kudo for the big reveal.

13 Jun 2016, 9:13 PM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: WARNING: An Error occurred, please refresh the page and try again.

pixelpadre:

So you are saying that ceon is innodb and ZC is misaim.
I suspect Ceon used InnoDB because he wanted to use transactions, or needed InnoDB's alternate approach to record locking to support the features in his code.

InnoDB isn't "wrong". But it's rarely properly optimized in the MySQL server. InnoDB serves a purpose. And MyISAM serves a purpose. One should use the right tool for the job. But if one is going to use it, one also needs to ensure that the infrastructure is prepared to support it.

pixelpadre:

can we say what caused the crash and/or damage?
I think whoever has access to your server is in the best position to answer that.
I doubt it has anything to do with "excess Zen Cart traffic".
But if there's some OS-vulnerability or MySQL vulnerability that an attacker was trying to exploit, that might be a culprit.

pixelpadre:

And can I convert the ibdata to myisam?Sure: Use phpMyAdmin (or equiv) to change the table type from InnoDB to MyISAM.
But remember that in doing so you will lose all the benefits that InnoDB offers.