Cannot Access Webpages through Admin Console

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
rlopez
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 96
Joined: Mon Mar 15, 2004 1:08 pm
Contact:

Cannot Access Webpages through Admin Console

Post by rlopez » Tue Apr 09, 2019 9:41 am

We recently had to move our production database to a new server (Thanks Mike for your help!) and all is running well since. However, it has come to my attention (from Google) that webpages is not accessible in the Admin console. After clicking on the button, it looks, but then returns a soft error that says This page cannot be accessed, please contact sales@XXXX for help. However, all other area's are accessible, including Themes, Layouts, Castagory, Product pages and indexes. I searched the Gold blogs here, but found nothing. Is there another step that needs to be completed when moving a database to a new server? I'm thinking that I need to re-install the backup key? If anyone has had this problem in the past, please give your input.

Thanks
Ricky
Rick L.
https://www.boatingsolutions.com
We make boat repair easy!

rlopez
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 96
Joined: Mon Mar 15, 2004 1:08 pm
Contact:

Re: Cannot Access Webpages through Admin Console

Post by rlopez » Wed Apr 10, 2019 11:00 pm

More information I wanted to post regarding the move of our database to a new server. We run GoldR12SR2 (build 9476). The new data server is running 2016 SQl Express and the database was restored from a 2008R2 SQL server. As of now I'm getting errors in our logs and I wanted to share one here to see if anyone has input on this. What I believe I'm seeing is a write error to the database? I am not a SQL pro so it's hard to tell 100% what is happening. When trying to build/access our sitemap it errors. See below

Any feedback would be great.

Code: Select all

Message: An error has occured at https://xxx.com/Admin/SEO/Sitemap.aspx
Exception: Request timed out.
Stack Trace: 
Date: 4/10/2019 11:30:57 PM
Severity: Error
Message: Unable to save page view record. Exception has been thrown by the target of an invocation.
Exception: Exception has been thrown by the target of an invocation.
Stack Trace:    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at CommerceBuilder.DomainModel.EntityWithTypedId`1.Save()
   at CommerceBuilder.Services.PageTracker.a(HttpApplication A_0, HttpContext A_1)
Inner Exception: could not insert: [CommerceBuilder.Reporting.PageView][SQL: INSERT INTO ac_PageViews (StoreId, ActivityDate, RemoteIP, RequestMethod, UserId, UriStem, UriQuery, TimeTaken, UserAgent, Referrer, CatalogNodeId, CatalogNodeTypeId, Browser, BrowserName, BrowserPlatform, BrowserVersion, AffiliateId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); select SCOPE_IDENTITY()]
Inner Exception Stack Trace:    at NHibernate.Id.Insert.AbstractReturningDelegate.PerformInsert(SqlCommandInfo insertSQL, ISessionImplementor session, IBinder binder)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object[] fields, Object obj, ISessionImplementor session)
   at NHibernate.Action.EntityIdentityInsertAction.Execute()
   at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
   at NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
   at CommerceBuilder.DomainModel.SaveOrUpdateEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.SaveOrUpdate(Object obj)
   at CommerceBuilder.DomainModel.RepositoryWithTypedId`2.Save(TEntity item)
   at CommerceBuilder.DomainModel.Repository`1.Save(TEntity item)
Inner Exception: could not insert: [CommerceBuilder.Reporting.PageView][SQL: INSERT INTO ac_PageViews (StoreId, ActivityDate, RemoteIP, RequestMethod, UserId, UriStem, UriQuery, TimeTaken, UserAgent, Referrer, CatalogNodeId, CatalogNodeTypeId, Browser, BrowserName, BrowserPlatform, BrowserVersion, AffiliateId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); select SCOPE_IDENTITY()]
Inner Exception Stack Trace:    at NHibernate.Id.Insert.AbstractReturningDelegate.PerformInsert(SqlCommandInfo insertSQL, ISessionImplementor session, IBinder binder)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object[] fields, Object obj, ISessionImplementor session)
   at NHibernate.Action.EntityIdentityInsertAction.Execute()
   at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
   at NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
   at CommerceBuilder.DomainModel.SaveOrUpdateEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.SaveOrUpdate(Object obj)
   at CommerceBuilder.DomainModel.RepositoryWithTypedId`2.Save(TEntity item)
   at CommerceBuilder.DomainModel.Repository`1.Save(TEntity item)
Inner Exception: could not insert: [CommerceBuilder.Reporting.PageView][SQL: INSERT INTO ac_PageViews (StoreId, ActivityDate, RemoteIP, RequestMethod, UserId, UriStem, UriQuery, TimeTaken, UserAgent, Referrer, CatalogNodeId, CatalogNodeTypeId, Browser, BrowserName, BrowserPlatform, BrowserVersion, AffiliateId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); select SCOPE_IDENTITY()]
Inner Exception Stack Trace:    at NHibernate.Id.Insert.AbstractReturningDelegate.PerformInsert(SqlCommandInfo insertSQL, ISessionImplementor session, IBinder binder)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object[] fields, Object obj, ISessionImplementor session)
   at NHibernate.Action.EntityIdentityInsertAction.Execute()
   at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
   at NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
   at CommerceBuilder.DomainModel.SaveOrUpdateEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.SaveOrUpdate(Object obj)
   at CommerceBuilder.DomainModel.RepositoryWithTypedId`2.Save(TEntity item)
   at CommerceBuilder.DomainModel.Repository`1.Save(TEntity item)
Rick L.
https://www.boatingsolutions.com
We make boat repair easy!

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: Cannot Access Webpages through Admin Console

Post by jguengerich » Wed Apr 10, 2019 11:43 pm

That is definitely an error trying to insert a record into the ac_PageViews table.

I guess the most basic thing to check is to make sure the ac_PageViews table exists, and that the column names match what you are seeing in the INSERT statement in the error log - there will be a PageViewId column, but the rest of the columns should match (StoreId, ActivtyDate, etc.). I doubt that is the problem, though, because you would be getting the same error for every page a customer visited if the problem was a missing table or incorrect table definition.

Assuming the table is there and is correct, you could try inserting a record yourself using SQL Server Management Studio and see if you get an error, which may give more info about the cause of the error. However, without knowing the exact values the live site is trying to insert when the error occurs, you can't test the exact insert statement causing the error. It may be that it is trying put a null in one of the fields that can't be null.

Not sure what else to suggest, hopefully someone else will have some ideas.
Jay

rlopez
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 96
Joined: Mon Mar 15, 2004 1:08 pm
Contact:

Re: Cannot Access Webpages through Admin Console

Post by rlopez » Thu Apr 11, 2019 12:07 am

Jay,

Thank you for your feedback. You are correct. Cart is running i.e. but my problem is within the admin when trying update Dynamic pages, google feed, XML sitemap via Admin user. So I will try and inserting a record myself, direct through SQL and see what error's are thrown.

Thanks again for your help.
Rick L.
https://www.boatingsolutions.com
We make boat repair easy!

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: Cannot Access Webpages through Admin Console

Post by jguengerich » Thu Apr 11, 2019 2:09 am

Something odd I just realized, on my installation Admin pages are not included in the page tracking, so I'm not sure why your site is trying to insert in the ac_PageViews table when accessing an Admin page. I'm not sure what causes it to not track Admin pages, there's nothing obvious in the source code, config files, or store settings. As a temporary work-around, you could try turning off Page Tracking (Configure > Store > Page Tracking, Enable Tracking checkbox), but according to the note on that screen, "many features require it to work". There is a list here
http://help.ablecommerce.com/mergedProj ... acking.htm
under "Impacts of Page Tracking" - includes things like recently viewed and popular products and categories.
Jay

rlopez
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 96
Joined: Mon Mar 15, 2004 1:08 pm
Contact:

Re: Cannot Access Webpages through Admin Console

Post by rlopez » Fri Apr 12, 2019 1:40 am

It turns out that the problem I'm having is a user logon issue with the SQL Server. I've checked the connection string and is ok (site is running) Today checking logs, through Able admin, there were 918 errors thrown since last night. These errors appear to be generated during server backup in the early morning hours. It appears the backup is looking for a Search Function and a Product Function.

Here is the Able Logged Error

Code: Select all

2019-04-12 01:33:26,519 ERROR AbleCommerce         An error has occured at https://XXXX/Search.aspx?m=101&p=50&ps=12&s=Name%2BASC
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 CommerceBuilder.Search.Providers.SearchProviderBase.AdvancedSearchCount(String keyword, Int32 categoryId, Int32 manufacturerId, Boolean searchName, Boolean searchDescription, Boolean searchSKU, Decimal lowPrice, Decimal highPrice, Boolean onlyFeatured, IList`1 choices)
   at CommerceBuilder.Products.ProductRepository.AdvancedSearchCount(String keyword, Int32 categoryId, Int32 manufacturerId, Boolean searchName, Boolean searchDescription, Boolean searchSKU, Decimal lowPrice, Decimal highPrice, Boolean onlyFeatured, IList`1 choices)
   at CommerceBuilder.Products.ProductDataSource.AdvancedSearchCount(String keyword, Int32 categoryId, Int32 manufacturerId, Boolean searchName, Boolean searchDescription, Boolean searchSKU, Decimal lowPrice, Decimal highPrice, Boolean onlyFeatured, IList`1 choices)
   at AbleCommerce.Search.InitializePagingVars(Boolean forceRefresh)
   at AbleCommerce.Search.BindSearchResultsPanel()
   at AbleCommerce.Search.Page_Load(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   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.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
2019-04-12 01:33:26,566 ERROR niqueResultException query did not return a unique result: 2
2019-04-12 01:33:30,201 ERROR niqueResultException query did not return a unique result: 2


Here is the error log for a Product

Code: Select all

2019-04-12 01:33:30,201 ERROR AbleCommerce         An error has occured at https://XXXXXX/product.aspx?productid=15620
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.ProductPage.Page_PreInit(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Web.UI.Page.OnPreInit(EventArgs e)
   at System.Web.UI.Page.PerformPreInit()
   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.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Here is the SQL Error Log that is indicating a user logon that is failing

Code: Select all

Logon Error: 18456, Severity: 14, State: 38. 2019-04-11 19:59:11.01 Logon Login failed for user 'XXXXXXX'. 
Reason: Failed to open the explicitly specified database 'XXXXXXX'. 
[CLIENT: XX.XXX.XXX.XX]
I believe it is the SQL User settings. I'll post back when I have the final answer to this issue. As a Note from my original post. The Dynamic webpages were not accessible under webpages in the admin earlier this week. However, I did locate them under the custom extensions. Well as of today they are now accessible under webpages!!!! Gremlins...
Rick L.
https://www.boatingsolutions.com
We make boat repair easy!

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: Cannot Access Webpages through Admin Console

Post by jguengerich » Fri Apr 12, 2019 1:57 am

Those first two errors look like a user is trying to access the Search page or a Product page, but that user's username is in the database twice. You probably should check your ac_Users table for multiple records with the same value in the UserName column. Not sure how that would happen. It might be an anonymous user, where the UserName is a long series of numbers and letters. You'll have to delete one, but if they both have orders already (lookup using the UserId field in the ac_Orders table), you'll have to decide how to handle that.

The web site only logs in to the SQL database using the connection string specified in the settings, so you are probably right that the 3rd error is something else trying to connect to the database, like a backup.
Jay

rlopez
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 96
Joined: Mon Mar 15, 2004 1:08 pm
Contact:

Re: Cannot Access Webpages through Admin Console

Post by rlopez » Fri Apr 19, 2019 7:29 am

After evaluating, testing and monitoring logs for over a week now. The answer to my issues were Authentication. It was a trust issue between IIS and a new 2016 box. I had to raise authentication on the new 2016 box to trust the old IIS. I do know that this 2008 R2 database bypassed any earlier upgrades and went straight to SQL 2016 using just a restore. I have not changed the Compatibility Level yet from 2008 (100) to 2016 (130). Will test first. Still have some post work to do and will continue to monitor. Thanks again Jay for your help and post backs regarding my issues.
Rick L.
https://www.boatingsolutions.com
We make boat repair easy!

Post Reply