Forums / Upgrading to 1.5.x / Can't login to admin after upgrade; can login with new install

Can't login to admin after upgrade; can login with new install

Started by dietcokelemon on 29 Dec 2013, 2:42 AM · Views: 6,033

Results 1 to 15 of 15
29 Dec 2013, 2:42 AM
#1
dietcokelemon avatar

dietcokelemon

New Zenner

Join Date:
Jul 2006
Posts:
12
Plugin Contributions:
0

Can't login to admin after upgrade; can login with new install

I can't seem to figure this one out. I have done tons of searching, read all the docs, checked the error logs, etc..

I am upgrading from 1.3.8a to 1.5.1. When I do an upgrade (using either my old configure.php files, modified and renamed dist-configure.php files, or modified configure.php files created by a clean install), I am unable to log in to admin. I get the login screen, the spinning wheel after entering my login info, and then a fresh login screen. I think I have ruled out id/password issues.

On the other hand, when I do an install with a new database, everything works fine.

I think I have tried enough variations to have ruled out any problems with configure.php. I also have used different browswers, cleared cache/cookies, etc. Because it works on a fresh install, it seems like the problem has to be with the upgraded database.

If I could just transfer over my customer and order data, I could live with rebuilding everything else.. but it seems like that would be a nightmare.

Any help would be greatly appreciated.

29 Dec 2013, 5:24 AM
#2
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Can't login to admin after upgrade; can login with new install

Have you run the database upgrade utility alone on the old db? Were there any errors reported?

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

29 Dec 2013, 2:14 PM
#3
lat9 avatar

lat9

Administrator

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

Re: Can't login to admin after upgrade; can login with new install

Within your admin's /includes/configure.php file, what's the setting for

  define('SQL_CACHE_METHOD', 'none'); 

If it's set to something other than 'none', set it to 'none'.

31 Dec 2013, 1:09 AM
#4
dietcokelemon avatar

dietcokelemon

New Zenner

Join Date:
Jul 2006
Posts:
12
Plugin Contributions:
0

Re: Can't login to admin after upgrade; can login with new install

Thanks for the quick replies. My define('SQL_CACHE_METHOD', 'none') was already set to 'none. Here is an error I got during upgrade; I admittedly didn't give it the attention it likely deserved:

NOTE: Skipped upgrade statements: 4
See details at bottom of page for your inspection.
(Details also logged in the "upgrade_exceptions" table.)
Note: In most cases, these failed statements can be ignored,
as they are indications that certain settings may have already been set on your site.
If all the suggested upgrade steps have been completed (no recommendations left),
you may proceed to Skip Upgrades and continue configuring your site.

SKIPPED: Cannot drop index page_accessed on table admin_activity_log because it does not exist.
SKIPPED: Cannot drop index access_date on table admin_activity_log because it does not exist.
SKIPPED: Cannot add index idx_page_accessed_zen to table admin_activity_log because it already exists.
SKIPPED: Cannot add index idx_access_date_zen to table admin_activity_log because it already exists.

31 Dec 2013, 12:42 PM
#5
lat9 avatar

lat9

Administrator

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

Re: Can't login to admin after upgrade; can login with new install

Those skipped statements look harmless.

Do you have access to the phpMyAdmin for your database? Click on the *configuration *table and then search for the configuration_key named SESSION_WRITE_DIRECTORY. The value in that item should be the same value as DIR_FS_SQL_CACHE in your configure.php files.

2 Jan 2014, 1:45 AM
#6
dietcokelemon avatar

dietcokelemon

New Zenner

Join Date:
Jul 2006
Posts:
12
Plugin Contributions:
0

Re: Can't login to admin after upgrade; can login with new install

Thanks. It turns out that the value in the database was a nonexistent folder, but I don't think it mattered because DIR_FS_SQL_CACHE was set to 'none' in the configuration.php files -- plus, it is also set to that nonexistent folder in my live site that has worked for many years. Just to try, I set the database value to a real directory (with chmod 666), and changed it to 'file' in my config files. No change.

lat9:

Those skipped statements look harmless.

Do you have access to the phpMyAdmin for your database? Click on the *configuration *table and then search for the configuration_key named SESSION_WRITE_DIRECTORY. The value in that item should be the same value as DIR_FS_SQL_CACHE in your configure.php files.

2 Jan 2014, 12:18 PM
#7
lat9 avatar

lat9

Administrator

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

Re: Can't login to admin after upgrade; can login with new install

Would you post your /admin/includes/configure.php file's contents? Make sure to xxxx-out the database-related information and any admin-directory name that might be present.

3 Jan 2014, 12:47 AM
#8
dietcokelemon avatar

dietcokelemon

New Zenner

Join Date:
Jul 2006
Posts:
12
Plugin Contributions:
0

Re: Can't login to admin after upgrade; can login with new install

lat9:

Would you post your /admin/includes/configure.php file's contents? Make sure to xxxx-out the database-related information and any admin-directory name that might be present.

Here you go. Thanks again.

<?php /** * @package Configuration Settings circa 1.5.1 * @copyright Copyright 2003-2012 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * File Built by zc_install on 2013-12-27 10:26:13 */ /*************** NOTE: This file is similar, but DIFFERENT from the "store" version of configure.php. ***********/ /*************** The 2 files should be kept separate and not used to overwrite each other. ***********/ /** * WE RECOMMEND THAT YOU USE SSL PROTECTION FOR YOUR ENTIRE ADMIN: * To do that, make sure you use a "https:" URL for BOTH the HTTP_SERVER and HTTPS_SERVER entries: */ define('HTTP_SERVER', 'http://www.xxx.com'); define('HTTPS_SERVER', 'https://www.xxx.com'); define('HTTP_CATALOG_SERVER', 'http://www.xxx.com'); define('HTTPS_CATALOG_SERVER', 'https://www.xxx.com'); // secure webserver for admin? Valid choices are 'true' or 'false' (including quotes). define('ENABLE_SSL_ADMIN', 'false'); // secure webserver for storefront? Valid choices are 'true' or 'false' (including quotes). define('ENABLE_SSL_CATALOG', '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) $t1 = parse_url(HTTP_SERVER);$p1 = $t1['path'];$t2 = parse_url(HTTPS_SERVER);$p2 = $t2['path']; define('DIR_WS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p1) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/'); define('DIR_WS_CATALOG', '/yyyy/'); define('DIR_WS_HTTPS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p2) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/'); define('DIR_WS_HTTPS_CATALOG', '/yyyy/'); 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) define('DIR_FS_ADMIN', realpath(dirname(__FILE__) . '/../') . '/'); //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/ define('DIR_FS_CATALOG', '/home/-----/public_html/yyyy/'); //the following path is a COMPLETE path to the /logs/ folder eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash define('DIR_FS_LOGS', '/home/----/public_html/yyyy/logs'); 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', ''); define('DB_CHARSET', 'utf8'); define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', '-----'); define('DB_SERVER_PASSWORD', '-----'); define('DB_DATABASE', '-----'); // 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', 'none'); define('DIR_FS_SQL_CACHE', '/home/----/public_html/yyyy/cache'); // Define the webserver and path parameters // Main webserver: eg-http://www.your_domain.com - // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com // HTTP_CATALOG_SERVER is your Main webserver: eg-http://www.your_domain.com // HTTPS_CATALOG_SERVER is your Secure webserver: eg-https://www.your_domain.com /* * URLs 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 */ // EOF
3 Jan 2014, 5:29 PM
#9
lat9 avatar

lat9

Administrator

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

Re: Can't login to admin after upgrade; can login with new install

The configure.php file looks just fine. When you "arrive" at your admin's login screen, do you get a zenAdminID $_GET variable? Is that variable still there after the aborted login attempt? Is the variable's value the same as it was upon arrival?

Who are you hosted by?

4 Jan 2014, 12:28 PM
#10
lat9 avatar

lat9

Administrator

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

Re: Can't login to admin after upgrade; can login with new install

You might also check your database Configuration->Sessions settings for anything that is non-default. The default values for ZC 1.5.1 are:

Session Directory 	{DIR_FS_SQL_CACHE}	 
Cookie Domain 	True 	
Force Cookie Use 	False 	
Check SSL Session ID 	False 	
Check User Agent 	False 	
Check IP Address 	False 	
Prevent Spider Sessions 	True 	
Recreate Session 	True 	
IP to Host Conversion Status 	true 	
Use root path for cookie path 	False 	
Add period prefix to cookie domain 	True

You can view these values using phpMyAdmin, too. Click on your configuration table, then click the Search tab and search for configuration_group_id value of 15.

4 Jan 2014, 10:41 PM
#11
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,878
Plugin Contributions:
7

Re: Can't login to admin after upgrade; can login with new install

I seem to remember a similar issue I had, related to the session key (the length of which is generated by php) being too long for the field in the database.

This thread covers the ground:
http://www.zen-cart.com/showthread.php?204264-*-Done-v1-6-0-Extra-long-session-hash-causing-troubles-on-Mountain-Lion-Server&highlight=session+length

but the upshot is, post-upgrade of your 1.38db, check the session_key field sizes in the relevant tables against the tables in the new installation.

This issue showed up from me when I moved to a new Xampp and a later version of php, which had a larger default session key size.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

5 Jan 2014, 1:51 PM
#12
lat9 avatar

lat9

Administrator

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

Re: Can't login to admin after upgrade; can login with new install

torvista:

I seem to remember a similar issue I had, related to the session key (the length of which is generated by php) being too long for the field in the database.

This thread covers the ground:
http://www.zen-cart.com/showthread.php?204264-*-Done-v1-6-0-Extra-long-session-hash-causing-troubles-on-Mountain-Lion-Server&highlight=session+length

but the upshot is, post-upgrade of your 1.38db, check the session_key field sizes in the relevant tables against the tables in the new installation.

This issue showed up from me when I moved to a new Xampp and a later version of php, which had a larger default session key size.
Thanks for that, Steve! What version of XAMPP/PHP was it that exposed this issue?

5 Jan 2014, 3:19 PM
#13
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,878
Plugin Contributions:
7

Re: Can't login to admin after upgrade; can login with new install

What version of XAMPP/PHP was it that exposed this issue
I think it was 1.82 that has this
; http://php.net/session.hash-function
session.hash_function = sha512

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

9 Feb 2014, 8:44 AM
#14
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,878
Plugin Contributions:
7

Re: Can't login to admin after upgrade; can login with new install

So, was this the solution to the problem described in this thread?

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

9 Feb 2014, 4:16 PM
#15
dietcokelemon avatar

dietcokelemon

New Zenner

Join Date:
Jul 2006
Posts:
12
Plugin Contributions:
0

Re: Can't login to admin after upgrade; can login with new install

I am the original poster. Thanks for all the suggestions, but unfortunately nothing worked. My host looked at it without success also and apparently reached out to the Zencart team, but I haven't heard anything back yet.

torvista:

So, was this the solution to the problem described in this thread?