Error accessing site settings when machinekey is updated

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
10/23/2011 11:35:43 AM
Gravatar
Total Posts 2

Error accessing site settings when machinekey is updated

mojoPortal Version                                 2.3.6.7                 MSSQL

Operating System                 Microsoft Windows NT 6.0.6002 Service Pack 2

ASP.NET Info                 v4.0.30319

 

Hi all,

I have been trying to change my machine key but have only been partially successful.  By that I mean that it changes, but then I can't get into the site settings area after the change.  I get:

We're sorry but a server error has occurred while trying to process your request.

The error has been logged and will be reviewed by our staff as soon as possible. It is possible that the error was just a momentary hiccup and you may wish to use the back button and try again or go back to the home page.

 And the log shows

2011-10-23 11:18:11,739 INFO mojoPortal.Web.Global - Application Started. 2011-10-23 11:18:43,454 ERROR mojoPortal.Web.mojoBasePage - 108.2.119.140-en-US - /Admin/SiteSettings.aspx System.Web.HttpException (0x80004005): Unable to validate data.    at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData)    at System.Web.Security.MembershipAdapter.EncryptOrDecryptData(Boolean encrypt, Byte[] buffer, Boolean useLegacyMode)    at System.Web.Security.MembershipProvider.DecryptPassword(Byte[] encodedPassword)    at mojoPortal.Web.mojoMembershipProvider.UnencodePassword(String pass, MembershipPasswordFormat passwordFormat)    at mojoPortal.Web.SiteUtils.Decrypt(String encrypted)    at mojoPortal.Web.AdminUI.SiteSettingsPage.PopulateMailSettings()    at mojoPortal.Web.AdminUI.SiteSettingsPage.PopulateControls()    at mojoPortal.Web.AdminUI.SiteSettingsPage.Page_Load(Object sender, EventArgs e)    at System.Web.UI.Control.OnLoad(EventArgs e)    at mojoPortal.Web.mojoBasePage.OnLoad(EventArgs e)    at System.Web.UI.Control.LoadRecursive()    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I have tried to update the machinekey in the web.config, and then when that failed, I created a machinekey.config and pointed the web.config to that using <machineKeyconfigSource="machinekey.config" />

Both settings get the same error message on site settings, but everything else seems to work.  Obviously I am missing something or doing something incorrectly, but I can't seem to put my finger on it.  Any suggestions on what to look at?

Thanks in advance.

-Bob

 

10/23/2011 12:06:53 PM
Gravatar
Total Posts 18439

Re: Error accessing site settings when machinekey is updated

Hi Bob,

Its because you have enabled smtp settings in site settings instead of user.config and it also encrypts those credentails with the machine key.

So 2 possible solutions.

1. change back to the old machine key and then go into site settings and clear out the smtp user and password, then change the machine key then go back and put the smtp settings back so they get re-encrypted with the new machine key.

2. See the notes I just added at the bottom of the Use a Custom Machine Key article to see how to fix it in the database.

Hope that helps,

Joe

10/23/2011 1:49:35 PM
Gravatar
Total Posts 2

Re: Error accessing site settings when machinekey is updated

Yep.  That was it.  Worked like a charm. 

Thanks again.  I was stumped.

Regards,

 

Bob

10/24/2011 7:39:15 AM
Gravatar
Total Posts 18439

Re: Error accessing site settings when machinekey is updated

Thanks for the beer Bob! Much appreciated.

Cheers,

Joe

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