Unable to access Admin following upgrade to version 10

Jamie O asked on September 14, 2017 12:00

The default 'administrator' account is unable to access Admin now that the upgrade to version 10 has completed. It worked fine in version 9. I see the following error:

Access denied

You're not a content editor and you cannot use administration.

I tried to use the CMSAdminEmergencyReset to create another admin account to login but that fails because it's trying to create columns in CMS_User that were deleted in version 10...

I also tried manually adding rows to UserRoles to give the administrator user the global admin and power user roles. Before I did that, the error I saw when trying to access admin was:

Access denied to resource 'CMS'

Permission for UI element 'Administration' is required.

Can anyone point me in the right direction?

Recent Answers


Prashant Verma answered on September 14, 2017 12:21

Hi Jamie,

Its a role and user privilege level issues , I recommend you to take backup of your Database before executing this query.

Check with this query and update your user privilege or admin user privilege using below query.

Update cms_user SET UserPrivilegeLevel=3 WHERE username='administrator'

Thanks

Happy to help you

3 votesVote for this answer Mark as a Correct answer

Jamie O answered on September 14, 2017 12:23

Hi Prashant,

Thanks for your help. Unfortunately the administrator user already has UserPrivilegeLevel=3.

Do you have any other suggestions?

Thanks,

0 votesVote for this answer Mark as a Correct answer

Prashant Verma answered on September 14, 2017 12:35 (last edited on September 14, 2017 12:42)

Set blank password in database for another admin rights users those having UserPrivilegeLevel=3 using

Update cms_user set userpassword='' where username=@Username OR UserID= @userid

I recommend you to update your kentico 10 with latest hotfix version 10.0.35

Thanks

0 votesVote for this answer Mark as a Correct answer

Jamie O answered on September 14, 2017 12:50

I already tried that and get the same error:

Access denied to resource 'CMS'

Permission for UI element 'Administration' is required.

The hotfix shouldnt affect this simple login, at least according to the list of bugs fixed in the hotfix. I agree the issue is related to permissions and roles but as far as I can see, the administrator user in in the correct admin roles and those admin roles have rows in the RoleUIElement table for the administration ui element as well.

What else could be missing?

1 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on September 15, 2017 14:14

have you tried the emergency admin reset? you add a app key in the web.config that resets a password and sets the level. it's in documentation in password reset (on mobile so hard to link)

1 votesVote for this answer Mark as a Correct answer

Peter Cranston answered on September 25, 2017 12:57

I've had this same issue. I'm upgrading my solution manually, as it's a slightly different file structure and have followed the instructions here. I tried the emergency admin reset, but it resulted in the following server error:

Server Error in '/' Application.

Invalid column name 'UserIsEditor'.
Invalid column name 'UserIsGlobalAdministrator'.
Invalid column name 'UserSiteManagerDisabled'.

I'm aware these columns have been removed as part of the Kentico 10 upgrade, which suggests that there's legacy code/dlls still in my solution.

I've been through the dlls being referenced (they're all v10) and currently double checking the code files, but would be grateful if anyone has any ideas as-to what I might have missed.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on September 25, 2017 15:18

This is probably a big indicator that the manual upgrade failed, did you do both files and database and follow instructions exactly? Easy to miss a step, may need to redo your upgrade :(

1 votesVote for this answer Mark as a Correct answer

Peter Cranston answered on September 27, 2017 16:57

Thanks Trevor, I went through the instructions again and realised that I had indeed missed the step to merge the CMSApp_AppCode project into the main CMSApp project. Having done that, I can now login to admin and the site runs fine.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on September 27, 2017 17:01

Awesome, please mark the answer as correct if it's resolved!

0 votesVote for this answer Mark as a Correct answer

Jamie O answered on September 27, 2017 17:23 (last edited on September 27, 2017 17:24)

It's not resolved by your answer Trevor, because Peter jumped in on my question with his own one...

However, I did manage to resolve the issue outlined in the original question. During the upgrade process it seemed that the UpgradeProcedure.cs was never executed (or even updated to the v10 one) during the upgrade process. I changed my local UpgradeProcedure.cs to the one provided in the upgrade installer directory and forced it to run. After this has ran, I was able to access the administration section.

1 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on September 27, 2017 17:26

Ah, sorry Jamie i did missed that it was another question that was answered, not your original. Glad yours was able to be resolved!

2 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.