I was installing CCK and Contet Profile modules when I receved an error message (which i of course failed to copy). When I logged in Administrator again it seems like the user have lost admin rights and are operating with the same rights as as a user profile with limited access.

Of course this user does not have access to alter permissions and I am unsure how i can regain my admin access without the ability to access permissions.

Does anyone know if there are any ways to solve this or do I merely have to uninstall and reinstall the site?

Thank you so much for your help in advance.

Regards,
Espen

Comments

espenb’s picture

The error mesage was related to Mysql if that helps at all.

gcassie’s picture

Does the error message show up in the error logs? If you can't get to them through the admin interface now, you can probably still get at the database table.

espenb’s picture

I must admit I am not an experienced Drupal user, I assume the error would have been logged in the watchdog database. I didnt find it but I did find some commands which to me seem rather strange. Two seperate actions were added:

a:1:{s:7:"%action";s:18:"Block current user";}
and
a:1:{s:7:"%action";s:30:"Ban IP address of current user";}

However I can log on with the user account, its just my access level which seem limited.

Does this make any sense at all?

I really appreciate you helping me on the matter!

Regards,
Espen

gcassie’s picture

Can you log in as the user with ID 1, the account that was used to set up the site?

espenb’s picture

No sadly, it was User 1 (admin) which lost its access and we had not given full admin rights to any other users.

I guess the question is why this happened, has the user actually lost its admin access or are there any errors somewhere which prevent Drupal from giving the right access. Like the database?

jweberg’s picture

I am having the same problem. I've even tried to clear the cache to see if that helps but I get the "You are not authorized to access this page." page. Any help would be appreciated.

xmark99’s picture

I had the same problem after installing CCK Module, but it was fixed after doing /update.php

jweberg’s picture

I did a update.php and that didn't solve my issue. I actually had to completely rebuild my site. I think it has to do with when drupal isn't in the root directory. I had a couple sites give me the same problem. I've had a couple sites give me this problem as well as a couple other errors but when moved to the root the problems seem to go away. Has anyone else experienced this?

xmark99’s picture

Clear all of the rows in your "sessions" table of the Drupal database. That solved it for me. You may also only delete the rows that are asscociated with the user id in question and leave the rest of the sessions if you want.

k.obrien’s picture

I've been on the verge of a breakdown over this and am thrilled to say that clearing the cache tables, session table, and then running update.php got my admin privies back! I'm not sure what I did that created the problem to begin with (late night) but it was as if my admin account took on the privies of a lesser role. Thank you all for your suggestions, I was beside myself at the thought of reinstalling and having to recreate all my views, etc.

sunilkumar’s picture

espenb,

You can login to phpmyadmin and and change the user id of your user to "1". It will work.
Disclaimer: I am a newbie. :):)

joelloyd’s picture

Extremely pleased I have resolved it through above tips.

I emptied the cache and sessions tables - this did not help me.

I ran mysite.com/update.php whilst logged in as 'user 1'/admin - a minute later, all was restored and I was a happy happy bunny!

Hope others find this post, as it had me sweating for a few hours.

Emma’s picture

running update.php solved my problem - couldn't access admin/build/modules after enabling a module. Had tried disabling via mysql, tried deleting the module, clearing he cache and nothing worked. Ran update.php and all now fine!

jebernier’s picture

"I ran mysite.com/update.php whilst logged in as 'user 1'/admin"

How do you do this?

axelav’s picture

I'm having the same problems but I'm just wondering how you go about clearing the cache & session tables? I've located them in mySQL but I'm not sure how to proceed. I don't want to break anything further!

axelav’s picture

and have just saved my life. Thank you, thank you, thank you.

Anonymous’s picture

OMG. I was having a panic attack when this happened to me. Thank goodness I came across this post which solved all (well one of them anyway) my problems.

Anonymous’s picture

So I have restored my admin access back, but how do I now install cck successfully. I tried it again with a newer version of the module, but I again get the same error and have to re-fix it all over again. Any ideas will be greatly appreciated.

jebernier’s picture

Tried all this and didn't work..I must be doing something wrong.

jebernier’s picture

Tried thus and it worked!

"lol
oh crap, what's the difference between /q?=admin and /q?=user
the first one is denied by default even if you login with the right password, although if you login /q?=user problem's fixed!
the troubleshooting was right after all, why didn't I do that first?

:)"

boftx’s picture

I was hit by this after upgrading PollField today and receiving a 'Failed to allocate x bytes error'. I had also just installed and tested the Masquerade module.

Editing settings.php to increase memory and allow updates, clearing the cache and session tables manually, and then running update.php made everything right again.

As a side note, I was fumble-fingering my admin password so I requested a new password for admin. I consistently got a page not found error when using the link in the email and had to reset the password using the MD5 trick in a manual update.

This post should be on the front page of the Drupal site and place in a text file in the basic install. It is a life saver!

yunona’s picture

I was upgrading my modules when I got hit by this. I cleared cash and session table, ran update.php successfully, but nothing helps. I also checked users table,and my user id is still 1. I checked the possible updates while running update.php and paid an attention, CCK is not in the list, even though I uploaded a new version. Help, pls...