Cannot generate SSPI context error
swrobel
Posts: 31
I'm getting a cannot generate SSPI context error message in my SQL Prompt log. This is probably because my SQL Server doesn't have TCP/IP connections turned on, but uses Named Pipes instead. I have my connection in SQL Management Studio set up right and it works just fine, but for some reason SQL Prompt can't use the connection. It worked fine in 3.1...
Comments
Can you please tell us when this happens? The most common cause of this has nothing to do with the connection and more to do with the RedGate licensing components. Because there is encrypted information in the licence file, you may get this error at startup because SQL Prompt cannot decrypt the licence.
The reason for this is that the Microsoft CryptoAPI is not returning a crypto key, either because of access permissions or because your user account has a mandatory roaming profile type. In this case, the crypto key, which is in the user profile, may have been deleted.
Maybe deleting this particular database from the cache and reconnecting will fix it?
Oh yes, and my cache is empty because it hasn't even been able to get into the database in the first place.
Based on your information it sounds like maybe Prompt is trying to create a cache file, but can't because it can't encrypt the connection details because Microsoft CryptoAPI is broken.
There are some suggestions as to how to fix this on MSDN here:
http://blogs.msdn.com/sql_protocols/arc ... 81297.aspx
and in more detail here:
http://blogs.msdn.com/sql_protocols/arc ... 82782.aspx
I'd like to just force the connection to use Named Pipes, if possible? It seemed that 3.1 was automatically using Named Pipes, since that's what I had SQL Management Studio configured to use, but I think 3.5 is trying to use TCP/IP.
np:servername
The np prefix should force the connection to use named pipes.
Principal Consultant
bartread.com Ltd
The whole reason we don't force a protocol is so that SQL Prompt will connect using whatever protocol is right for the server (actually this is all wrapped up in ADO.NET), so for a server that only allows named pipe connections, SQL Prompt will connect using named pipes without the need to force the protocol.
For sanity's sake I've just verified that this is the case using two separate servers on different machines, one a SQL Server 2000 instance, the other a 2005 instance. In both cases SQL Prompt had no difficulty connecting when both instances were set up to use only named pipe connections.
We also haven't changed the code that actually creates the connection since before SQL Prompt 3.0 was released except to flick the "user instance" flag on when working with an attached MDF file in Visual Studio 2005, so I have to come back to the conclusion that there's some difference between the client machines that's causing this problem, whether it's network setup, Kerberos (as Brian suggested), firewalling, or some other issue. Actually I'm not so sure about the Kerberos problem because that should only generate the SSPI error when connecting over TCP/IP.
Hope that helps.
Thanks,
Bart
Principal Consultant
bartread.com Ltd
http://support.microsoft.com/kb/811889
Have a look at the "Why Security Support Provider Interface chooses NTLM or Kerberos" as it could be some sort of DNS or Active Directory issue.
Thanks,
Bart
Principal Consultant
bartread.com Ltd
Cheers,
Bart
Principal Consultant
bartread.com Ltd