SSPI handshake failed error from Orchard

Topics: Troubleshooting
Mar 18, 2011 at 2:28 PM

Hello Since i use orchard on my server i had many bug reports like the following :

SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. [CLIENT: 10.7.70.75]

 

their my original connection string: (i'm impersonate in my web.config)

DataConnectionString: Data Source=My-DB;Initial Catalog=HelpWebSite;Persist Security Info=True;

my first try:

DataConnectionString: Data Source=My-DB;Initial Catalog=HelpWebSite;Persist Security Info=True;Trusted_Connection=True

 

second try (trying web example)

DataConnectionString: Data Source=My-DB;Initial Catalog=HelpWebSite;Persist Security Info=True;User ID=XXX;Pwd=XXX;Trusted_Connection=True

 

 

Have you an idea of the origin of this problem because i've been looking for solutions during the last days and my problem still unsolved.

 

Thanks a lot !

 

Coordinator
Mar 18, 2011 at 7:15 PM

Well, you might have a better chance of getting an answer on SQL Server forums, but this looks like your SQL Server is not configured to accept the Windows account that the web server is using.

This site offers some good examples of connection strings: http://www.connectionstrings.com/sql-server-2008

Apr 5, 2011 at 2:51 PM
Edited Apr 5, 2011 at 2:51 PM

Hello

 

DataConnectionString is OK but i've some trouble:

If i put

DataConnectionString: Data Source=PROJECT-DB;Initial Catalog=proj.Help;Integrated Security=True;Persist Security Info=True

dans in my web.config:

<identity impersonate="true" userName="RPI\UserWeb" password="xxxxxxxx" />

i launch Orchard and i get this error :  

Login failed for user 'RPI\DEV-MTV1$'.

   at Orchard.WarmupStarter.Starter.OnBeginRequest(HttpContext context, Action`1 registrations) in C:\xxxx\Desktop\RPI.proj.Website\src\Orchard.Startup\Starter.cs:line 20
at Orchard.Web.MvcApplication.Application_BeginRequest() in C:\xxxx\Desktop\RPI.proj.WebSite\src\Orchard.Web\Global.asax.cs:line 24

 

as you can see, it's my computer name which is use to connect to the DB 0_0

have you an idea why it is reacting like that ?

Coordinator
Apr 5, 2011 at 7:40 PM

Well, the login failed, so your SQL Server doesn't seem to recognize this user or that it has rights to access the database.

Apr 5, 2011 at 8:44 PM

Yes but The problem come from The wrong user is trying to access to The db
Normally it should be The user of my impersonate which Will connect to
The db but here is my computer domain account itself which is trying
to access ...

Coordinator
Apr 5, 2011 at 8:49 PM

You should really try to get an answer on a SQL Server forum. There is nothing specific to Orchard here, it seems.

Apr 6, 2011 at 2:44 PM
Edited Apr 6, 2011 at 2:45 PM

I've found my problem.

It come from an impersonation problem.

 

indeed, the impersonation is not used in warmupStartup , so when orchard try to contact the db , it just fail because the connection string is in Intregrated Security=True

more info :

the error is throw here:

Orchard\Data\SessionFactoryHolder.cs

in        private ISessionFactory BuildSessionFactory() at  config.BuildSessionFactory();

I've try to remove the starter from the globalasax but without any result because my HttpContext.Current.user is null (and in the other hand, my orchard was doing weird stuff)

What can i do to solve it without contacting directly my db with user and password ?

Coordinator
Apr 6, 2011 at 5:23 PM

Hi,

A few question to narrow down the issue

- Have you ever seen it workign on a previous version of Orchard ? (to see if it's a regression)
- Are you using Visual Studio's web server or IIS
- If you use IIS, have you tried defining the user on the application pool itself
- If you run in a brand new web application using the same we.config impersonate section, and connection string, does it work ?

Thanks
Sebastien

Apr 6, 2011 at 5:40 PM

- Have you ever seen it workign on a previous version of Orchard ? (to see if it's a regression)

It wasn't working on the 1.0.20


- Are you using Visual Studio's web server or IIS

I'm using IIS


- If you use IIS, have you tried defining the user on the application pool itself

- If you run in a brand new web application using the same we.config impersonate section, and connection string, does it work ?

I will try it tomorrow !

 

Thanks for the reply !

 

i keep you in touch

Apr 7, 2011 at 9:04 AM
Edited Apr 7, 2011 at 9:40 AM

- If you use IIS, have you tried defining the user on the application pool itself

It work fine but it's not what i'm looking ^^

but it show us that  the problem come from an impersonation troubleshoot.

 

- If you run in a brand new web application using the same we.config impersonate section, and connection string, does it work ?

It work fine in default branch

but i always get the error on a clean 1.X install .

so it seem to be a regression ! :(

 

i'll post a  workitem in the issue tracker:

http://orchard.codeplex.com/workitem/17690

 

EDIT: All work fine when i use the old global.asax before the implementation of warmupstarter (revision 3980)  and i remove the WarmupHttpModule