Here is the exception details...
Server Error in '/' Application.
Server Out Of Memory
There is no memory on the server to run your program. Please contact your administrator with this problem.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.OutOfMemoryException: Server Out Of Memory
There is no memory on the server to run your program. Please contact your administrator with this problem.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
If a list item is being created or edited by a user who is anonymous and...
- A workflow is set to start whenever a list item is created and/or updated OR
- A custom event receiver is handling the created or updating event for the lsit
[We could probably draw the conclusion that any situation where a custom event receiver or a worflow is executed by the anonymous user will fail.]
So here is the bad news... as of right now, I have never found a fix for this. I had opened a support case with Microsoft and they acknowledged it was an issue but never gave me any confirmation if and when it will be fixed.
And here is the worse news... if you are getting this error because you associated a workflow to a list (reason #1 above), this list will never be able to have an item created/updated by an anonymous user. I told the workflow not to run when an item is created or updated. Didn't work. I deleted the workflow. Didn't work. I tried to back up the list as a template and restore it (with and without the data). Didn't work. I tried to go into the database and delete any associations I could find. Didn't work. I tried a few other things but nothing worked.
I eventually had to recreate all my lists (close to 30) and recreate all the workflows for them, making sure not to set them up to start when an item is created or updated. In my case, I only wanted to start the workflow when an item was created so I ended up putting a Yes/No field in every list indicating whether or not the workflow had been started for it and default it to no. I then created a console application that that would get all list items that had that new field set to 'No' and fire off the workflows manually. I scheduled the console application to run as the SharePoint Administrator in 30 minutes intervals throughtout the day.
In hind sight, If I would of known about this issue up front, I would of created a custom web part or ASP.NET page to do the data entry and just did the actual list manipulation with elevated privelages.
Eventually Microsoft got back to me with this workaround... Use Forms Based Authentication instead of Windows Authentication and create a 'Visitor' Account that anonymouse users would use (without them knowing). Anonymous users would automatically get logged in as 'Visitor' by a HttpModule. The project had already come to an end so I never tried it. But here it is for your viewing pleasure...
Here is a sample of an HTTP module that can be set up with forms based authentication (FBA) so that it logs you in as a visitor account by default. This enables you to control the visitor account just like a normal user account (since it is authenticated), and is transparent to the Sharepoint server.
This code has not been extensively tested, so don't deploy straight to your production environment, test it out thoroughly first. Be sure to set up an account called "Visitor" (It's hard coded that in the sample).
//=================================
using System;
using System.Security;
using System.Security.Principal;
using System.Web;
using System.Web.Security;
namespace HTTPAnonAuth
{
class AnonModule : IHttpModule
{
public void Init(HttpApplication app)
{
app.AuthenticateRequest +=
(new EventHandler(this.Application_AuthenticateRequest));
app.PreSendRequestHeaders +=
(new EventHandler(this.Application_PreSendRequestHeaders));
}
private void Application_AuthenticateRequest(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
if (app.User == null)
{
string[] roles = new string[1];
roles[0] = "GuestUser";
GenericIdentity id = new GenericIdentity("Visitor","Forms");
GenericPrincipal p = new GenericPrincipal(id, roles);
app.Context.User = p;
}
}
private void Application_PreSendRequestHeaders(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
if (app.Response.RedirectLocation != null)
{
if (app.Response.RedirectLocation.Contains("AccessDenied.aspx?Source")
&& app.User.Identity.Name == "Visitor")
{
app.Response.Redirect("/_layouts/login.aspx?ReturnUrl=" + app.Request.RawUrl);
}
}
}
public void Dispose()
{
}
}
}
//=================================
If you do end up using the HttpModule route
OR find a better workaround
OR find a fix, please let me know about it.
Posted
07-12-2008 2:04 PM
by
jscott