Issue with Sql Authentication/Manual Install

This post has 17 Replies | 1 Follower

Not Ranked
Posts 22
Points 450
Jason P. Brown Posted: Mon, Aug 14 2006 1:48 AM

I'm clearly missing something, or CS 2.1 has a flaw in it's ability to run under Sql Authentication.  My environment is IIS 6 (.NET 2.0) and SQL2000 with Mixed Mode Authentication (SQL & Windows).

I created a DB (we'll call it "MyCSDB" ), and ran the cs_2.1_CreateFullDatabase.sql and cs_ASPNET2_Membership_Schema_Update.sql scripts against that DB.  I purposely did not run User.sql because I wanted to run with SQL Authentication rather than Windows.

I added a SQL user, set "MyCSDB" as the user's default DB, and granted him access to the following roles in that DB.

  • public
  • db_securityadmin
  • db_ddladmin
  • db_datareader
  • db_datawriter
I tested this user through query analyzer and was able to connect and select data from the DB.

Then I modified the WebConfig.cfg in the root of my newly created site to reflect the appropriate connection string by modifying the uid, pwd, and database properties, replacing the defaults with the correct information.

The result is this.

If I removed "Trusted_Connection=yes;" from the connection string, I get this fancy error page announcing a "Critical Error : Data Store Unavailable" that instructs me to modify the web config so that it has the correct connection information, which it seemingly does.

Obviously if I leave it in, then I get the authentication failure for NT Authority\Network Service as it tries to authenticate to the db over windows.

I tried naming the server explicitly, even by IP:Port, which gave me an interesting Sql2005 Remote Server error, humorous in that it's inapplicable all around. 

It's a collocated machine that I have full administrator access too, so I can get around this in a couple ways  (running User.sql or Adding Network Service rights to the DB, Creating a windows user that has db rights and run the site as that user, etc etc), but I wrestled with this long enough that i figured others may have too.

I'm totally open to the idea that I overlooked something blatantly obvious and if that's true, by all means, please point it out to me.
 

Top 25 Contributor
Posts 1,592
Points 25,105
MVPs

Instead of removing the trusted_connection=yes change it to trusted_connection=no

 

Dave Stokes On Graffiti
Dave Stokes

  • | Post Points: 20
Not Ranked
Posts 22
Points 450
I should have mentioned, I tried that first and it has the same effect as removing it altogether.
  • | Post Points: 20
Top 25 Contributor
Posts 1,592
Points 25,105
MVPs

OK, a typical connection string should be:

"server=server;uid=username;pwd=password;Trusted_Connection=no;database=CommunityServer"

although I am sure you know that.  Note in web.config for CS on .Net 2.0 there are two entries of the connection in the web config.  Both need to be correctly completed.

Next daft question, you did download the correct version of CS for the .Net Framework 2.0 ?

 

Dave Stokes On Graffiti
Dave Stokes

  • | Post Points: 20
Not Ranked
Posts 22
Points 450
Dave:
OK, a typical connection string should be:

"server=server;uid=username;pwd=password;Trusted_Connection=no;database=CommunityServer"

Yessir!

Dave:
Note in web.config for CS on .Net 2.0 there are two entries of the connection in the web config.  Both need to be correctly completed.

Indeed! 

Dave:
Next daft question, you did download the correct version of CS for the .Net Framework 2.0 ?

That's 3 for 3!

It's not a daft question by the way, I'm taking nothing for granted here.  I've even checked the power cable. Smile 

 

  • | Post Points: 20
Top 25 Contributor
Posts 1,592
Points 25,105
MVPs

Hi again,

Am starting to run out of ideas here now !. 

Have you tried giving the user dbo access.

 As you have full rights to the server, maybe try creating a new blank database and enabling the Community Server web installer and trying the install through that against the blank database.  If the web installer fails display in your web browser then maybe its IIS not configured correctly for community server and it is never actually getting as far as trying to connect to the database and you are getting misleading error messages.

 I will keep thinking, maybe someone else can provide some new thoughts.  Personally I always use the Community Server web installer for any installation of CS.

Regards

Dave

Dave Stokes On Graffiti
Dave Stokes

  • | Post Points: 20
Not Ranked
Posts 22
Points 450

Well, I do appreciate your help, second set of eyes and all that.

I will try a web install tonight on another site on the same server as a test case.  As it is, I have that installation working by enabling windows auth and running the provided user.sql script.

I'll let you know how that one goes.
 

  • | Post Points: 35
Top 25 Contributor
Posts 1,592
Points 25,105
MVPs

Well that rules out any IIS configuration issues if it works with integrated security.

Best of luck with the web based install. 

Soon.

Kindest Regards

Dave

Dave Stokes On Graffiti
Dave Stokes

  • | Post Points: 5
Top 25 Contributor
Posts 1,592
Points 25,105
MVPs

One final thought.  Sql server is configured to run in mixed authentication mode ?

Dave

Dave Stokes On Graffiti
Dave Stokes

  • | Post Points: 20
Not Ranked
Posts 22
Points 450

Yes it is.  Otheriwse I'm pretty sure I wouldn't be able to connect to it remotely, though I am able to.

No worries.

Thank you very much for your help thus far!
 

  • | Post Points: 5
Not Ranked
Posts 22
Points 450

Web install worked like a champ using SQL auth.  I don't get it. 

Of course, this means I have to try a manual install again, just to see if I totally goofed something. 

 

Smile 

  • | Post Points: 20
Not Ranked
Posts 4
Points 50
nwna replied on Fri, Aug 25 2006 4:42 PM

I don't think you goofed anything...I am having the same problems.

 Web install works fine but Manual install doesn't work with 2.1.

 Anybody out there have any ideas?

  • | Post Points: 20
Not Ranked
Posts 40
Points 620
wiltech replied on Mon, Sep 11 2006 11:42 AM

- bump -

Anything new on this subject?

I'm having the same problem, not able to get the SDK to connect to the DB.

Thanks
Tony W

CS2007 Under Development: http://cs.cjoffroad.com
  • | Post Points: 20
Top 25 Contributor
Posts 1,592
Points 25,105
MVPs

Tony,

I have tried again to replicate this problem and are unable to.

This was done on a clean build computer with the following installed:

Windows XP SP2 all hotfixes up to last night applied. .

Net Framework 1.1

Visual Studio 2003 SP1

SQL Server 2000 Developer Edition

Procedure: SQL Enterprise Manager

Create a new database called CommunityServer.

Create a new login called CSUser with SQL Server Authentication.

Changed the default database CommunityServer.

Click Database Access tab. Permit to CommunityServer. Permit in Database role, db_owner.

Query Analyser

Check CommunityServer is the selected database.(Drop down list in menu bar).

Open cs_2.1_Createfulldatabase.sql Execute the Query.

Create a new query:

 exec dbo.cs_system_CreateCommunity 'localhost/cs', 'dev', 'dave@davestokes.org', 'Administrator', 'pa$$word', 0, 1

Browse to the source folder.

Double Click the VS 2003 Solution file Community Server ASPNET11.

Build the Solution in visual studio. Open the file souirce\web\web.config.

Edit the SiteSqlServer entry to

 value="server=(local);uid=csuser;pwd=csuser;Trusted_Connection=no;database=communityserver"

Where csuser is the user I created for the database.

Create A virtual directory in IIS pointing to the \source\Web folder with an alias of cs.

Open IE, browse to localhost/cs.

I have tried on many occasions to replicate this problem and am not able to. Until I or someone else can do that and work out a fix there is little more that I can do.

Dave

Dave Stokes On Graffiti
Dave Stokes

  • | Post Points: 20
Not Ranked
Posts 40
Points 620
wiltech replied on Wed, Sep 27 2006 8:06 AM

I deleted my SQL database and started over from scratch, and it all seems to be working fine.

I've even created a SQL database on my hosted web and it that went fine.

Now if i can just get the CSS figured out...

 
Thanks

Tony W 

CS2007 Under Development: http://cs.cjoffroad.com
  • | Post Points: 20
Page 1 of 2 (18 items) 1 2 Next > | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com