Tengo una aplicación ASP.NET 2.0 que funciona bien en nuestro entorno local. Cuando se publica en un servidor de prueba, recibimos errores intermitentes en el servidor."Padding no es válido y no se puede eliminar" excepción en WebResource.axd
Aquí es la más común:
El relleno es válido y no se puede quitar. Descripción: Se produjo una excepción no controlada durante la ejecución de la solicitud web actual. Revise el seguimiento de la pila para obtener más información sobre el error y dónde se originó en el código.
Exception Details: System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[CryptographicException: Padding is invalid and cannot be removed.]
System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) +1545747
System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) +257
System.Security.Cryptography.CryptoStream.FlushFinalBlock() +30 System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo) +164
System.Web.UI.Page.DecryptString(String s) +83
System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +148
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
Esto ocurre a petición de una solicitud WebResource.axd específica.
El otro error que estamos viendo es la siguiente:
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
Este error ocurre de vez en cuando mientras se enviaba una forma.
Ahora antes de saltar y dime la respuesta obvia (habitual) a este error, considere esto:
- La aplicación está implementada en Windows Server 2003 en IIS 6
- no es en una web granja. Solo un servidor web está en uso aquí.
- La identidad del grupo de aplicaciones es una cuenta de servicio personalizada, y ejecuté
aspnet_regiss -ga <username>
en el servidor. Sin efecto.
Agregó una respuesta clara para esto, compruébalo :) – eglasius
¿Algún tipo de solución pero Ben? Tengo 15 informes de Exceptioneer en 25 minutos sobre el primer error que informó. Se suponía que * Rackspace * debía reiniciarse anoche después de instalar fx3.5 sp1 y pensé que eran de eso. Sin embargo, descubrí que "olvidaron" reiniciarlo según nuestro ticket. Aquí hay un enlace a uno de nuestros informes sobre el error: http://exceptioneer.com/Share/Summary.aspx?e5dca865-cb2c-4292-af3f-e9d645a081a7. –
Nunca resolví este problema. Simplemente nunca estuvo en la parte superior de nuestra lista de prioridades. Ahora estoy en un proyecto diferente, así que ... no hay mucha ayuda que yo sepa. –