views:

413

answers:

4

Hi All,

I am working on a .NET application where I am trying to build the database scripts. While building the project, I am getting an error "Cannot create SSPI context.". This error is shown in the output window (inside VS2008 screen) and the building process failed. Please help on this. SQL Server is configured to work on Windows authentication & running as network service (these two things are must for my project).

Please help on this. This error is not seems to be consistent. It was fixed in the past by restarting the machine, changing the system time to match the domain time and some suggestions in the net. Please help on this.

Thank you in advance! Prasanna

A: 

It sounds like your PC hasn't contacted an authenticating domain controller for a little while. (I used to have this happen on my laptop a few times.)

According to this it can also happen if your password expires.

Jeremy McGee
Thank you,password not expired recently. It happened long back and the password is not the problem now.
Prasanna
+1  A: 

It's quite a common error with a variety of causes: start here with KB 811889

  • What version of SQL Server?
  • And Windows on client and server?
  • Local or network SQL instance?
  • Domain or workgroup? Provider?
  • Changing password
  • Local windows log errors?
  • Any other apps affected?
gbn
Thank you for your immediate response!1. SQL Server 20082. Windows Xp3. Network instance4. Domain5. not changed password for a while6. Logs only show this error7. I could nt able to log in from my applicaation, thats it. I can able to log in directly in SQL
Prasanna
A: 

The "Cannot Generate SSPI Context" error is very generic and can happen for a multitude of reasons. Is just a cover error for any underlying Kerberos/NTLM error. Gbn's KB article link is a very good starting point and usualy solves the issues. If you still have problems I recommend following the troubleshooting steps in Troubleshooting Kerberos Errors.

Remus Rusanu
A: 

Hi All,

I can able to get this resolved by resetting the domain (server machine, which is the domain server, but not related to SQL Server except domain managing) followed by the client machines.

Thank you all for your immediate support!

Prasanna