Site bombs on open

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
webhead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Sun Aug 24, 2008 2:01 pm

Site bombs on open

Post by webhead » Wed Oct 08, 2008 2:29 pm

I have changed out the database connection string. This connection string works from other applications, but not from able commerce. The site won't open as this is bombing on a reference to an external library. I have the source code and still can't get to the line blowing up. I can't change this back as the encryption stuff is gone. I am going to hunt thru some of the exception references to see if I can figure this out, but would not mind any help on this. Exception is below, any ideas?

System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="CommerceBuilder"
StackTrace:
at CommerceBuilder.Utility.ErrorMessage.Save()
at CommerceBuilder.Utility.Logger.a(String A_0, LogMessageType A_1, Exception A_2, Type A_3)
at CommerceBuilder.Utility.Logger.Write(String message, LogMessageType messageType, Exception ex)
at CommerceBuilder.Utility.Logger.Error(String message, Exception ex)
at CommerceBuilder.Utility.MaintenanceWorker.RunMaintenance()
at CommerceBuilder.Services.AbleCommerceHttpModule.a(Boolean A_0)
at CommerceBuilder.Services.AbleCommerceHttpModule.a()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:


System.NullReferenceException was unhandled
Message: Object reference not set to an instance of an object.
Steve Portock

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Re: Site bombs on open

Post by Shopping Cart Admin » Wed Oct 08, 2008 2:53 pm

Hello,

Confirm that the directory you've installed to is setup as an application in IIS.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

webhead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Sun Aug 24, 2008 2:01 pm

Re: Site bombs on open

Post by webhead » Wed Oct 08, 2008 3:19 pm

Mike, that's not it, I only changed the connection string in the database config file, nothing else, it ran fine then before that change. Its trying to access something that is not there, I need to be able to get to the line blowing up here. it won't tell me this. I have custom code to do for clients and need to be able to run this in debug mode, I could do all this before.
Steve Portock

webhead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Sun Aug 24, 2008 2:01 pm

Re: Site bombs on open

Post by webhead » Wed Oct 08, 2008 3:23 pm

It is set up in iis, it bombs when trying to navigate to the default page. I need to know what is going on there, what fires first in this app? Since the default page has no page load event handler to start on debug with, how do you figure out what is going on here?
Steve Portock

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Re: Site bombs on open

Post by Shopping Cart Admin » Wed Oct 08, 2008 3:24 pm

Hello,

Perhaps there is a typo in the connection string you entered and it's left some code unclosed/unopened? Double check the connection string.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: Site bombs on open

Post by nickc » Wed Oct 08, 2008 3:31 pm

I can't change this back as the encryption stuff is gone.
Can't recommend enough how valuable it is to back up initial site deployment, and then every change after that. Use source control - SVN (Subversion) is free and very capable. ALWAYS deploy and update via source control.

Here's a sample (working) App_Data/database.config:

Code: Select all

<connectionStrings>
	<add name="AbleCommerce"
	 connectionString="Server=localhost; Database=AbleCommerceDB;Uid=ableuser;Pwd=p@ssw0rd;"
	 providerName="System.Data.SqlClient" />
</connectionStrings>

webhead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Sun Aug 24, 2008 2:01 pm

Re: Site bombs on open

Post by webhead » Wed Oct 08, 2008 3:35 pm

No, exact connection string works in a completely separate winforms application, and i can use the same credentials to login via sql enterprise mgr. I will try the old connection string. I still have to be able to use other ones, so this still has to be resolved.
Steve Portock

webhead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Sun Aug 24, 2008 2:01 pm

Re: Site bombs on open

Post by webhead » Wed Oct 08, 2008 3:40 pm

I just tried the other, the login fails.
Steve Portock

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: Site bombs on open

Post by nickc » Wed Oct 08, 2008 3:50 pm

Are you dealing with a database restored from backups? SQL login and database user are different things. A login might work for a SQL connection but not a database on the same server/instance. Run sp_change_users_login against the db to be sure.

webhead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Sun Aug 24, 2008 2:01 pm

Re: Site bombs on open

Post by webhead » Wed Oct 08, 2008 4:13 pm

No, what i did was take the able db that comes with it, and connect my sql ent mgr to it, i set this user up to do whatever it wants to, its admin level. I checked perms and other things. I need to know what is happening when the app loads. If you have the source code you should be able to step thru this. I can't even get to what is going on in the start up before you even see the first page.
Steve Portock

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: Site bombs on open

Post by nickc » Wed Oct 08, 2008 4:42 pm

Hmm. Setting a breakpoint in Global.asax (Application_BeginRequest) is about as early as you can get involved, I think (http://articles.techrepublic.com.com/51 ... 71721.html). At that point, Able's "Token" object hasn't been instantiated so there is a good chance they haven't been to the db yet. Would it be faster put back the working database and step forward? Does the database user really need full rights?

webhead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Sun Aug 24, 2008 2:01 pm

Re: Site bombs on open

Post by webhead » Wed Oct 08, 2008 5:29 pm

Tried that, it never even gets to it. There is something else that runs first in this. Cmon ablecommerce, whats going on here? Please tell me why i can't step thru the source code right from the start. If its a security issue, we can discuss off the board.
Steve Portock

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Re: Site bombs on open

Post by Shopping Cart Admin » Wed Oct 08, 2008 5:37 pm

Hello,

I'm not a developer but I do think our licensing module runs first, so perhaps that's what your running into? Our forums developer Mazhar is gone for the day, but hopefully he'll have an idea for you tomorrow morning.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

webhead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Sun Aug 24, 2008 2:01 pm

Re: Site bombs on open

Post by webhead » Wed Oct 08, 2008 5:40 pm

Thanks Mike, I was suspecting that was the case. I understand the security issues on this, we can go off board on it tomorrow.
Steve Portock

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Site bombs on open

Post by mazhar » Thu Oct 09, 2008 8:07 am

Could you please PM me your database.config file with the settings causing the problem.

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: Site bombs on open

Post by Logan Rhodehamel » Thu Oct 09, 2008 10:52 am

It's not likely security related, but something about the connection string.

The actual error is occuring here:

at CommerceBuilder.Utility.MaintenanceWorker.RunMaintenance()

The source for this method is included - so if you were able to set a breakpoint here you could get to it. But this is something that runs at application startup time, so there is a trick that usually works. To trap execution here:

1) You will need to build a debug version of the assembly from your source project. We distribute with release versions that will not have the necessary debug symbols.

2) Make sure you only have one worker process for IIS (no web garden)

3) Reset IIS to make sure the application is not loaded.

4) Access another ASPNET application that runs in the same app pool, so that the IIS worker process is running.

5) Attach the debugger to the IIS worker process, set a breakpoint in MaintenanceWorker.RunMaintenance.

6) Attempt to access the AC application

This may allow you to trap execution and discover the source of the error. Most likely it will confirm something is wrong in setting up the connection. Mazhar might be able to shed additional light once he has the connection string.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Site bombs on open

Post by mazhar » Thu Oct 09, 2008 11:03 am

Well i just modified the connection string in the following way for my local store and it worked for me.

Code: Select all

<connectionStrings>
   <add name="AbleCommerce"
    connectionString="server=MAZHAR\SQLEXPRESS;database=ac7;Integrated Security=true;"
    providerName="System.Data.SqlClient" />
</connectionStrings>
You can give a try in this way as well.

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: Site bombs on open

Post by Logan Rhodehamel » Thu Oct 09, 2008 11:33 am

I was not complete in my description of the source of the error. The first error occurs in RunMaintenance, but this error is handled and we attempt to log. The second error occurs in trying to save the log message - this leads to the hard crash.

In both cases, I still suspect the database connection as the root cause.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

Post Reply