Zen Cart Logo
Forums / Upgrading to 1.5.x / Fatal error: 1146:Table plugin_control' doesn't exist

Fatal error: 1146:Table plugin_control' doesn't exist

Views: 5,711

Results 1 to 18 of 18
28 Sep 2020, 8:55 PM
#1
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Fatal error: 1146:Table plugin_control' doesn't exist

Good evening.
It's been a while.

I'm doing a fresh install of 1.5.7 on WAMP and using the existing database from 1.5.5.d. I did a clean install to ensure it installed as expected (it did). I then dropped the DB and imported a copy of the 1.5.5 site DB. I ran the zc_install/index.php again expecting the option to 'upgrade' the DB. No luck unfortunately.
I'm receiving 'WARNING: An Error occurred, please refresh the page and try again.' on the page and the following error log. Is there a SQL query to add the required PluginManager to the database perhaps?

#1  trigger_error() called at [C:\wampsites\zencart\includes\classes\db\mysql\query_factory.php:170]
#2  queryFactory->show_error() called at [C:\wampsites\zencart\includes\classes\db\mysql\query_factory.php:142]
#3  queryFactory->set_error() called at [C:\wampsites\zencart\includes\classes\db\mysql\query_factory.php:226]
#4  queryFactory->Execute() called at [C:\wampsites\zencart\includes\classes\PluginManager.php:29]
#5  Zencart\PluginManager\PluginManager->getInstalledPlugins() called at [C:\wampsites\zencart\includes\application_top.php:189]
#6  require(C:\wampsites\zencart\includes\application_top.php) called at [C:\wampsites\zencart\index.php:25]
--> PHP Fatal error: 1146:Table 'zencart157.plugin_control' doesn't exist :: SELECT * FROM plugin_control WHERE status = 1 ==> (as called by) C:\wampsites\zencart\includes\classes\PluginManager.php on line 29 <== in C:\wampsites\zencart\includes\classes\db\mysql\query_factory.php on line 170.
28 Sep 2020, 10:35 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Fatal error: 1146:Table plugin_control' doesn't exist

Your DB_PREFIX is probably different in the old site and you didn't set the new one to match. Thus the tablenames aren't "found", therefore no upgrade option is offered.

You can read more about DB_PREFIX and configure.php and install/upgrade in https://docs.zen-cart.com

29 Sep 2020, 1:04 PM
#3
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Fatal error: 1146:Table plugin_control' doesn't exist

I did wonder that too, but neither old (1.5.5) nor new (1.5.7) setup is using prefixes (2x configure files nor DB).

29 Sep 2020, 5:27 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Fatal error: 1146:Table plugin_control' doesn't exist

zc_install reads your /includes/configure.php file to get your database credentials.
It connects to the database and looks for tables that Zen Cart normally uses.
If it doesn't find them then it doesn't offer upgrade options.
If it does find them then it inspects whether any specific upgrade steps are needed.

So if it's not offering an upgrade then it's not finding the tables. Thus the credentials don't point to the database you expected.

29 Sep 2020, 9:19 PM
#5
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Fatal error: 1146:Table plugin_control' doesn't exist

picandnix:

Good evening.
It's been a while.

I'm doing a fresh install of 1.5.7 on WAMP and using the existing database from 1.5.5.d. I did a clean install to ensure it installed as expected (it did). I then dropped the DB and imported a copy of the 1.5.5 site DB. I ran the zc_install/index.php again expecting the option to 'upgrade' the DB. No luck unfortunately.
I'm receiving 'WARNING: An Error occurred, please refresh the page and try again.' on the page and the following error log. Is there a SQL query to add the required PluginManager to the database perhaps?

#1 trigger_error() called at [C:\wampsites\zencart\includes\classes\db\mysql\query_factory.php:170]
#2 queryFactory->show_error() called at [C:\wampsites\zencart\includes\classes\db\mysql\query_factory.php:142]
#3 queryFactory->set_error() called at [C:\wampsites\zencart\includes\classes\db\mysql\query_factory.php:226]
#4 queryFactory->Execute() called at [C:\wampsites\zencart\includes\classes\PluginManager.php:29]
#5 Zencart\PluginManager\PluginManager->getInstalledPlugins() called at [C:\wampsites\zencart\includes\application_top.php:189]
#6 require(C:\wampsites\zencart\includes\application_top.php) called at [C:\wampsites\zencart\index.php:25]
--> PHP Fatal error: 1146:Table 'zencart157.plugin_control' doesn't exist :: SELECT * FROM plugin_control WHERE status = 1 ==> (as called by) C:\wampsites\zencart\includes\classes\PluginManager.php on line 29 <== in C:\wampsites\zencart\includes\classes\db\mysql\query_factory.php on line 170.


> **DrByte:**
>
> zc_install reads your /includes/configure.php file to get your database credentials.
> It connects to the database and looks for tables that Zen Cart normally uses.
> If it doesn't find them then it doesn't offer upgrade options.
> If it does find them then it inspects whether any specific upgrade steps are needed.
> 
> So if it's not offering an upgrade then it's not finding the tables. Thus the credentials don't point to the database you expected.

maybe, i'm wrong here, but i do not think the error is coming from the zc_install.    the error is coming from this file:

C:\wampsites\zencart\includes\application_top.php

which i do not believe gets called when doing an upgrade or install. 

so, if one is trying to run a zc157 site on a zc156 database, that plugin table would not be there; and zc would generate the listed error.

i'm not sure we are in fact in the zc_install directory.

just a thought.
7 Nov 2020, 2:46 PM
#6
mshultise avatar

mshultise

Zen Follower

Join Date:
Feb 2005
Location:
Captain Cook, Hawaii
Posts:
172
Plugin Contributions:
0

Re: Fatal error: 1146:Table plugin_control' doesn't exist

I had the same problem.

I was running 1.5.6c and upgraded directly to 1.5.7a (skipping 1.5.7).

I received error messages about Query_factory and .htaccess

I had no options display except INSTALL

I checked the DB and was not using a prefix. I also found the table PLUGIN_CONTROL was missing.

#1 trigger_error() called at [/home/www/MYSTORE.com/store/includes/classes/db/mysql/query_factory.php:170]
#2 queryFactory->show_error() called at [/home/www/MYSTORE.com/store/includes/classes/db/mysql/query_factory.php:142]
#3 queryFactory->set_error() called at [/home/www/MYSTORE.com/store/includes/classes/db/mysql/query_factory.php:226]
#4 queryFactory->Execute() called at [/home/www/MYSTORE.com/store/includes/classes/PluginManager.php:29]
#5 Zencart\PluginManager\PluginManager->getInstalledPlugins() called at [/home/www/MYSTORE.com/store/includes/application_top.php:189]
#6 require(/home/www/MYSTORE.com/store/includes/application_top.php) called at [/home/www/MYSTORE.com/store/index.php:25]
--> PHP Fatal error: 1146:Table 'MYLOGIN_store.plugin_control' doesn't exist :: SELECT * FROM plugin_control WHERE status = 1 ==> (as called by) /home/www/MYSTORE.com/store/includes/classes/PluginManager.php on line 29 <== in /home/www/MYSTORE.com/store/includes/classes/db/mysql/query_factory.php on line 170.

I restored the site and verified it was working under 1.5.6c and will try an update to 1.5.7 and then to 1.5.7a as time permits.

7 Nov 2020, 3:02 PM
#7
drbyte avatar

drbyte

Sensei

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

Re: Fatal error: 1146:Table plugin_control' doesn't exist

mshultise:

I had no options display except INSTALL
That's the issue you'll need to sort out first.
If you don't run the database-upgrade step with zc_install, then you'll keep getting the "Table 'plugin_control' doesn't exist" error.

11 Nov 2020, 6:58 AM
#8
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
417
Plugin Contributions:
0

Re: Fatal error: 1146:Table plugin_control' doesn't exist

I may be off on a tangent here but in the original post picandnix stated that they "dropped the DB". This will lose all the 157a changes.

My migration strategy sequence is:
create a new database with MySQl or PHPMyadmin
using zc_install create the empty database in 157a to get the new structure and the required access settings
import the old data into the new 157a database [MySQl console is a lot faster than PHPMyAdmin]
using zc_install upgrade the database

Once the database has been created you can import the old data as often as you like BUT you must run the database upgrade after each import.

11 Nov 2020, 4:38 PM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Fatal error: 1146:Table plugin_control' doesn't exist

OldNGrey:

I may be off on a tangent here but in the original post picandnix stated that they "dropped the DB". This will lose all the 157a changes.

My migration strategy sequence is:
create a new database with MySQl or PHPMyadmin
using zc_install create the empty database in 157a to get the new structure and the required access settings
import the old data into the new 157a database [MySQl console is a lot faster than PHPMyAdmin]
using zc_install upgrade the database

Once the database has been created you can import the old data as often as you like BUT you must run the database upgrade after each import.
This sequence (maybe not right now in version 1.5.7a) could result in the installer not offering an upgrade option as tables that are expected to be missing would be found.

The upgrade sql script includes the table creation steps to be performed when going to ZC 1.5.7.
As to that error, that was as stated above what I got when I had tried to access some portion of the store directly before performing the database upgrade in its entirety.

Do you happen to know the history of plugins that have been installed or used against the database? Wondering if part of the issue is that a date/datetime field has an incorrect value/default value. There should also be zcinstall logs in the logs directory that may offer information about the situation.

11 Jan 2021, 1:19 AM
#10
mmcculli avatar

mmcculli

New Zenner

Join Date:
Mar 2009
Posts:
15
Plugin Contributions:
0

Re: Fatal error: 1146:Table plugin_control' doesn't exist

I was just upgrading to 1.5.7b and got this same error.

I follow all the instructions on https://docs.zen-cart.com/user/upgrading/detailed_upgrading/ and everything was working great in the new_store copy.

I then did the steps in the instructions to move it live.

  • renamed new_store to store
  • updated both configure.php files to point to the current live database.
  • I then tried to run the zc_install to update the live database to 1.5.7b.

I got a 500 Internal Server Error trying to hit the zc_install area to update the database. When I looked in the logs folder I see the same error posted in the thread.

Has anyone figure out the issue and how to resolve it? I could try coping the table missing from the new_store test database but that may break something else.

11 Jan 2021, 2:02 AM
#11
mmcculli avatar

mmcculli

New Zenner

Join Date:
Mar 2009
Posts:
15
Plugin Contributions:
0

Re: Fatal error: 1146:Table plugin_control' doesn't exist

I figured out my issue. In turned out when I uploaded(sftp) the zc_install folder it set the permission wrong on the files/folders. Therefore I got the 500 Internal error do to file permissions being wrong.

Issue resolved now.

thanks, Mark.

19 Apr 2021, 8:09 PM
#12
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Re: Fatal error: 1146:Table plugin_control' doesn't exist

I'm having a very similar issue to that described in the original post of this thread. I am upgrading a shop from 1.5.6c to 1.5.7b

I did a clean install with test data and that was fine. Then I proceeded on the step of making a copy of the live store data and changing the config files to that DB. I expected to be prompted to upgrade the database by running zc_install. But instead I'm getting the same error about missing plug_in table in the log files.

I'm assuming some folks have solved this. Is the solution to first upgrade to an earlier version? If so, which version? Would it be possible to just add the missing plug_in tables? I have quite a few mods to make and I'd hate to have to re-do the hours of work I already did on 1.5.7b and do it all again on an earlier version.

Any advice? I read through this thread a couple of times I couldn't quite pick out what solved the issue the original poster reported.

19 Apr 2021, 8:39 PM
#13
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Fatal error: 1146:Table plugin_control' doesn't exist

earmsby:

I'm having a very similar issue to that described in the original post of this thread. I am upgrading a shop from 1.5.6c to 1.5.7b

I did a clean install with test data and that was fine. Then I proceeded on the step of making a copy of the live store data and changing the config files to that DB. I expected to be prompted to upgrade the database by running zc_install. But instead I'm getting the same error about missing plug_in table in the log files.

I'm assuming some folks have solved this. Is the solution to first upgrade to an earlier version? If so, which version? Would it be possible to just add the missing plug_in tables? I have quite a few mods to make and I'd hate to have to re-do the hours of work I already did on 1.5.7b and do it all again on an earlier version.

Any advice? I read through this thread a couple of times I couldn't quite pick out what solved the issue the original poster reported.

i see no need to re-do all of your hours of work.

using your favorite db admin tool, i would look over and execute the SQL statements in the following section of code:

https://github.com/zencart/zencart/blob/b2887b442fcf9639eeb2ad808055eaf277c13117/zc_install/sql/updates/mysql_upgrade_zencart_157.sql#L261-L356

best.

19 Apr 2021, 10:13 PM
#14
drbyte avatar

drbyte

Sensei

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

Re: Fatal error: 1146:Table plugin_control' doesn't exist

and maybe inspect your /logs directory for errors logged by zcInstall during the upgrade
and check your database's upgrade_exceptions table to find out what statements failed

4 May 2021, 2:29 PM
#15
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Re: Fatal error: 1146:Table plugin_control' doesn't exist

thanks Dr. Byte. Once I replace the database in the config file, I never get to the install/upgrade. I just get an error on the screen which is why I checked into the log files. I will try running the SQL statements mentioned by carlwhat.

4 May 2021, 6:58 PM
#16
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

Re: Fatal error: 1146:Table plugin_control' doesn't exist

Thank you very much for pointing me to this. I ran those SQL statements (adding my table prefix) and then tried the install again and now I was able to successfully update the database.

5 May 2021, 12:33 AM
#17
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Fatal error: 1146:Table plugin_control' doesn't exist

earmsby:

Thank you very much for pointing me to this. I ran those SQL statements (adding my table prefix) and then tried the install again and now I was able to successfully update the database.

:thumbsup:

15 Feb 2022, 3:39 PM
#18
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Fatal error: 1146:Table plugin_control' doesn't exist

I just ran into this on a site using Ceon URI Mappings where the zc_install directory wasn't included in the "don't redirect" section of the site's .htaccess file.

Adding the following clause to the Ceon URI Mappings section of that .htaccess corrected the issue:

# Don't rewrite zc_install directory
RewriteCond %{REQUEST_URI} !^/zc_install/ [NC]