Zen Cart Logo
Forums / Installing on a Linux/Unix Server / Cannot access admin area - login loops back to admin login page

Cannot access admin area - login loops back to admin login page

Locked

Views: 11,904

Results 1 to 19 of 19
This thread is locked. New replies are disabled.
28 Mar 2013, 6:44 PM
#1
dianne avatar

dianne

Zen Follower

Join Date:
May 2007
Location:
Virginia, USA
Posts:
102
Plugin Contributions:
0

Cannot access admin area - login loops back to admin login page

Hello! I am getting looped back to to the admin login screen every time I attempt to login. There is no error message, just the loop back to the login page. I looked to see if anyone else is having this problem and though I found admin login problems, I could not find this problem, so I'm hoping you can help.

First I'll give a little background and then I'll tell you the steps I've taken so far.

**Background
**
I have moved a zen cart store v1.5.1 from one server to another. I did a fresh install to get the config file info correct and then moved over all the files (being careful not to overwrite the config files) and imported the database via MyPHPadmin.

The cataglog is visible and shows the store as "down for maintenance". This was the status of the store prior to the move, so I am assuming it is showing that status because of the settings.

Steps I've Taken

I cannot access the admin area using the old passwords. Therefore, I used the forgotten password feature and reset the password. I followed the prompts to enter the temporary password and then I followed the prompts to enter the "current" password and the "new" password. When I clicked to login, I was taken back to the regular login screen.

So, I entered my username and my new password. I was again taken back to the login screen.
I did NOT get the pink message about the password or username being incorrect. I simply
got the login screen. It's like it's in a loop.

So, I tried something different.

I followed the steps for resetting the Admin password via MyPHPAdmin. The same thing
happened. I attempted to login with Admin/admin and I was taken to a screen to reset
the password. I entered the "current" password and the "new" password. Upon clicking to
login, I was redirected back to the login screen. No pink error message, just the redirect.
I waited an hour in case the system was responding to all the attempts from my IP Address.

Same problem.

I checked the error logs and found this:

[28-Mar-2013 10:05:32 CST6CDT] PHP Fatal error: 1146:Table 'vangelo2_tempForTesting.vangelo2_db_cache' doesn't exist :: select * from vangelo2_db_cache where cache_entry_name = 'zc_fe8176fff793509766b16dda44d2f87a' in /home/vangelo2/public_html/demo/includes/classes/db/mysql/query_factory.php on line 120

I get the general idea but what specifically is it telling me to do? I'm not a programmer, so "plain English" details, please (thanks!).

Alternatively, if you have other thoughts on what's happening and how to resolve it, I would appreciate those as well.

Thanks for anything you can share.

Dianne

28 Mar 2013, 11:09 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Cannot access admin area - login loops back to admin login page

Dianne:

I was again taken back to the login screen.
I did NOT get the pink message about the password or username being incorrect. I simply
got the login screen. It's like it's in a loop.
When it loops without an error message, the problem to fix is NOT the password. In that case it's not even processing the password to know whether it's valid or not. It's simply not able to start a valid "session". This is a server configuration problem.

So, all the password-reset attempts you've done have been in vain.

I'm guessing you forgot the session-directory reset step, which can be fixed now using the fix_cache_key utility from the plugins area. This is explained in the FAQ article which explains the correct way to move your site to another server http://www.zen-cart.com/content.php?142-i-want-to-move-my-zen-cart-installation-to-another-host-or-a-different-server

Additional related reading:
http://www.zen-cart.com/content.php?258-i-cant-stay-logged-in-to-my-admin-area-or-php-session-handling-isnt-working-for-me
http://www.zen-cart.com/content.php?126-i-cant-login-to-the-admin-after-installing-zen-cart

29 Mar 2013, 3:42 AM
#3
dianne avatar

dianne

Zen Follower

Join Date:
May 2007
Location:
Virginia, USA
Posts:
102
Plugin Contributions:
0

Re: Cannot access admin area - login loops back to admin login page

Actually, yes, those are the instructions I followed to move the site.

The original site was v1.3.9h and it is the live store, still in existence while we upgrade. To upgrade, I did a fresh install on a different server. Once it was up, I uploaded the theme and the images and manually made all the other changes needed to duplicate the site on v1.5.1 (I manually updated the home page, etc.). Then, I added the modules (an editor, plus stock by attributes and also column grids), taking care to use updated versions; and then I added Google Analytics.

Once the new site was in good working order (including ability to login to admin panel), I proceeded to move the site to the other server (which will be its permanent home) by following the instructions you mentioned.

I forgot to mention in my original post that I had uploaded and used the fix_cache_key.php file. I uploaded it into the same directory as the store index.php file. The result I got when I went to the URL is that it redirected to the home page "down for maintenance" screen (just tried it again with the same result).

I never got any instructions or list of things to fix. Is the fact that it redirected an indication of a particular problem?

I'll take a look at the two other links you sent and try what's suggested there and report back my results.

Thanks for your help.

Dianne

29 Mar 2013, 3:57 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: Cannot access admin area - login loops back to admin login page

Dianne:

I forgot to mention in my original post that I had uploaded and used the fix_cache_key.php file. I uploaded it into the same directory as the store index.php file. The result I got when I went to the URL is that it redirected to the home page "down for maintenance" screen (just tried it again with the same result).

I never got any instructions or list of things to fix. Is the fact that it redirected an indication of a particular problem?
Ya, the redirect means it didn't actually run, but something else interrupted it first. That sounds like rogue custom rewrite rules in a self-added .htaccess file maybe.

29 Mar 2013, 2:14 PM
#5
dianne avatar

dianne

Zen Follower

Join Date:
May 2007
Location:
Virginia, USA
Posts:
102
Plugin Contributions:
0

Re: Cannot access admin area - login loops back to admin login page

Oh, my! Happy, happy, happy because I was able to login.

How?

Shut down and restart the computer. Could it really have been that simple? LOL! I tried everything under the sun and never even thought to do that one simple step (sheepish grin).

Ah, well...to be reminded of simplicity.

Thanks, Dr. Byte! Your help is appreciated.

Dianne

1 Apr 2013, 4:09 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: Cannot access admin area - login loops back to admin login page

It could very well have been an old cookie that got reset when restarting the browser, which would be a byproduct of rebooting.

1 Apr 2013, 6:12 PM
#7
torvista avatar

torvista

Totally Zenned

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

Re: Cannot access admin area - login loops back to admin login page

I had the same problem with Chrome, on a local install. Fixed after deleting all the cache items.

1 Oct 2014, 5:57 PM
#8
k1ra avatar

k1ra

New Zenner

Join Date:
Jul 2013
Posts:
57
Plugin Contributions:
0

Re: Cannot access admin area - login loops back to admin login page

I have the same issue. On the 28th I was able to access Admin just fine. I have tried on two different computers using Firefox. Clearing cache does not help.
Yesterday I noticed I could not get in and assumed I was not correctly remembering my password. Same issue today
Nothing has changed on my site. It has not been moved, I have not installed any new plugins, I have not changed any settings.

I checked the debug logs and have this error:

[01-Oct-2014 11:32:35 America/Denver] ERROR: Failed sending email to: "Admin" admin@localhost with subject: "Admin login failure notice" (failed validation)

which doesn't really explain anything, though I am not sure why it's trying to send an email to @localhost since that is not the email for my Admin account.

14 Dec 2014, 12:22 AM
#9
peter_cefalu avatar

peter_cefalu

New Zenner

Join Date:
Sep 2014
Location:
Buffalo, New York, United States
Posts:
10
Plugin Contributions:
0

Re: Cannot access admin area - login loops back to admin login page

I am getting this error on version 151 as well. Everything was fine up until a few hours ago. [13-Dec-2014 16:56:16 America/Denver] ERROR: Failed sending email to: "Admin" admin@localhost with subject: "Admin login failure notice" (failed validation). I have not touched anything on this site for a year and I have no idea what happened. Please help!

14 Dec 2014, 12:25 AM
#10
drbyte avatar

drbyte

Sensei

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

Re: Cannot access admin area - login loops back to admin login page

Peter Cefalu:

admin@localhost
I'm not surprised that you'd get an error trying to email that address, since it's essentially an invalid email address.

So, it begs the question: Do you have an Admin user in your store's admin area which has "admin@localhost" set as the email address? if so, why?

If you didn't know that you had one, then perhaps someone has gained access to your website's database and injected one maliciously? In that case you need to immediately do a thorough investigation of your site and find out how they got in and remove whatever damage they've done: http://www.zen-cart.com/wiki/index.php/Recovering_From_Hacks

14 Dec 2014, 12:35 AM
#11
peter_cefalu avatar

peter_cefalu

New Zenner

Join Date:
Sep 2014
Location:
Buffalo, New York, United States
Posts:
10
Plugin Contributions:
0

Re: Cannot access admin area - login loops back to admin login page

oh no! I did not have that email in there. like i said, i haven't touched anything except adding products and such. haven't found any changed or new files as of yet. any other thoughts while i keep looking?

14 Dec 2014, 12:40 AM
#12
peter_cefalu avatar

peter_cefalu

New Zenner

Join Date:
Sep 2014
Location:
Buffalo, New York, United States
Posts:
10
Plugin Contributions:
0

Re: Cannot access admin area - login loops back to admin login page

and it is exactly the same error as the k1ra posted.

14 Dec 2014, 1:05 AM
#13
peter_cefalu avatar

peter_cefalu

New Zenner

Join Date:
Sep 2014
Location:
Buffalo, New York, United States
Posts:
10
Plugin Contributions:
0

Re: Cannot access admin area - login loops back to admin login page

If i use an incorrect username, i get the error message, so it is hitting the db

14 Dec 2014, 1:48 AM
#14
peter_cefalu avatar

peter_cefalu

New Zenner

Join Date:
Sep 2014
Location:
Buffalo, New York, United States
Posts:
10
Plugin Contributions:
0

Re: Cannot access admin area - login loops back to admin login page

went into the admin table, the email was changed there to admin@localhost and the lockout_expires was set to 1418521640. i changed both and was able to login. i then changed the login and password for the admin. i am now looking at my files for something out of the ordinary. also, some ip from Denver logged in before I experienced the problem today. looks like they reached the admin but no other logs were listed.

14 Dec 2014, 1:49 AM
#15
drbyte avatar

drbyte

Sensei

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

Re: Cannot access admin area - login loops back to admin login page

Here's what's happening on a technical level:

Whenever someone tries to log into your admin multiple times without the correct password, the system emails that admin user and the primary administrator about the failure.
If the email address is invalid, the kind of error you've quoted will be seen in the logs.

So, the presence of the error suggests 2 things are both happening to you:
a) someone's trying to login to your admin and doesn't have a valid username+password. You should do something about that.
b) you've got an admin user whose email address is "admin@localhost", which is a default user account, and should be deleted, as long as you've got a different admin account you can use

If you cannot log into your own admin account, then the above symptoms combined with your inability to log in is further reason to suggest your site has been compromised.
You should immediately do a thorough site inspection and do all necessary cleanup to be certain you've prevented them from doing any further damage or getting back in again: http://www.zen-cart.com/wiki/index.php/Recovering_From_Hacks

And to give yourself access to your admin account again, the following may be necessary: http://www.zen-cart.com/content.php?44-how-do-i-change-or-reset-my-admin-password (and whoever compromised your site might have been attempting to do this very thing, which could explain how the "admin@localhost" user got created and also why your old login stopped working ... but if they gained access to do that, then you need to find out HOW else they'll be back again)

14 Dec 2014, 2:12 AM
#16
peter_cefalu avatar

peter_cefalu

New Zenner

Join Date:
Sep 2014
Location:
Buffalo, New York, United States
Posts:
10
Plugin Contributions:
0

Re: Cannot access admin area - login loops back to admin login page

There is no user with the admin@localhost email. i only had one and that was mine. i show the rogue login only 4 times but never made it to the admin user page. I have no idea how that was changed as well as the very large lockout number. the many incorrect logins must have been me. anyway i went into the db and was able to change the email and lockout and get back in. I have changed the login and password(harder) and made another superuser just in case. I will now try and find any unusual files and keep an eye out. My question is, can you log into the admin with the admin@localhost still in there as long as the uname and password were always entered correctly? I only ask as we paid someone to upgrade this site to 1.5 over year ago and maybe we never even changed it? I just changed my password yesterday, and had the old and new saved in firefox. so every time I logged in, it was wrong the first time and then the second attempt was correct. i have since deleted the old saved password. I guess what I am saying is....am I the one who triggered the lockout? I find it ironic that the password was changed yesterday and today it was locked out!

14 Dec 2014, 2:18 AM
#17
drbyte avatar

drbyte

Sensei

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

Re: Cannot access admin area - login loops back to admin login page

Peter Cefalu:

My question is, can you log into the admin with the admin@localhost still in there as long as the uname and password were always entered correctly? I only ask as we paid someone to upgrade this site to 1.5 over year ago and maybe we never even changed it?Yes.

Peter Cefalu:

I just changed my password yesterday, and had the old and new saved in firefox. so every time I logged in, it was wrong the first time and then the second attempt was correct. i have since deleted the old saved password. I guess what I am saying is....am I the one who triggered the lockout? I find it ironic that the password was changed yesterday and today it was locked out!Yes, it seems like it was your own Firefox that locked you out.

14 Dec 2014, 2:26 AM
#18
peter_cefalu avatar

peter_cefalu

New Zenner

Join Date:
Sep 2014
Location:
Buffalo, New York, United States
Posts:
10
Plugin Contributions:
0

Re: Cannot access admin area - login loops back to admin login page

Thank you for responding DrByte. I was in full panic mode! I still do not know about that ip from Denver but the original poster had the exact same error. I have reached out to them in hopes of getting more info. Anyway, I am going through all the files anyway(nothing yet) and changing passwords. We used dedicated ssl and i think we are safe but you never know. I spoke with my hosting company and they saw nothing as well. Again, thank you for the help.

14 Dec 2014, 1:46 PM
#19
peter_cefalu avatar

peter_cefalu

New Zenner

Join Date:
Sep 2014
Location:
Buffalo, New York, United States
Posts:
10
Plugin Contributions:
0

Re: Cannot access admin area - login loops back to admin login page

Just to finish this thread, the denver ip is my host, the logins were from the support guy there. no hack, just an odd situation with the failed login attempts. Be sure to change all the emails after setup!