Friday, March 17, 2006

If you receive "Cannot generate SSPI context" when trying to connect to SQL Server using Integrated Security grab yourself a coffee, find a comfy seat and prepare yourself for several hours of hardcore debugging.

First read thru this article: http://support.microsoft.com/?id=811889

If you not familar with Kerberos or NTLM you might just want to give up now!

The solution I'm about to supply is for one of many problems that may cause this error message. It might sound simple when I list it out but believe me this is the result of many hours wasted in front of my laptop.

Firstly my sql connections were working fine. Then after a reboot - nothing but "Cannot generate SSPI context" errors.

Nothing had changed. Honest.

After a lot of debugging I realised that when it worked i was connected (via VPN) to my office's domain. Therefore I could see and communicate with the DC. Something that is required for Kerberos.

After the reboot I did not reconnect to the VPN, therefore Kerberos was not used. I believe that cached credentials are no good.

Therefore NTLM was being used this time around. By why wasnt this working?

Again many hours passed before I realised that the NT LM Security Support Provider service was not running on my box.

Starting this and performing a reboot to pick up new token got my application working again.

Sigh. Now for some real work.

[Update: 1 hour later!] I'm still having "issues". I'll post more if I figure this bugger out!

3/17/2006 3:38:57 PM (GMT Standard Time, UTC+00:00)  #    Comments [1]  |  Trackback

Related Posts:
Access Denied While Signing Assembly
Enabling Web Services for Testing outside of the Localhost
Another Error from Visual Studio 2005 SP1
XNA Game Studio Express Released
Looking For Source Code
The /3GB switch and .NET applications


Referred by:
sspi coffee (blogs.icerocket.com) [Referral]
Cannot generate SSPI context (blogsearch.google.com) [Referral]
Cannot generate SSPI (search.blogger.com) [Referral]
Cannot generate SSPI context (www.google.co.uk) [Referral]
Cannot Generate SSPI Context (www.google.co.uk) [Referral]
cannot generate SSPI Context (www.google.co.uk) [Referral]
SSPI context (www.google.com.br) [Referral]
sspi context (www.google.co.uk) [Referral]
"sspi context" (www.google.co.uk) [Referral]
Cannot generate SSPI context (sg.search.yahoo.com) [Referral]
cannot generate sspi context (www.altavista.com) [Referral]
Cannot generate SSPI context (search.yahoo.com) [Referral]
sspi context cannot generate (search.yahoo.com) [Referral]
cannot generate sspi context vpn (www.google.com) [Referral]
cannot generate sspi context (www.google.co.uk) [Referral]
Cannot generate SSPI context (www.google.com) [Referral]
generate sspi context (www.google.fi) [Referral]
Cannot generate SSPI co (search.yahoo.com) [Referral]
sspi context (www.google.co.uk) [Referral]
cannot generate SSPI context (www.google.co.uk) [Referral]
sspi context (blogsearch.google.com) [Referral]
]Cannot generate SSPI context (www.google.co.uk) [Referral]
cannot generate sspi context thru vpn (www.google.se) [Referral]
cannot generate sspi context (search.yahoo.com) [Referral]
Cannot generate SSPI context (uk.search.yahoo.com) [Referral]
"cannot generate sspi context" (uk.search.yahoo.com) [Referral]
receive cannot generate sspi context message after updates" (search.yahoo.com) [Referral]
"cannot generate sspi context" (www.google.co.uk) [Referral]
Cannot generate SSPI context. (www.google.co.uk) [Referral]
cannot generate SSPI context (hk.search.yahoo.com) [Referral]
cannot generate sspi context sql server (search.yahoo.com) [Referral]
cannot generate sspi context random (search.yahoo.com) [Referral]
cannot generate sspi context (www.google.co.uk) [Referral]
Cannot generate SSPI context (ca.search.yahoo.com) [Referral]
cannot generate sspi context (ca.search.yahoo.com) [Referral]
cannot generate sspi context (www.google.co.uk) [Referral]
cannot connect to sspi context (search.yahoo.com) [Referral]
cannot generate sspi (search.yahoo.com) [Referral]
cannot generate SSPI context -2147467259 (search.yahoo.com) [Referral]
Cannot generate SSPI context. (Microsoft SQL Server, Error: 0) (uk.search.yahoo.com) [Referral]
cannot generate sspi context (uk.search.yahoo.com) [Referral]
Cannot generate SSPI context (ru.search.yahoo.com) [Referral]
Cannot generate SSPI context (hk.search.yahoo.com) [Referral]
vpn Cannot generate SSPI context (www.google.ca) [Referral]
"Cannot generate SSPI context" +"Windows 2003" (www.google.no) [Referral]
"Cannot generate SSPI context" "Windows 2003" (www.google.com.br) [Referral]
"cannot generate sspi context" sql server (www.google.co.uk) [Referral]
sspi context (www.google.co.uk) [Referral]
cannot gerenate SSPI context (www.google.co.uk) [Referral]
2147467259 can not generate sspi context (www.google.fi) [Referral]
cached credentials vpn sspi (www.google.com) [Referral]
"cannot generate sspi context" +vpn (www.google.com) [Referral]
"Cannot generate SSPI context" "Integrated Security" (www.google.com) [Referral]
cannot generate sspi vpn (www.google.co.uk) [Referral]
ms sql server error "Cannot connect to SSPI context" (www.google.ca) [Referral]
error: cannot generate sspi context:-2147467259 (www.google.com) [Referral]