Need help?

Our experts have had an average response time of 11.7 minutes in August 2021 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

SQL error 17806 : Error code 0x8009030c – How to fix

by | Dec 30, 2020

Wondering how to fix SQL error 17806? We can help you.

As part of our Server Management Services, we assist our customers with several SQL queries on a daily basis.

Today, let us look into the details of this error and its possible solutions.

 

SQL error 17806

If we are using Windows authentication to connect to a SQL Server in Windows 2003 and above, we may encounter the following error:

SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed. The Windows error code indicates the cause of failure. The logon attempt failed.

Error: 17806, Severity: 20, State: 14.

This error can happen due to the Active Directory configuration issue or Network related issues.

In Windows 2003 and above, the default method of establishing a connection is Kerberos. However, if it fails, we can establish a connection using NTLM. This may register on the SQL Server error log due to Kerberos failure.

SQL error 17806

 

Cause of SQL error 17806

  1. SQL Server engine account running with a Domain service account, and that account locked at the time a Kerberos connection attempt. The connection would work, but it would kick down to NTLM.
  2. Failed Kerberos Authentication to connect to SQL Server.
    To confirm if we have any database connection using Kerberos authentication, run:

    SELECT distinct auth_scheme FROM sys.dm_exec_connections

    If we only see NTLM and SQL then, there is no Kerberos connection.
    To use Kerberos, the client and SQL Server must be in the same domain and a Service Principal Name (SPN) must be registered with Active Directory for the SQL Server service account.
    We can check if the service account already has SPN, by running:

    setspn -l <domain\sqlserviceaccount>

    If we don’t see anything starting with MSSQLSvc\ then the account is not set up with SPN.

  3. SSPI handshake errors can be Time/Clock difference between the client clock differs server clock.

[Looking for more updates? Contact us now!]

 

Solutions for SQL error 17806

Let us now focus on some methods our Support Engineers suggest in order to fix this error.

Method 1:

  • Go to register start –> run … Regedit
  • Go to: HKLM\System\CurrentControlSet\Control\LSA
  • Then add DWORD value “DisableLoopbackCheck
  • Set this value to 1
  • Reboot after making this change.

Usually, this will affect registry change.

Method 2:

Restart the SQL browser services.

Method 3:

  • Reboot the misbehaving Domain Controller
  • Correct Client to Server time
  • Create an SPN for SQL server.
We can manually register SPN as a Domain Administrator.

To create an SPN for the NetBIOS name of the SQL Server we use the following command:

setspn –A MSSQLSvc/<SQL Server computer name>:1433 <Domain\Account>

To create an SPN for the FQDN of the SQL Server we use the following command:

setspn -A MSSQLSvc/<SQL Server FQDN>:1433 <Domain\Account>

If SQL Server service account grants “Validated write to service principal name” privilege in Active Directory, SQL Server database engine will register itself when it starts and unregisters at shutdown.

If the Domain Administrators do not permit this setting then we should manually register the SPN and the SSPI error will go away.

Also, the SQL Server service account must grant “Account is trusted for delegation” privilege in Active Directory. If the SQL Server connects to another SQL Server using Linked Server then the server must also grant “Trust this computer for delegation to any service” privilege.

For a named instance, we can use the FQDN of the named instance instead of SQL Server FQDN and use the port number.

For a clustered server, we should use the FQDN of the SQL Server virtual name. In this case, we will need two entries, one with port name and one without such as:

setspn -A MSSQLSvc/<Virtual SQL Server FQDN> <Domain\Account>
setspn -A MSSQLSvc/<Virtual SQL Server FQDN>:1433 <Domain\Account>

Kerberos authentication works when SQL Server, Service Account and Windows account accessing the SQL Server are in the same windows domain.

[Stuck with the error? We’d be happy to assist!]

 

Conclusion

In short, SQL error 17806 happen due to Active Directory configuration issue or Network issues. Today, we saw some methods our Support Techs found the best fit in order to solve this error.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF