Community Server is dependent upon an anonymous user existing within the database for use when non-signed in users are browsing the site and for associating posts with, for instance when users are deleted. This user must exist, and it is also dependent upon the user being named "Anonymous".
Occasionally, it is possible to accidentally delete or rename the Anonymous user, which can severely impair functionality and cause non-authenticated users to not be able to access your site.
In the event you have deleted or renamed the Anonymous user, the error message you would see would look similar to this:
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
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.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
CommunityServer.Components.CSLocation.ThemePage(ReWrittenUrl url) +41
CommunityServer.Urls.Location.GetReWrittenUrl(ReWrittenUrl url, String path, String queryString) +13
CommunityServer.Urls.Location.GetReWrittenUrl(HttpContext context, String path, String queryString) +143
CommunityServer.Urls.UrlReWriteProvider.GetRewrittenUrl(HttpContext context) +140
CommunityServer.CSHttpModule.ReWriteUrl(HttpContext context) +23
CommunityServer.Components.CSContext.ExecuteUrlReWrite() +23
CommunityServer.CSHttpModule.Application_AuthorizeRequest(Object source, EventArgs e) +123
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
If you are encountering this issue, please download and run the attached script against your database. It will check to see if the user was just renamed, and rename it back, or if the user was deleted, it will re-create it. Please read the brief information in the script about setting the UserID and ApplicationName. Most people will not need to change it. You will only need to change it if you are running multiple sites in the same database.
Download Script: Recreate Anonymous User