Server Error in '/' Application while Saving Site Settings

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

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.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
1/5/2012 9:10:59 AM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

Server Error in '/' Application while Saving Site Settings

Hi Joe,

I have just updated to version 2.3.7.6 all installations hosted on my server (and several hosted by providers) and noticed that for two of them I get an error when saving the site settings (even without changing any data).

Any ideas about what I can check/fix to overcome the issue ?

This is the error form mojoPortal System Log:

2012-01-05 15:44:36,371 ERROR 192.168.3.127 - en-US - /Admin/SiteSettings.aspx - mojoPortal.Web.mojoBasePage - 192.168.3.127-en-US - /Admin/SiteSettings.aspx   System.Web.HttpException (0x80004005): The URL-encoded form data is not valid. ---> System.InvalidOperationException: Operation is not valid due to the current state of the object.

at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding)

at System.Web.HttpRequest.FillInFormCollection()

at System.Web.HttpRequest.FillInFormCollection()

at System.Web.HttpRequest.get_Form()

at System.Web.HttpRequest.get_HasForm()

at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)

at System.Web.UI.Page.DeterminePostBackMode()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

2012-01-05 15:44:36,393 ERROR 192.168.3.127 - en-US - /Admin/SiteSettings.aspx - mojoPortal.Web.Global - 192.168.3.127 /Admin/SiteSettings.aspx Referrer(http://mojoportal.effectiveweb.it/Admin/SiteSettings.aspx) useragent Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0

System.Web.HttpException (0x80004005): The URL-encoded form data is not valid. ---> System.InvalidOperationException: Operation is not valid due to the current state of the object.

at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding)

at System.Web.HttpRequest.FillInFormCollection()

at System.Web.HttpRequest.FillInFormCollection()

at System.Web.HttpRequest.get_Form()

at System.Web.HttpRequest.get_HasForm()

at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)

at System.Web.UI.Page.DeterminePostBackMode()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

mojoPortal Version 2.3.7.6 MSSQL
Operating System Microsoft Windows NT 6.0.6002 Service Pack 2
ASP.NET Info v4.0.30319 Running in Full Trust

1/5/2012 9:19:43 AM
Gravatar
Total Posts 18439

Re: Server Error in '/' Application while Saving Site Settings

Hi Diego,

This is actually the result of a change from a recent ASP.NET security update. It happens because you have a lot of roles and with the checkboxlists for all the permissions under the permissions tab combinned with all the other form elements it adds up to more than 1000 form elements. The ASP.NET security update set a limit of 1000 and this error happens if there are more than 1000.

I've already fixed this in our source code repository by moving the permissions out of site settings into separate pages to reduce the number of form elements. I will make a new release  very soon with this change, but there is an immediate workaround you can use until then. You can put this in user.config

<add key="aspnet:MaxHttpCollectionKeys" value="1500"/>

you may need to experiment with the number depending on how many roles you have, maybe try 2000, and then reduce it as low as possible until the error returns and then put it a little higher so the error does not happen.

You might also review your roles and if you have some that are no longer used remove them.

Best,

Joe

1/5/2012 9:34:49 AM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

Re: Server Error in '/' Application while Saving Site Settings

Thanks!!!

It works just with 1500.

That also explains the erraic error we got from another custom module.

I will use the suggested workaround when needed until the new release is available.

Best Regards!

Diego

1/5/2012 9:39:25 AM
Gravatar
Total Posts 18439

Re: Server Error in '/' Application while Saving Site Settings

Hi Diego,

I would still reduce it as much as possible, the default is 1000 so it will have to be a number higher than that, but if 1100 works I'd use 1100 instead of 1500. 

Best,

Joe

1/11/2012 8:55:31 PM
Gravatar
Total Posts 4

Re: Server Error in '/' Application while Saving Site Settings

Thanks for this... it solved the same issue for me.  I was able to get away with 1100, no problem.

  <add key="aspnet:MaxHttpCollectionKeys" value="1100"/>

Andrew

1/12/2012 8:15:59 AM
Gravatar
Total Posts 3

Re: Server Error in '/' Application while Saving Site Settings

I got the same error on Modulesetting.aspx page when I tried to Save my settings.

I also added

<add key="aspnet:MaxHttpCollectionKeys" value="2100"/>

as per guidence, but it wont work.

 operating system: windows 2008 R2 MSSQL

 

Looking for help.

 

Thanks in advance

1/12/2012 11:55:26 AM
Gravatar
Total Posts 18439

Re: Server Error in '/' Application while Saving Site Settings

Hi,

Is it a custom feature?

How many settings does the feature have?

How many roles do you have?

I think you will have to increase the number until the error stops happening. 

Hope that helps,

Joe

1/12/2012 5:38:19 PM
Gravatar
Total Posts 1204
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Server Error in '/' Application while Saving Site Settings

Hi Joe, unfortunately we just came across another area of the system that is impacted big time by this ASP.NET update: The Content Manager publishing page. My webmaster brought me this same error--she was getting it when trying to publish a content instance to a page (error happens as soon as she hits the green + icon).

I was able to get Publish to work for our site by setting aspnet:MaxHttpCollectionKeys to 3000 (2,500 still didn't work).

For reference, we have 942 items in mp_pagemodules for the site. It seems that to work around the issue with this page, aspnet:MaxHttpCollectionKeys needs to be set to higher than three times the number of pagemodules for a site, so any site with more than 333 modules would be affected.

Thanks,
Jamie

1/13/2012 7:43:49 AM
Gravatar
Total Posts 18439

Re: Server Error in '/' Application while Saving Site Settings

Hi Jamie,

Thanks for letting me know, I'll look into a fix for this. However, I think it is based on the total number of pages not pagemodules because on that page one module is represented and the rows are per page, pagemodules only represent the rows that are published.

Best,

Joe

1/17/2012 9:41:41 AM
Gravatar
Total Posts 1204
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Server Error in '/' Application while Saving Site Settings

Thanks Joe. If it helps your testing, we have 777 pages in the affected site right now.

Jamie

1/17/2012 9:56:11 AM
Gravatar
Total Posts 18439

Re: Server Error in '/' Application while Saving Site Settings

Hi Jamie,

After looking into it I realized it doesn't correspond exactly to the number of items because its the hidden viewstate fields (required to support grid events) that start to add up in addition to the actual form elements needed for each row such as the image button per page row. The number of viewstate fields can be affected by configuration on the <pages maxPageStateFieldLength="100" 

We use a small size (100) mainly because some mobile browsers will ignore hidden fields if they are very large, but we probably could go higher than 100 if needed to reduce the number of hidden fields.

I've got a solution for it already in my branch in the repository that should be in the default branch in the next day or so. Basically if the number of pages is higher than a config setting (default is 150) it will change the functionality such that when you click the button it opens a dialog page instead of going into edit mode of the grid. That way there is no change for small sites.

Best,

Joe

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