Forums / Upgrading from 1.3.x to 1.3.9 / 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

Locked

Views: 13,491

Results 21 to 25 of 25
This thread is locked. New replies are disabled.
31 May 2008, 8:21 PM
#21
creo_ingero avatar

creo_ingero

New Zenner

Join Date:
Oct 2006
Posts:
40
Plugin Contributions:
0

1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

Ok, so I am having this issue and I am baffled. I am following the instructions where you create a fresh install and put your old database to it. I cannot even get into the tools > sql patch in the admin because when I go there, or anywhere on the zencart, it gives me this page:

Hello. Thank you for loading Zen Cart™.

You are seeing this page for one or more reasons:

  1. This is your first time using Zen Cart™ and you haven't yet completed the normal Installation procedure.

If this is the case for you, Click here to begin installation.

  1. Your /includes/configure.php and/or /admin/includes/configure.php file contains invalid path information and/or invalid database-connection information.

If you recently edited your configure.php files for any reason, or maybe moved your site to a different folder or different server, then you'll need to review and update all your settings to the correct values for your server.
See the Online FAQ and Tutorials area on the Zen Cart™ website for assistance.
To begin installation ...

  1. The Installation Documentation can be read by clicking here: Documentation
  1. Run zc_install/index.php via your browser.
  1. The Online FAQ and Tutorials area on the Zen Cart™ website will also be of value if you run into difficulties.
    I tried putting that code in the QUERY box in myPHPAdmin, but that gave an error. Oh, and my configuration files ARE correct and writable.

I have run this thing about 50 million times now, deleted files, reuploaded, deleted databases, emptied, re-imported...

I tried commenting out that line in the zc_install SQL from 1.3.7 to 1.3.8 (unlike the original starter of this thread, I am upgrading from 1.3.7), but all that did was keep the whole thing from proceeding, just loading the upgrade databases page over and over.

The only module that is installed is the newsletter subscribe.

31 May 2008, 10:36 PM
#22
drbyte avatar

drbyte

Sensei

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

Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

That "Thank you for installing" screen will only appear if the contents of your configure.php files is incorrect (ie: contains default information not specific to your own site, or contains database connection info that isn't correct) or if there are files missing from your site, such as the configure.php files themselves or some of the files in /includes/classes, and other places as well.

So, while you're saying you've checked all that, the fact remains that something's still missing.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Jun 2008, 10:46 PM
#23
creo_ingero avatar

creo_ingero

New Zenner

Join Date:
Oct 2006
Posts:
40
Plugin Contributions:
0

Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

Perhaps you can tell me what's wrong with this then... edited out username & password for security sake:

<?php
/**
 * dist-configure.php
 *
 * @package Configuration Settings
 * @package Admin
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: dist-configure.php 6329 2007-05-16 15:36:56Z drbyte $
 * @private
 */

// Define the webserver and path parameters
// HTTP_SERVER is your Main webserver: eg-http://www.yourdomain.com
// HTTPS_SERVER is your Secure webserver: eg-https://www.yourdomain.com
// HTTP_CATALOG_SERVER is your Main webserver: eg-http://www.yourdomain.com
// HTTPS_CATALOG_SERVER is your Secure webserver: eg-https://www.yourdomain.com
/* 
 * URL's for your site will be built via:  
 *     HTTP_SERVER plus DIR_WS_ADMIN or
 *     HTTPS_SERVER plus DIR_WS_HTTPS_ADMIN or 
 *     HTTP_SERVER plus DIR_WS_CATALOG or 
 *     HTTPS_SERVER plus DIR_WS_HTTPS_CATALOG
 * ...depending on your system configuration settings
 *
 * If you desire your *entire* admin to be SSL-protected, make sure you use a "https:" URL for all 4 of the following:
 */
  define('HTTP_SERVER', 'http://zenyarngarden.com');
  define('HTTPS_SERVER', 'https://zenyarngarden.com');
  define('HTTP_CATALOG_SERVER', 'http://zenyarngarden.com');
  define('HTTPS_CATALOG_SERVER', 'https://zenyarngarden.com');

  // secure webserver for catalog module and/or admin areas?
  define('ENABLE_SSL_CATALOG', 'false');
  define('ENABLE_SSL_ADMIN', 'false');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!

// * DIR_WS_* = Webserver directories (virtual/URL)
  // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
  define('DIR_WS_ADMIN', '/admin/');
  define('DIR_WS_CATALOG', '/');
  define('DIR_WS_HTTPS_ADMIN', '/admin/');
  define('DIR_WS_HTTPS_CATALOG', '/');

  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
  define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/');
  define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
  define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/');

// * DIR_FS_* = Filesystem directories (local/physical)
  //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
  define('DIR_FS_ADMIN', '/admin/');
  define('DIR_FS_CATALOG', '/');

  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
  define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/');
  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
  define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

// define our database connection
  define('DB_TYPE', 'mysql');
  define('DB_PREFIX', 'zen_');
  define('DB_SERVER', 'localhost');
  define('DB_SERVER_USERNAME', 'USERNAME');
  define('DB_SERVER_PASSWORD', 'PASSWORD');
  define('DB_DATABASE', 'zenyarn_zencart');
  define('USE_PCONNECT', 'false'); // use persistent connections?
  define('STORE_SESSIONS', 'db'); // use 'db' for best support, or '' for file-based storage
  

  // The next 2 "defines" are for SQL cache support.
  // For SQL_CACHE_METHOD, you can select from:  none, database, or file
  // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
  // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
  // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash 
  define('SQL_CACHE_METHOD', 'database');
  define('DIR_FS_SQL_CACHE', '/home/zenyarn/public_html/zencart2/cache');

?>
4 Jun 2008, 11:20 PM
#24
creo_ingero avatar

creo_ingero

New Zenner

Join Date:
Oct 2006
Posts:
40
Plugin Contributions:
0

Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

Here's what I think is happening with my installation.

I tried to upgrade, so I made two folders (zencart and zencart2). Zencart is the original 1.3.7. I updated the config files on 1.3.8, but didn't change the database name and then proceeded to run an update on the old database (hence making 1.3.7 with a 1.3.8 database), then when I looked over my files again I changed it back to the RIGHT database (the second one I made). At the time, I did not realize that was what happened, but now that I look at the aftermath of everything it makes sense.

SO, since I was not having any success with upgrading to 1.3.8, I thought my "untouched" 1.3.7 installation would be fine and would just continue to use that... however now I am getting the following error on the customers page when I go to edit:

1054 Unknown column 'zen_order_id' in 'where clause'
in:
[select * from zen_paypal where zen_order_id = '294' order by paypal_ipn_id DESC LIMIT 1]
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.

As I have noted from other threads Dr. Byte has posted in, this is due to the fact that my Database is patched for 1.3.8 and my php files are 1.3.7.

WHAT should I do? Is there a way I can patch my database back to 1.3.7? If I replace my database with an earlier one, will that fix it? I think I have an older one before I tried any of this, but there have been a few new orders on the site since I got that backup... so I don't really want to use it... but I can if that will fix the problem. If I have to do that, is there a way I can save the new orders and put them in... even if I have to do it manually? All I need is a site that works.

10 Jun 2008, 6:34 AM
#25
drbyte avatar

drbyte

Sensei

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

Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

Go to Admin->Tools->Install SQL Patch, and paste the following and click Send:```
alter table paypal change column order_id zen_order_id int(11) default 0 not null;

And then put a plan in place to do a full and proper upgrade of your PHP files ASAP.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.