Page 1 of 1

Server error - url without www prefix

Posted: Fri Dec 02, 2016 6:53 am
by eileen
We are getting a server error (see below) on our store now and then causing us to lose sales. It can also happen when accessing admin. It tends to happen most often when we access the site without the www prefix.

In our developer's opinion the exception stack track indicates that the AbleCommerce back-end code fails to properly check a null object in certain situations. Most likely when a user basket is transferred or when a user gets redirected from the domain with the www prefix to a domain without the prefix.

According to our developer this problem needs to be fixed at AbleCommerce's end. These needs to be a simple check that would make sure that when 'userName' parameter to LoadForUserName function is null, it does not try to access the null string. Our developer is Abdullah from Plugables (http://www.plugables.com).

Here are the exception details we keep getting time and again...

==========================
Server Error in '/' Application.

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.]
CommerceBuilder.Users.UserRepository.LoadForUserName(String userName,
Boolean createMissing) +38
CommerceBuilder.Users.UserDataSource.LoadForUserName(String userName,
Boolean createMissing) +35
CommerceBuilder.Services.Membership.WebUserLocator.Locate() +898
CommerceBuilder.Common.AbleContext.get_User() +50
CommerceBuilder.Services.PageTracker.Track(HttpApplication application,
HttpContext context) +1244
CommerceBuilder.Services.HttpModule.a(Object A_0, EventArgs A_1) +1110
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+141
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +69

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET
Version:4.6.1590.0
==========================

Re: Server error - url without www prefix

Posted: Sun Dec 04, 2016 5:02 am
by NC Software
If you think it's a missing WWW in the URL then most likely IIS for the web site is not configured properly (and DNS should be checked too) and has nothing to do with AbleCommerce.

Re: Server error - url without www prefix

Posted: Sun Dec 04, 2016 9:33 am
by dgoranov
Hello,

This is clearly an AbleCommerce Http module issue. The exception is being thrown on an application level. If this is an IIS or DNS
issue the site will not respond at all and the browser will get http 404 or 500 errors.

IIS and DNS is working fine. The request is hitting the application and the application code fails and throws and exception.

Server Error in '/' Application.

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.]
CommerceBuilder.Users.UserRepository.LoadForUserName(String userName, Boolean createMissing) +38
CommerceBuilder.Users.UserDataSource.LoadForUserName(String userName, Boolean createMissing) +35
CommerceBuilder.Services.Membership.WebUserLocator.Locate() +898
CommerceBuilder.Common.AbleContext.get_User() +50
CommerceBuilder.Services.PageTracker.Track(HttpApplication application, HttpContext context) +1244
CommerceBuilder.Services.HttpModule.a(Object A_0, EventArgs A_1) +1115
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1590.0

Re: Server error - url without www prefix

Posted: Mon Dec 05, 2016 3:28 am
by AbleMods
What is the version/build of Able? Is CommerceBuilder customized?

There was an issue in older Gold installs where a lengthy (or empty) user agent string would throw exceptions in the HTTP module. Not sure that applies here, but worth mentioning nonetheless.

Are there any external processes or threads that work on the ac_Users table? Clearly Able is expecting the user record to exist in the database but it does not.

Almost sounds like a cookie issue given the issue is intermittent and not constant.

I've got a fairly large client who's been running for years on http://whatever.com and we've never seen this issue. Worked fine in 7.x, works fine in Gold R11.

Re: Server error - url without www prefix

Posted: Mon Dec 05, 2016 6:55 am
by eileen
VERSION: 7.0.92.9266
Release Label: GoldR12SR1

Problem occurred after update to R12 from R10.

Re: Server error - url without www prefix

Posted: Mon Dec 05, 2016 8:45 am
by Katie
Eileen,

The license key determines what URL AbleCommerce will use. As long as your DNS and IIS webserver are setup to work with that URL, then you should not have any problems. Your license key is registered to www.backdesigns.com and even though I can manually type in backdesigns.com, there is an immediate redirect to www.backdesigns.com.

I am not clear on why you think this is a bug. I tested your admin and the storefront, and the redirect happens for me without any issue. Seems odd, like maybe you have some customization that isn't taking well to how the licensing works.

Sometimes it helps if you can provide the exact steps to reproduce the issue. I have a Gold R12 SR1 install that I can test with, but I don't understand how you are getting this error.

Thanks,
Katie

Re: Server error - url without www prefix

Posted: Tue Dec 06, 2016 6:29 am
by Katie
If we can get a proper bug report, then we are happy to look into this.

A bug report should include the following information -

SUMMARY of ISSUE
EXACT STEPS TO REPRODUCE.
WHAT HAPPENS?
WHAT SHOULD HAVE HAPPENED?

Thanks
Katie