Keyset does not exist / Identity invalid

12

Note: I've found several questions similar on here, but the one's that were resolved did not work for me. So I thought I'd open a new question.

I rebooted our server 2012 box, which hosts our new .net applications. After doing so, I started receiving a 503 error. Upon investigation, it seemed like an identity problem.

Before going much further, I should state that this account has worked for several months now. I've rebooted before, and everything started fine.

So I'm getting the (quite common) 5059, 5057, and 5021 errors in the log. They boil down to this:

The identity of application pool SVFileUpload is invalid. The user name or password that is specified for the identity may be incorrect, or the user may not have batch logon rights. If the identity is not corrected, the application pool will be disabled when the application pool receives its first request. If batch logon rights are causing the problem, the identity in the IIS configuration store must be changed after rights have been granted before Windows Process Activation Service (WAS) can retry the logon. If the identity remains invalid after the first request for the application pool is processed, the application pool will be disabled. The data field contains the error number.

I thought I would just ensure the password and account were correct, so I go to the application pool, select identity-> custom and ensure it's set up right. I get an error:

There was an error while performing this operation. Details: Keyset does not exist (Exception from HRESULT: 0x80090016)

This was strange to me, so I tried setting the app pool to a built in account, and it worked fine. I get this error anytime I try to set to a custom account. Also, no app pools that are using custom accounts will run.

I googled a bit, unsure which error was the one I needed to track. I have tried:

  • registering the account on the command line via the aspnet_ tool
  • Making sure the user was in the IIS_IUSRS group
  • changing the permissions on C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys file(s)
  • adding a completely new user and trying to set an app pool to that users account

There was a couple other random things I tried from googling but I don't remember.

This error doesn't make sense to me, and it seems random. I need help figuring out 1) why I can't set an app pool to a custom account and 2) why the identity isn't working for my applications anymore

-Edit
I recently removed and re-added the user account I've been working with. I think that solves that problem. The problem remaining is I can't update the application pool because of the "keyset does not exist" error.

iis
windows-server-2012
asked on Stack Overflow Jul 2, 2014 by loctrice • edited Jul 2, 2014 by loctrice

7 Answers

20

I found a couple of links that led me to a solution.

In c:\windows\system32\inetsrv\config\applicationHost.config I removed all the configProtectedData entries.

Then I removed everything in %ALLUSERSPROFILE%\Microsoft\Crypto\RSA\MachineKeys

I ran iissetup.exe /install SharedLibraries from the inetsrv directory, which resulted in a "Failed = 0x80070005"

I then was able to set up my application pools as if nothing happened.

See also https://techcommunity.microsoft.com/t5/IIS-Support-Blog/Keyset-does-not-exist-exception-from-HRESULT-0x8009000D-or-or/ba-p/342955 for a more detailed explanation

answered on Stack Overflow Jul 2, 2014 by loctrice • edited May 27, 2019 by Florian Winter
6

I ran the iisreset command and my problem was sovled

answered on Stack Overflow Sep 6, 2019 by hossein bakhtiari • edited Sep 6, 2019 by skovy
3

I had the same error-message because my user was not member of the "Local Administrators" group.

I was able to connect to the server because I was member of the "Remote Desktop Users" group.

I was able to open IIS Management and to change settings, but when I clicked on the "OK" or "Save" button - I got the "Keyset does not exist" - error message.

So my advice - check if you are an administrator.

answered on Stack Overflow Mar 28, 2017 by Markus1980Wien
1

I tried to change the Identity of Application Pool on a remote server and it failed with the above error. I RDP into the remote machine and then tried to update the Identity using local IIS Manager and it worked.

answered on Stack Overflow Aug 22, 2017 by Sundeep
1

For anyone on Windows server 2008 stumbling into this error: this may occur when you are managing the IIS instance from another server using the remote management feature ('connect to another computer').

I resolved by managing the IIS instance from the server itself. https://support.microsoft.com/en-hk/help/977754/-keyset-does-not-exist-error-message-when-you-try-to-change-the-identi

answered on Stack Overflow Sep 26, 2017 by rinkeb
0

Since I am working on a fresh server I was able to uninstall the IIS Windows Feature and then re-add it.

I was able to change the App Pool Identity after that with no issues.

answered on Stack Overflow Jan 16, 2020 by Dave
-1

delete the rsa found here C:\Users\usernamn\AppData\Roaming\Microsoft\Crypto\RSA MAKE A BACKUP JUST TO BE SURE WORKED FOR ME

answered on Stack Overflow Jun 18, 2015 by bob

User contributions licensed under CC BY-SA 3.0