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

WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

Views: 19,199

Results 1 to 13 of 13
23 Sep 2014, 1:25 AM
#1
hyperion12 avatar

hyperion12

New Zenner

Join Date:
Jun 2012
Posts:
11
Plugin Contributions:
0

WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

I wanted to import a large number of products and customer details from a ZC 1.3.9 shop in a new ZC 1.5.3 shop (new shop has no products/customers yet).

Did a database dump of the old shop, installed a fresh V1.5.3 on a test server. Than I created an empty database and uploaded the entire DB dump into it.

Changed the database values in both configure.php files of the fresh V1.5.3 shop and ran the database update (instead of new installation) from its zc-install folder. It complained that the configure.php in the admin folder would not exist (admin folder of the old shop has a different name). Changed its name to simply "admin".

The database update went through without problems and at the end of the process the admin folder was automatically renamed, but the pre-installation success page showed an incorrect link (shop's index.php) for the admin folder.

The shop works for the general public (includes folder),I can login, see all the products and customers but when I click on anything below admin --> config I get

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

Renaming the admin folder to the name it used to have in the old shop did not fix the problem.

Can anyone say what I might have overseen here?

23 Sep 2014, 1:31 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

The actual error message explaining what caused that alert on-screen will be found in your site's debug logs, as described here:
http://www.zen-cart.com/content.php?124-blank-page

Ref: http://www.zen-cart.com/content.php?311-warning-an-error-occurred-please-refresh-the-page-and-try-again

23 Sep 2014, 1:44 AM
#3
hyperion12 avatar

hyperion12

New Zenner

Join Date:
Jun 2012
Posts:
11
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

It says:

[CODE][19-Sep-2014 05:48:29] PHP Fatal error:  1054:Unknown column 'language_id' in 'where clause' :: select configuration_group_title
                             from vqkr_configuration_group
                             where configuration_group_id = '1' AND language_id=1 ==> (as called by) /home/domain.com/public_html/zen1/admin...../configuration.php on line 60 <== in /home/domain.com/public_html/zen1/includes/classes/db/mysql/query_factory.php on line 155[/CODE]

and here is the content of said query_factory.php:

    foreach ($backtrace_array as $current_caller) {
      if (strcmp($current_caller['file'], __FILE__) != 0) {
        $query_factory_caller = ' ==> (as called by) ' . $current_caller['file'] . ' on line ' . $current_caller['line'] . ' <==';
        break;
      }
    }
    trigger_error($this->error_number . ':' . $this->error_text . ' :: ' . $this->zf_sql . $query_factory_caller, E_USER_ERROR);
    if (defined('IS_ADMIN_FLAG') && IS_ADMIN_FLAG==true) echo 'If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.<br />';
    echo '</div>';
  }

  function Execute($zf_sql, $zf_limit = false, $zf_cache = false, $zf_cachetime=0, $remove_from_queryCache = false) {
    // bof: collect database queries[/CODE]

where this is line 155

    trigger_error($this->error_number . ':' . $this->error_text . ' ::
23 Sep 2014, 1:53 AM
#4
hyperion12 avatar

hyperion12

New Zenner

Join Date:
Jun 2012
Posts:
11
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

I can phase out the usual suspects:

  • MySQL not running
    incorrect DB_xxxxxxx settings in either of your configure.php files*
    syntax error in MySQL statements
    an incompatible addon, on an incorrectly-installed addon (such as SQL installation steps not completed properly)
  • a hacker attempting to do something rogue or malicious with something on your site, and has been blocked because they've got syntax errors or are attempting to exploit a vulnerability that is NOT a problem on your site
    something wrong with the MySQL engine on your webserver, which your hosting company will likely need to resolve for you*

The syntax error should also not occur here, since the datebase update went through without problems.

Old shop however had indeed installed query_factory (or is it called cache) to lower the number of request and to improve the loading times since it has many products priced by attributes.

23 Sep 2014, 2:04 AM
#5
hyperion12 avatar

hyperion12

New Zenner

Join Date:
Jun 2012
Posts:
11
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

Since this a new shop in which I only wanted to add existing products, prices, attributes and clients/orders/invoices I would not even mind if I started from fresh install again, only importing the relevant database tables from the converted old database in the new database, if this is easier.....

Does anyone know which ones they are?

23 Sep 2014, 3:19 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

hyperion12:

It says:

[19-Sep-2014 05:48:29] PHP Fatal error: 1054:Unknown column 'language_id' in 'where clause' :: select configuration_group_title
from vqkr_configuration_group
where configuration_group_id = '1' AND language_id=1 ==> (as called by) /home/domain.com/public_html/zen1/admin...../configuration.php on line 60 <== in /home/domain.com/public_html/zen1/includes/classes/db/mysql/query_factory.php on line 155

> 
> and here is the content of said query_factory.php... 
> <removed>
The error is not in query_factory. That's only "the messenger". 
The error is from the configuration.php script, which is called in your Admin when you're viewing Admin->Configuration->My Store.

And, when you look at the SQL query, it clearly says "Unknown column 'language_id'".

Zen Cart doesn't have a "language_id" column in that table ... unless you're using a plugin which has added it. 
And, if you're using a plugin to add it, then you're getting that error because you're using PHP files that expect the database to have that column but you're using a database which doesn't yet have that plugin added to it. 

So ... either put the PHP files back to the original code, or apply that plugin's SQL changes to your database so that the database is compatible with your PHP files.
24 Sep 2014, 12:11 AM
#7
hyperion12 avatar

hyperion12

New Zenner

Join Date:
Jun 2012
Posts:
11
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

Admin/configuration.php right?

Had a look at the file and it is unchanged, as uploaded on the server. Where in that file would you recommend me to look for errors?

But now I have a suspect which plugin from the old shop could cause the error in the DB. It's VAT for European companies which I believe
was not developed any further from 1.3 on and it adds a menu topic "VAT number" to the Admin-->Configure. Difficult to fix, IMHO.

Since the design of the new shop needs to be updated anyway, I wouldn't mind to drop the old shop completely. As I said the main purpose of the
exercise was to import all client, product and order details. And this is confirmed working, since they are all there in the new shop.

Could you maybe point me to some direction which database tables I would need to copy to the fresh ZC 1.5.3 database instead?

24 Sep 2014, 3:23 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

hyperion12:

Admin/configuration.php right?
...
Where in that file would you recommend me to look for errors?

On line 60, exactly as the error message in your log says:

hyperion12:

It says:

[19-Sep-2014 05:48:29] PHP Fatal error: 1054:Unknown column 'language_id' in 'where clause' :: select configuration_group_title
from vqkr_configuration_group
where configuration_group_id = '1' AND language_id=1 ==> (as called by) /home/domain.com/public_html/zen1/admin...../configuration.php on line 60 <== ...

21 Jul 2021, 10:25 AM
#9
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

Hi guys,
I upgraded 156a to 157c with upgrading also Mysql from 5.6 to 5.7.29. Also PHP from 7.2 to 7.418. All seem ok but when trying to post a new product I get the message WARNING: An Error occurred, please refresh the page and try again. If you were entering information, press the BACK button in your browser and ...
The error log shows
[21-Jul-2021 09:27:24 UTC] Request URI: /admin/index.php?cmd=product&cPath=192&action=insert_product, IP address: xxxxxx
#1 trigger_error() called at [/Applications/Abyss Web Server/htdocs/zencart-v157c-04072021/includes/classes/db/mysql/query_factory.php:170]
#2 queryFactory->show_error() called at [/Applications/Abyss Web Server/htdocs/zencart-v157c-04072021/includes/classes/db/mysql/query_factory.php:142]
#3 queryFactory->set_error() called at [/Applications/Abyss Web Server/htdocs/zencart-v157c-04072021/includes/classes/db/mysql/query_factory.php:269]
#4 queryFactory->Execute() called at [/Applications/Abyss Web Server/htdocs/zencart-v157c-04072021/includes/functions/database.php:44]
#5 zen_db_perform() called at [/Applications/Abyss Web Server/htdocs/zencart-v157c-04072021/admin/includes/modules/update_product.php:71]
#6 require(/Applications/Abyss Web Server/htdocs/zencart-v157c-04072021/macadmin1/includes/modules/update_product.php) called at [/Applications/Abyss Web Server/htdocs/zencart-v157c-04072021/admin/product.php:33]
#7 require(/Applications/Abyss Web Server/htdocs/zencart-v157c-04072021/admin/product.php) called at [/Applications/Abyss Web Server/htdocs/zencart-v157c-04072021/macadmin1/index.php:11]
--> PHP Fatal error: 1364:Field 'products_msrp' doesn't have a default value :: INSERT INTO products (products_quantity, products_type, products_model, products_price, products_date_available, products_weight, products_status, products_virtual, products_tax_class_id, manufacturers_id, products_quantity_order_min, products_quantity_order_units, products_priced_by_attribute, product_is_free, product_is_call, products_quantity_mixed, product_is_always_free_shipping, products_qty_box_status, products_quantity_order_max, products_sort_order, products_discount_type, products_discount_type_from, products_price_sorter, products_image, products_date_added, master_categories_id) VALUES ('0', '1', 'dfsfgdf', '84.0336', null, '0', '1', '0', '1', '1', '1', '1', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', 'productimages/pwrabyss.gif', now(), '192') ==> (as called by) /Applications/Abyss Web Server/htdocs/zencart-v157c-04072021/includes/functions/database.php on line 44 <== in /Applications/Abyss Web Server/htdocs/zencart-v157c-04072021/includes/classes/db/mysql/query_factory.php on line 170.

I re-imported the database multiple times and setup the zencart from scratch without success. It seems there is an issue with the Default values /Null in Mysql 5.7 and I am not sure how to solve the issue. If you have any recommendations I will appreciate it.

21 Jul 2021, 4:45 PM
#10
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,712
Plugin Contributions:
56

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

You have added the field products_msrp to the products table without a default value. The easiest way to fix this is through the database. In phpMyAdmin or Admin > Tools > Install SQL Patches, you can do

ALTER TABLE products MODIFY COLUMN products_msrp decimal(15,4) NOT NULL default '0.0000';

(I am assuming that the current type of products.products_msrp is "decimal(15,4)" - if it's not, use your current type.)

22 Jul 2021, 9:08 AM
#11
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

Thanks a lot. That worked immediately. What I realised from the log is that the fields and the issue comes from an old plug in called MSRP Display. It seems from 1.5.6 the functionality was transfer in the core software of Zen cart and I did not need to install it. The fields were imported in 1.5.6 from 1.5.5 (mysql 5.6) and created no issue. If I am correct the fields related to the MSRP(as mentioned in the log/installation code of MSRP) can be deleted without causing an issue? If the fields are not needed and stay there they may cause an issue in future updates. Please advise.
Thanks again.

22 Jul 2021, 12:43 PM
#12
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,712
Plugin Contributions:
56

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

It seems from 1.5.6 the functionality was transfer in the core software of Zen cart and I did not need to install it.

This is not true. At the present time Zen Cart does not have an MSRP field. If you want to capture MSRP for comparison purposes, you'll have to add a field.

The only way to do this sort of thing without additional data and code is to make the price field (as shown on the product edit page in admin) the MSRP, and put every product on special (so your selling price is below MSRP).

22 Jul 2021, 1:44 PM
#13
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again - in Admin-->Config

Its safer to do a full installation of the MSRP plug in, as the files are not installed in the directory, or remove the fields from the database or just ignore it.