Cannot insert configuration_key "" because it already exists
I keep attempting to install a responsive template by picaflor-azul and keep getting errors when running the SQL files.
The following SQL statement yields the error which follows:
Code:
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES(NULL, '<font color="#0044ff">ACTIVATE Responsive Template by selecting Column Widths</font>', 'COLUMN_WIDTH', '2', 'Width of the Left and Right Columns<br />0 = Use Default Template Settings<br />1 = 75px<br />2 = 150px<br />3 = 225px',@configuration_group_id, NULL, NOW(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');
Upgrade_exceptions TABLE
Cannot insert configuration_key "" because it already exists
Given my limited knowledge of peeking/poking around, I assume the error means that configuration_key “” means “Blank, nothing, nada” is in that field. The configuration_key of nothing cannot be inserted because it already exists in the table.
Looking at the table, I find
=============================================
configuration TABLE
configuration_id 1146
configuration_title Installed Modules
configuration_key blank
configuration_value blank
configuration_description This is automatically updated. No need to edit
configuration_group_id 6
sort_order 0
last_modified NULL
date_added 2012-09-21 07:10:38
use_function NULL
set_function NULL
So there is already a configuration_key “” (blank, nothing, nada)
Using ADMIN:TOOLS: Developers Tool Kit to search in zen-cart-v1.3.9h-full-fileset-10262010 for:
This is automatically updated. No need to edit
The result is admin/modules.php around line 266
'This is automatically updated. No need to edit.', '6', '0', now())");
My logic tells me that this is what caused the BLANK configuration_key to be inserted into the database in Sept 2012.
My question is Why is it there, can I delete that entry, if so, what will be affected since it was inserted for some reason in the first place.
A default v1.3.9h install does not have this configuration_key in the database, so when upgraded to V1.5.1, the responsive template install works like a charm.
MY v1.3.9H database, converted to V1.5.1 DOES have this configuration_key and I am assuming that is why the responsive template install is failing.
Additional info, which may or maynot be relevant:
Looking through website backups, I found a myDEBUG-adm file
[21-Sep-2012 14:10:52 UTC] PHP Warning: reset() expects parameter 1 to be array, null given in /home/MYHOSTINGACCOUNT/public_html/MySecretAdmin/modules.php on line 297
[21-Sep-2012 14:10:52 UTC] PHP Warning: Variable passed to each() is not an array or object in /home/MYHOSTINGACCOUNT/public_html/MySecretAdmin/modules.php on line 298
Also, from server logs, again, may or maynot be relevant
Line 473868: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:38 -0700] "GET /MySecretAdmin/modules.php HTTP/1.1" 200 3272 "-" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473869: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:38 -0700] "GET /MySecretAdmin/includes/languages/english/images/buttons/button_module_install.gif HTTP/1.1" 200 921 "http://chainweavers.com/MySecretAdmin/modules.php" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473870: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:52 -0700] "GET /MySecretAdmin/modules.php?set=&module=&action=install HTTP/1.1" 302 26 "http://chainweavers.com/MySecretAdmin/modules.php" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473871: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:52 -0700] "GET /MySecretAdmin/modules.php?set=&module=&action=edit HTTP/1.1" 200 3390 "http://chainweavers.com/MySecretAdmin/modules.php" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473872: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:53 -0700] "GET /MySecretAdmin/includes/languages/english/images/buttons/button_update.gif HTTP/1.1" 304 - "http://chainweavers.com/MySecretAdmin/modules.php?set=&module=&action=edit" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473873: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:53 -0700] "GET /MySecretAdmin/includes/languages/english/images/buttons/button_cancel.gif HTTP/1.1" 200 451 "http://chainweavers.com/MySecretAdmin/modules.php?set=&module=&action=edit" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473874: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:11:01 -0700] "GET /MySecretAdmin/modules.php?set= HTTP/1.1" 200 3273 "http://chainweavers.com/MySecretAdmin/modules.php?set=&module=&action=edit" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Re: Cannot insert configuration_key "" because it already exists
WOW. The hackers must camp here. Within a few hours, several dozen different IP addresses started attempting /MySecretAdmin/ . Good thing that choice of characters was fake.
Re: Cannot insert configuration_key "" because it already exists
Quote:
The hackers must camp here
Yes unfortunately - -
Re: Cannot insert configuration_key "" because it already exists
If you go to phpMyAdmin and search your database in the table:
configuration
on the field:
configuration_key
for the word:
COLUMN_WIDTH
do any rows come up?
If so, how many are there?
Now you could delete the row(s) that match that configuration_key if you want to start over on your sql stuff ...
Re: Cannot insert configuration_key "" because it already exists
Table: configuration
Field: configuration_key
zero entries for COLUMN_WIDTH
one entry for COLUMN_WIDTH_LEFT
one entry for COLUMN_WIDTH_RIGHT
Re: Cannot insert configuration_key "" because it already exists
Is there more to the sql than just that 1 line?
Re: Cannot insert configuration_key "" because it already exists
Well, uhm, yes. OOPS, I only included the line that looked like it had something to do with the error. Sorry.
I took the "" already exists meaning that the blank configuration_key was root of the issue.
Code:
SET @configuration_group_id=0;
SELECT (@configuration_group_id:=configuration_group_id) FROM configuration_group WHERE configuration_group_title= 'Layout Settings' LIMIT 1;
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES
(NULL, '<font color="#0044ff">ACTIVATE Responsive Template by selecting Column Widths</font>', 'COLUMN_WIDTH', '2', 'Width of the Left and Right Columns<br />0 = Use Default Template Settings<br />1 = 75px<br />2 = 150px<br />3 = 225px',@configuration_group_id, NULL, NOW(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');
ALTER TABLE layout_boxes ADD show_box_min_width TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER layout_box_status_single;
There's also a slew of the same error with this one too.... but I was just assuming (again), that the blank config_key was causing the problem since it was not there after a vanilla install.
Code:
SET @configuration_group_id=0;
SELECT @configuration_group_id:=configuration_group_id
FROM configuration_group
WHERE configuration_group_title= 'Responsive Sheffield Blue'
LIMIT 1;
DELETE FROM configuration WHERE configuration_group_id = @configuration_group_id AND configuration_group_id != 0;
DELETE FROM configuration_group WHERE configuration_group_id = @configuration_group_id AND configuration_group_id != 0;
INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (NULL, 'Responsive Sheffield Blue Template', 'Set Slideshow Options', '1', '1');
SET @configuration_group_id=last_insert_id();
UPDATE configuration_group SET sort_order = @configuration_group_id WHERE configuration_group_id = @configuration_group_id;
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES
(NULL, 'Slides JS Slideshow', 'RSB_SLIDES_STATUS', 'true', 'Activate Slides JS Slideshow', @configuration_group_id, 1, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'),
(NULL, 'Play Interval', 'RSB_SLIDES_PLAY', '5000', 'Play interval', @configuration_group_id, 2, NOW(), NULL, NULL),
(NULL, 'Banner Display Groups - Rsbslide1', 'SHOW_BANNERS_GROUP_SETRSB1', 'rsbslide1', 'Rsbslide 1', @configuration_group_id, 30, NOW(), NULL, NULL),
(NULL, 'Banner Display Groups - Rsbslide2', 'SHOW_BANNERS_GROUP_SETRSB2', 'rsbslide2', 'Rsbslide 2', @configuration_group_id, 31, NOW(), NULL, NULL),
(NULL, 'Banner Display Groups - Rsbslide3', 'SHOW_BANNERS_GROUP_SETRSB3', 'rsbslide3', 'Rsbslide 3', @configuration_group_id, 32, NOW(), NULL, NULL),
(NULL, 'Banner Display Groups - Rsbslide4', 'SHOW_BANNERS_GROUP_SETRSB4', 'rsbslide4', 'Rsbslide 4', @configuration_group_id, 33, NOW(), NULL, NULL),
(NULL, 'Banner Display Groups - Rsbslide5', 'SHOW_BANNERS_GROUP_SETRSB5', 'rsbslide5', 'Rsbslide 5', @configuration_group_id, 34, NOW(), NULL, NULL);
# Register the configuration page for Admin Access Control
INSERT IGNORE INTO admin_pages (page_key,language_key,main_page,page_params,menu_key,display_on_menu,sort_order) VALUES ('ressheffieldblue','BOX_CONFIGURATION_RESPONSIVE_SHEFFIELD_BLUE','FILENAME_CONFIGURATION',CONCAT('gID=',@configuration_group_id),'configuration','Y',@configuration_group_id);
INSERT INTO `banners` (`banners_id`, `banners_title`, `banners_url`, `banners_image`, `banners_group`, `banners_html_text`, `expires_impressions`, `expires_date`, `date_scheduled`, `date_added`, `date_status_change`, `status`, `banners_open_new_windows`, `banners_on_ssl`, `banners_sort_order`) VALUES
('', 'rsbslide1', 'http://www.picaflor-azul.com', 'banners/rsbslide1.jpg', 'rsbslide1', NULL, '0', NULL, NULL, '0001-01-01 00:00:00', NULL, '1', '1', '1', '0'),
('', 'rsbslide2', 'http://www.picaflor-azul.com', 'banners/rsbslide2.jpg', 'rsbslide2', NULL, '0', NULL, NULL, '0001-01-01 00:00:00', NULL, '1', '1', '1', '0'),
('', 'rsbslide3', 'http://www.picaflor-azul.com', 'banners/rsbslide3.jpg', 'rsbslide3', NULL, '0', NULL, NULL, '0001-01-01 00:00:00', NULL, '1', '1', '1', '0'),
('', 'rsbslide4', 'http://www.picaflor-azul.com', 'banners/rsbslide4.jpg', 'rsbslide4', NULL, '0', NULL, NULL, '0001-01-01 00:00:00', NULL, '1', '1', '1', '0'),
('', 'rsbslide5', 'http://www.picaflor-azul.com', 'banners/rsbslide5.jpg', 'rsbslide5', NULL, '0', NULL, NULL, '0001-01-01 00:00:00', NULL, '1', '1', '1', '0');
UPDATE configuration SET configuration_value = 100 WHERE configuration_key = 'IMAGE_SHOPPING_CART_WIDTH';
UPDATE configuration SET configuration_value = 200 WHERE configuration_key = 'IMAGE_SHOPPING_CART_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_LISTING_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_LISTING_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_NEW_LISTING_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_NEW_LISTING_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_NEW_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_NEW_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_ALL_LISTING_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_ALL_LISTING_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'CATEGORY_ICON_IMAGE_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'CATEGORY_ICON_IMAGE_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'SUBCATEGORY_IMAGE_TOP_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'SUBCATEGORY_IMAGE_TOP_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'SUBCATEGORY_IMAGE_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'SUBCATEGORY_IMAGE_HEIGHT';
UPDATE configuration SET configuration_value = '0' WHERE configuration_key = 'CATEGORIES_TABS_STATUS';
UPDATE configuration SET configuration_value = 2 WHERE configuration_key = 'DEFINE_BREADCRUMB_STATUS';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'SHOW_CUSTOMER_GREETING';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'SHOW_FOOTER_IP';
UPDATE configuration SET configuration_value = false WHERE configuration_key = 'PRODUCT_LIST_ALPHA_SORTER';
UPDATE configuration SET configuration_value = false WHERE configuration_key = 'PRODUCT_LIST_CATEGORIES_IMAGE_STATUS';
UPDATE configuration SET configuration_value = false WHERE configuration_key = 'PRODUCT_LIST_CATEGORIES_IMAGE_STATUS_TOP';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'PRODUCT_LIST_DESCRIPTION';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'PRODUCT_LIST_FILTER';
UPDATE configuration SET configuration_value = 1 WHERE configuration_key = 'PRODUCT_INFO_CATEGORIES_IMAGE_STATUS';
UPDATE configuration SET configuration_value = true WHERE configuration_key = 'USE_SPLIT_LOGIN_MODE';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'EZPAGES_STATUS_HEADER';
UPDATE configuration SET configuration_value = 1 WHERE configuration_key = 'EZPAGES_STATUS_FOOTER';
UPDATE configuration SET configuration_value = 2 WHERE configuration_key = 'SHOW_SHOPPING_CART_UPDATE';
UPDATE configuration SET configuration_value = 1 WHERE configuration_key = 'SHOW_SHOPPING_CART_DELETE';
UPDATE configuration SET configuration_value = 1 WHERE configuration_key = 'SHOW_PRODUCT_INFO_MAIN_NEW_PRODUCTS';
UPDATE configuration SET configuration_value = 2 WHERE configuration_key = 'SHOW_PRODUCT_INFO_MAIN_SPECIALS_PRODUCTS';
UPDATE configuration SET configuration_value = 3 WHERE configuration_key = 'SHOW_PRODUCT_INFO_MAIN_FEATURED_PRODUCTS';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'SHOW_PRODUCT_INFO_MAIN_UPCOMING';
Re: Cannot insert configuration_key "" because it already exists
When you say a blank configuration_key ... do you mean when you browse your table:
configuration
that you actually see a blank row in there? :lookaroun
Re: Cannot insert configuration_key "" because it already exists
Not a blank row. Just blank configuration_key and blank configuration_value
Attachment 13115
Here are the details of each field since the screenprint is pretty tiny
=============================================
configuration TABLE
configuration_id: 1146
configuration_title: Installed Modules
configuration_key: blank
configuration_value: blank
configuration_description: This is automatically updated. No need to edit
configuration_group_id: 6
sort_order: 0
last_modified: NULL
date_added: 2012-09-21 07:10:38
use_function: NULL
set_function: NULL
Re: Cannot insert configuration_key "" because it already exists
Have you figured out why your install script is trying to insert a new record with a blank configuration_key? It should never be doing that.