Unable to update site settings

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
10/26/2012 7:09:39 AM
Gravatar
Total Posts 167

Unable to update site settings

Hi,

I have an issue with several (but not all) sites within one of my mojoportal instalations.

This only seams to affect the sitesetting part of the administration menu.

When I select Site administration I get directed to the error page. I have looked at the log and custom errors and found the messages pasted below.

I noticed the security needed attention (which I believe I already had so I have fixed this again but has not resolved the porblem.

Any suggestions?

2012-10-26 12:56:32,222 ERROR 77.96.116.230 - en-US - /Admin/SiteSettings.aspx - mojoPortal.Web.Global - 77.96.116.230 /Admin/SiteSettings.aspx Referrer(http://www.acvita.com/Admin/AdminMenu.aspx) useragent Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
System.Web.HttpException (0x80004005): Unable to validate data.

[HttpException (0x80004005): Unable to validate data.]
System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData) +4961431
System.Web.Security.MembershipAdapter.EncryptOrDecryptData(Boolean encrypt, Byte[] buffer, Boolean useLegacyMode) +69
System.Web.Security.MembershipProvider.DecryptPassword(Byte[] encodedPassword) +15351
mojoPortal.Web.mojoMembershipProvider.UnencodePassword(String pass, MembershipPasswordFormat passwordFormat) +76
mojoPortal.Web.AdminUI.SiteSettingsPage.PopulateMailSettings() +448
mojoPortal.Web.AdminUI.SiteSettingsPage.PopulateControls() +7876
mojoPortal.Web.mojoBasePage.OnLoad(EventArgs e) +18
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

10/26/2012 8:51:58 AM
Gravatar
Total Posts 18439

Re: Unable to update site settings

Hi,

The problem is that your smtp settings previously entered in Site Settings were encrypted with your previous machine key and now cannot be decrypted with the new one so it throws an error. This problem should affect all sites that have smtp settings entered in site settings.

There are 2 ways the problem can be solved.

1. Temporarily restore the previous machine key, then go into site settings copy your smtp user and password and then clear them out, then restore the new machine key and re-enter the smtp user and password in site settings. If you don't have a record of the smtp settings for each site anywhere else then this is the way to go.

2. You could clear out those settings with a database query then restore them in Site Settings so they will be encrypted with the new machine key. This solution is only possible if you know what those settings are for each site.

UPDATE mp_SiteSettingsEx
SET KeyValue = ''
WHERE KeyName = 'SMTPUser' OR KeyName = 'SMTPPassword'

Hope that helps,

Joe

10/26/2012 11:09:28 AM
Gravatar
Total Posts 167

Re: Unable to update site settings

I had seen similar on a previous forum log, but as I was not changing SMTP setting I thought it would not apply. But all sites that are affected are the ones with email so spot on.

Oops, Thought I'd update the machine key through IIS this time so don't have a record of the old key.

Thanks for that, all site are being fixed now

10/26/2012 11:12:48 AM
Gravatar
Total Posts 18439

Re: Unable to update site settings

The old key was probably the default key in the Web.config file that ships with mojoPortal. So you could get that one back if needed.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.