I have our site configured as member-only (users must log in before going to any page). However, it seems that going to the login page and/or being redirected to the login page still creates anonymous user records in the ac_User database. On Friday, we got several sets of entries in the error log similar to these:
Several notes:2014-06-20 09:36:59,451 ERROR niqueResultException query did not return a unique result: 2
2014-06-20 09:36:59,649 ERROR AbleCommerce An error has occured at https://_._.com/login.aspx?ReturnUrl=/Members/MyOrder.aspx?OrderNumber=10225&OrderNumber=10225
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> NHibernate.NonUniqueResultException: query did not return a unique result: 2
at NHibernate.Impl.AbstractQueryImpl.UniqueElement(IList list)
at NHibernate.Impl.CriteriaImpl.UniqueResult[T]()
at CommerceBuilder.Users.UserRepository.LoadForUserName(String userName, Boolean createMissing)
at CommerceBuilder.Services.Membership.WebUserLocator.Locate()
at CommerceBuilder.Common.AbleContext.get_User()
at AbleCommerce.ConLib.StoreHeader.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
2014-06-20 09:36:59,747 ERROR niqueResultException query did not return a unique result: 2
2014-06-20 09:37:02,769 ERROR niqueResultException query did not return a unique result: 2
2014-06-20 09:37:02,769 ERROR AbleCommerce An error has occured at http://_._.com/Errors/GeneralError.aspx?aspxerrorpath=/login.aspx
NHibernate.NonUniqueResultException: query did not return a unique result: 2
at NHibernate.Impl.AbstractQueryImpl.UniqueElement(IList list)
at NHibernate.Impl.CriteriaImpl.UniqueResult[T]()
at CommerceBuilder.Users.UserRepository.LoadForUserName(String userName, Boolean createMissing)
at CommerceBuilder.Services.Membership.WebUserLocator.Locate()
at CommerceBuilder.Common.AbleContext.get_User()
at CommerceBuilder.Services.PageTracker.Track(HttpApplication application, HttpContext context)
at CommerceBuilder.Services.HttpModule.a(Object A_0, EventArgs A_1)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
1. I replaced our actual web site domain name with _._.com; the full correct name is in the error log.
2. The forum is shortening the URLs in the error message and creating links; the error log has the full URLs.
2. The entries that start with the timestamp, then "ERROR niqueResultException" do not show up in the Admin "Vew Error Log" page, just in the app.log file. The "U" is actually missing from "UniqueResultException" in all these lines.
I looked in the ac_Users table and there were 2 different anonymous users with the same UserName value (the random GUID-type number). Any idea what would cause this? The user getting the error was using FireFox, although I have no way of knowing if that contributed to the cause of the error. They have "real" user info in the ac_Users table and have used the site before without problems. I'm considering adding a unique constraint to the UserName column of the ac_Users table, would that cause any problems elsewhere in AbleCommerce, or potential problems during future updates?