Site Settings command does not work in 2.6

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.
1/1/2018 3:40:52 AM
Gravatar
Total Posts 26
regards, Svein-Martin Holt Norway

Site Settings command does not work in 2.6

I have problems running the Administration>Site Settings command after upgraded to mojoportal 2.6 today. In the log file it say something about Unable to validate data with the Machine Key.

I have entered a new Machine Key so any security problems should have been solved. I did not test the command before i cganged the key.

I have another site I have updated for some months ago, and no problem with that site.

I hope you can look into this, please.

 

Here is the logfile content below:

 

Regards,

Svein-Martin Holt

----------------LOG:

2018-01-01 03:32:27,955 ERROR 81.166.156.85 - en-US - /Admin/SiteSettings.aspx - mojoPortal.Web.Global - 81.166.156.85 /Admin/SiteSettings.aspx Referrer(http://www.platelayer.com/Admin/AdminMenu.aspx) useragent Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko 
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)
 

1/2/2018 8:04:00 AM
Gravatar
Total Posts 47

Re: Site Settings command does not work in 2.6

If I remember well, there was an advice regarding the oppurtunity and consequences of changing the machine key. here is the link https://www.mojoportal.com/Forums/Thread.aspx?pageid=5&t=6392~1

I hope it helps.

 

Mari

1/3/2018 11:45:13 AM
Gravatar
Total Posts 26
regards, Svein-Martin Holt Norway

Re: Site Settings command does not work in 2.6

I have never had problems updating before, so why should it be a problem now? I have used mojoportal since 2010 and have upgraded from time to time. The entry referered in the above answer is 7 years old so I wonder if this can be valid on the newest  version?

i have checked to run with the original web.config from the software download, the same problem occurs. 

May be I shall try to USE the old machine key from my backup before upgrade?

1/3/2018 12:10:02 PM
Gravatar
Total Posts 2239

Re: Site Settings command does not work in 2.6

Hi,

Did you enable the option to show SMTP Settings in Site Settings? 

That's the only part of the Site Settings page that uses the machine key.

You should always use your existing (old) machine key when upgrading a site.  See the upgrade documentation and the machine key documentation.

Thanks,
Joe

1/3/2018 12:49:07 PM
Gravatar
Total Posts 26
regards, Svein-Martin Holt Norway

Re: Site Settings command does not work in 2.6

Hi,

 

Thank you for yor answer.

 

I used the old machinekey when upgrading, generated a new key and changed that in the web.config file. The securty warning is then turned off.

I have not changed anything in the SMTP or anything else between 25 and 26 version. I have run 25 for some time without any problems.

I have also installed the original machinekey from the 26 download, still same problem.(And now the security warning is back of course)

I have checked in the password setting, that I don't use encrypting in the password.(Which were talked about in the first answer)

I have the old version of the site running on http://mojo25.platelayer.com.

The site with problem is: http://www.platelayer.com

The only thing I did upgrading was to copy the wwwroot from http://mojo25.platelayer.com, took a backup of the database, restored it in a new database, run the config.aspx, changed the machinekey after generated a new one. And then got this problem with the administration menu and some other menus, but I can change content on the pages as normal. I did not check if I had the problem before I changed the key.

I downloaded from your site the new version, but may be there are some differences in the earlier download that I use in the other site without any problems, that I upgraded some weeks ago: http://mojo26.drodle.biz

 

regards, Svein-Martin

 

1/3/2018 1:16:29 PM
Gravatar
Total Posts 26
regards, Svein-Martin Holt Norway

Re: Site Settings command does not work in 2.6

Hi again

 

I think I found the problem.

 

In my user.config file I have only set this:

 

<add key="EnableSiteSettingsSmtpSettings" value="true" />

If I set that to false, everything works fine.

 

Then I need to check the newest version of the user.config in the download, and include any smtp settings and others into my own user.config file.

Joe, your sentence about smtp-setting did it. And I also saw some differences in the SMTP Menus setting for the different sites.

 

So I guess this request can be closed.

 

Regards, SVein-Martin

1/3/2018 1:30:08 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Site Settings command does not work in 2.6

That's what Joe meant about the machine key being used with SMTP settings in the site. If you like being able to edit SMTP settings from the Administration pages, you should be able to leave that EnableSiteSettingsSmtpSettings true in user.config, and switch back to using your previous machine key in web.config (if you still have it recorded).

1/4/2018 1:54:11 PM
Gravatar
Total Posts 2239

Re: Site Settings command does not work in 2.6

Hi Sven,

Yes, Jamie explained it well. 

You really need to keep the same machine key through upgrades. If you have the default machine key or would like to switch to a different stronger hash algorithm, you need to be sure to enable clear text or hashed password and remove the smtp settings, change the machine key and then set those settings back (do switch back to encrypted or clear text from hashed passwords b/c this will cause every password to be reset).

Thanks,
Joe

9/20/2018 9:57:26 PM
Gravatar
Total Posts 218

Re: Site Settings command does not work in 2.6

I've tried everything and can't get past this site settings bug in 2.6 (.net 4.6.2). I used the same machine key, everything upgraded as I always have and yet get an error on site setting page.

If I set <add key="EnableSiteSettingsSmtpSettings" value="false" /> then it works, but that's no good as I have a multi-site install. I've tried the upgrade multiple times with no luck.

Any ideas? Banging my head against the wall. Error is below.

 

2018-09-20 21:53:06,567 ERROR 65.30.35.12 - en-US - /Admin/SiteSettings.aspx - mojoPortal.Web.Global -  Referrer(xxxxxxxxxxxxxxxxxxxxxxxxx) useragent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
   at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64String(String s)
   at mojoPortal.Web.mojoMembershipProvider.UnencodePassword(String pass, MembershipPasswordFormat passwordFormat)
   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()

9/20/2018 11:18:00 PM
Gravatar
Total Posts 218

Re: Site Settings command does not work in 2.6

I did figure out that if I go into the database table (mp_SiteSettingsEx) and delete the data in the "SMTPUser" and "SMTPPassword" fields for all sites then I can pull up the settings area in the web admin and re-enter that data.

It's a work-around, but a pain and would be a tough nut to crack for many people upgrading.

9/21/2018 9:52:34 AM
Gravatar
Total Posts 2239

Re: Site Settings command does not work in 2.6

Hi Eric,

Can you send me a backup of this database? I would like to see if I can figure out why you were having this trouble.

Thank you,
Joe

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