Padding is invalid and cannot be removed.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 年 前
Hi,

I'm regularly getting 2 errors on our site that we just installed on GoDaddy. Is anyone familiar with them and know a fix. They are happening all the time and filling up the log.

Thanks
Dawn

~~~~~~~~~~~~~~~~~
One of the errors:
~~~~~~~~~~~~~~~~~~
Log type:  Unknown  
Severity:  11  
Message:  Padding is invalid and cannot be removed.  
Exception:  System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)  
IP address:  216.104.15.134  
Customer:  
Page URL:  http://ec.ccgmp.info/ec/WebResource.axd?d=j_8VvmpMy6iy7RMhj93Tan-87ZRdV08cnbmrhwzlYWLtAaDUv4K1hZJD7a  
Created on:  9/22/2009 1:11:25 PM  

~~~~~~~~~~~~~~~~~
The other error:
~~~~~~~~~~~~~~~~~~
Log type:  Unknown  
Severity:  11  
Message:  This is an invalid script resource request.  
Exception:  System.Web.HttpException: This is an invalid script resource request. ---> System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) at System.Web.UI.Page.DecryptString(String s) at System.Web.Handlers.ScriptResourceHandler.DecryptParameter(NameValueCollection queryString) --- End of inner exception stack trace --- at System.Web.Handlers.ScriptResourceHandler.DecryptParameter(NameValueCollection queryString) at System.Web.Handlers.ScriptResourceHandler.ProcessRequestInternal(HttpResponse response, NameValueCollection queryString, VirtualFileReader fileReader) at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context) at System.Web.Handlers.ScriptResourceHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)  
IP address:  216.104.15.138  
Customer:  
Page URL:  http://ec.ccgmp.info/ec/ScriptResource.axd?d=_4t90Ingdx5OI6RXY58mblhdzxOo2kXtj-deofo4N5MiEeOF2eOVcnz  
Created on:  9/22/2009 3:56:30 PM
14 年 前
Not positive it's working, but we were getting the error so frequently that I think it is working. I used the information at this link to set a machineKey. It wasn't needed locally, but it is needed on GoDaddy.

http://www.developmentnow.com/blog/InvalidViewstate+Or+Unable+To+Validate+Data+Error.aspx
14 年 前
I'm getting the same error on padding
Plus I get a mail error MailError
[The severity of the log entry.] Severity:   11
[The log entry message.] Message:   Error sending e-mail. Mailbox name not allowed. The server response was: sorry, your mail was administratively denied. (#5.7.1)
[The exception details for the log entry.] Exception:   System.Net.Mail.SmtpException: Mailbox name not allowed. The server response was: sorry, your mail was administratively denied. (#5.7.1) at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at NopSolutions.NopCommerce.Common.Messages.MessageManager.SendEmail(String Subject, String Body, MailAddress From, MailAddress To, List`1 bcc, List`1 cc) in D:\Work\Own\NopCommerce\Solution\Solution\Libraries\Nop.Common\Messages\MessageManager.cs:line 790 at NopSolutions.NopCommerce.Common.Messages.SendQueuedMessagesTask.Execute(XmlNode node) in D:\Work\Own\NopCommerce\Solution\Solution\Libraries\Nop.Common\Messages\SendQueuedMessagesTask.cs:line 61
14 年 前
I got that error too. I ended up changing the code for btnContactUs_Click in Modules/ContactUs.ascx.cs to what is below. Not very clever, but it worked.

        protected void btnContactUs_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    if (String.IsNullOrEmpty(txtEnquiry.Text))
                        return;
                    string email = txtEmail.Text.Trim();
                    string fullName = txtFullName.Text.Trim();
                    string subject = "Contact us form";
                    string body = txtEnquiry.Text.Trim();
                    //DH 11/2/2009
                    //Pre-Append "from" to body
                    string sFrom = "From: " + fullName + "(<a href=\"mailto:" + email + "\">" + email + "</a>)";
                    sFrom = HtmlHelper.FormatText(sFrom, false, false, true, false, false, false);
                    body = CommonHelper.FormatContactUsFormText(body);
                    body = sFrom + "<br /><br />" + body;
                    
                    //DH 11/2/2009
                    //Change from to equal to because from is not working on GoDaddy.
                    //(domain doesn't match URL)
                    //MailAddress from = new MailAddress(email, fullName);
                    //Replace from with to (both will be the same)
                    MailAddress from = new MailAddress(MessageManager.AdminEmailAddress, MessageManager.AdminEmailDisplayName);
                    MailAddress to = new MailAddress(MessageManager.AdminEmailAddress, MessageManager.AdminEmailDisplayName);
                    MessageManager.InsertQueuedEmail(5, from, to, string.Empty, string.Empty, subject, body, DateTime.Now, 0, null);

                    pnlResult.Visible = true;
                    pnlContactUs.Visible = false;
                }
                catch (Exception exc)
                {
                    LogManager.InsertLog(LogTypeEnum.MailError, string.Format("Error sending \"Contact us\" email."), exc);
                }
            }
        }
14 年 前
hi any one able to fix this error?

Padding is invalid and cannot be removed

Please help, I get this error everyday.

Thanks
Atiq
14 年 前
me too. got about 20 just for one day. Any suggestion?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.