I like food. I like hammers. I like bunnies.

Gallery2 Upgrade Error “Unable to selectAdminUser for core upgrade”

without comments

SVP - No Poodles!

I use Gallery2 for the backend service of photos. It works rather well, despite a few quirks. But none of these issues are nearly as bad as something in the world of a closed-source vendor.

I recently tried to upgrade the Gallery software and found this nasty error in the logs right around when I was trying to push the big red ‘Upgrade’ button:

...Unable to selectAdminUser for core upgrade...

Hopefully if you are reading this, it is because you found this page on a web search and are grasping for some answers. I’m not saying I have all of them, but this is the process I used to figure things out.

First I determined that when logged in as my site admin for Gallery, i did not see the ‘Site Admin’ functionality that is normally present for that user… which is a BAD thing. Try this now. You might experience the same.

Then I looked at the database itself. There was no corruption as far as I could tell, but of interest was the gallery group and user mappings. Open up a command prompt and use whatever you use to interface with your database to run the following SQL query:

select * from g2_UserGroupMap where g_userID=6;

You should see something that looks like this:

| g_userId | g_groupId |
|        6 |         2 |
|        6 |         4 |
|        6 |         3 |
3 rows in set (0.00 sec)

Note the last row, where it shows ‘6’ and ‘3’. If that row does not appear, then your admin user is not set up to actually have admin privileges!

A quick and dirty fix to enable the default user you created when you installed Gallery is to run this query:

insert into g2_UserGroupMap values (6,3);

You have now just given user ID number 6 admin privileges.

Now make sure you know who that user ID 6 is:

select g_userName from g2_User where g_id=6;

Now you can login as that user and try the upgrade again. Bingo!

Written by Tijger Tsou

November 6th, 2008 at 10:43 am

Leave a Reply