0

After waking up computer from hibernation or connection to VPN I cant login to my localhost MSSQLServer

Following error in management studio:

Cannot connect to localhost.

===================================

The target principal name is incorrect.  Cannot generate SSPI context. (.Net SqlClient Data Provider)

Winver: 1909 Pro

SqlServer: 15.0.2070.41

Domain: no

Same machine: yes

MSSQLServer running under NT Service\MSSQLSERVER

Named Pipes Enabled

TCP/IP Enabled

Authentication: Mixed (Management studio login as Windows Auth)

SQL Server Browser + SQL Server Agent are running

Its freshly installed since November. Issues began at November also. I just run out of ideas what can be wrong. I read few articles but they didnt work or didnt run on same machine like I do

EDIT: Kerberos output: log

18/02/2020 12:27:24 Info: Connect to WMI, \root\cimv2
18/02/2020 12:27:50 Error: Access of User Principal information failed System.DirectoryServices.AccountManagement.PrincipalServerDownException: The server could not be contacted. ---> System.DirectoryServices.Protocols.LdapException: The LDAP server is unavailable.
   at System.DirectoryServices.Protocols.LdapConnection.Connect()
   at System.DirectoryServices.Protocols.LdapConnection.SendRequestHelper(DirectoryRequest request, Int32& messageID)
   at System.DirectoryServices.Protocols.LdapConnection.SendRequest(DirectoryRequest request, TimeSpan requestTimeout)
   at System.DirectoryServices.AccountManagement.PrincipalContext.ReadServerConfig(String serverName, ServerProperties& properties)
   --- End of inner exception stack trace ---
   at System.DirectoryServices.AccountManagement.PrincipalContext.ReadServerConfig(String serverName, ServerProperties& properties)
   at System.DirectoryServices.AccountManagement.PrincipalContext.DoServerVerifyAndPropRetrieval()
   at System.DirectoryServices.AccountManagement.PrincipalContext..ctor(ContextType contextType, String name, String container, ContextOptions options, String userName, String password)
   at System.DirectoryServices.AccountManagement.PrincipalContext..ctor(ContextType contextType, String name)
   at KerberosCM.WMIHelper.TryGetUser(SystemInfo mi, UserPrincipal& user)
user1085907
  • 1,009
  • 2
  • 16
  • 40
  • Does this answer your question? [Cannot create SSPI context](https://stackoverflow.com/questions/1812541/cannot-create-sspi-context) – Matt Evans Feb 18 '20 at 11:24
  • @MattEvans added output for kerberos. Cant figure out what to do next – user1085907 Feb 18 '20 at 11:29
  • The LDAP error indicates the domain controller it's trying to contact might be offline. Could be (probably is) DNS issues. The locator records in DNS are probably pointing to the wrong IP address, or the server itself is offline and can't accept connections. It works periodically probably because it found a working server. – Steve Feb 18 '20 at 17:00
  • @Steve I am not at domain! I am not connecting to somewhere else, I am connecting to localhost server. My DNS records are 8.8.8.8 / 8.8.4.4 – user1085907 Feb 18 '20 at 17:34

1 Answers1

1

Go to application pool at IIS Server and then to the advanced settings make sure the identity account which is set is correct.Also check the account that you have set at IIS, right click the website then go to manage website and then manage website and advanced settings.

wizwind
  • 29
  • 5