System.Security.Cryptography.CryptographicException: Not enough storage is available to process this command

StackOverflow https://stackoverflow.com/questions/23499216

Domanda

Our asp.net app was working fine, then the DBA decided to encrypt the db password in the web.config. Now I'm getting this error:

System.Security.Cryptography.CryptographicException: Not enough storage is available to process this command.

There is only one other article on SO that has this error listed and the user resorted to a refactor instead of identifying a solution.

The weird thing is that we have plenty of space (RAM, HDD, etc). Even more weird, three of the people on my team don't have this problem (with the exact same url). Another guy had it yesterday, but it works today.

I'm worried about when we move this to prod. Especially, if this needs some kind of incremental storage or permissions for EACH user.

Edit: The other error that seems to show up is:

"Failed to decrypt using provider 'RsaProtectedConfigurationProvider'"
È stato utile?

Soluzione

It turns out that this is a generic error message that happens whenever the server has trouble decrypting with RSA. Not very helpful, because it is misleading (at worst) and at best, very vague.

For us, the error was only happening for me because our dev servers are load-balanced (which I didn't know till today). The encryption key was generated on one machine (server1) and installed on both servers. When I got load-balanced onto server2, I see this error (so would anyone else on server2).

The solution is to export the private key from server1 and install it onto server2.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top