How to Fix Windows Error 0x80090316
By Sai Kiran Pandrala · reviewed by Sai Kiran Pandrala, Editor Last verified: 2026-05-25
| Error code | 0x80090316 |
|---|---|
| Symbolic name | SEC_E_BAD_PKGID |
| Platform | Windows |
| Official message | The requested security package does not exist. |
| Source | Microsoft MS-ERREF (HRESULT) (https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/) |
What is 0x80090316?
0x80090316 is a HRESULT value returned by the Security Support Provider Interface (SSPI), which brokers Kerberos, NTLM, Schannel, and Negotiate authentication for Windows apps. In plain English: a security support provider interface reports 'the requested security package does not exist' (symbolic name sec e bad pkgid). Applications that call into this subsystem propagate the value back to the caller through GetLastError, an HRESULT return, or an SEH exception, so the same numeric code can surface in event-log entries, debugger output, installer logs, and user-facing dialogs.
The code is a fact, not a fault on its own. It tells you which subsystem objected and why, which is enough to point you at the configuration, permission, or state problem that's behind it. The fix sections below assume a stock Windows 10, 11, or Server 2019/2022 install.
When does 0x80090316 appear?
The most common situations that produce 0x80090316 during Kerberos ticket requests, NTLM handshakes, Schannel TLS negotiation, and SSPI-based authentication between Windows clients and servers:
- A Kerberos client cannot reach a domain controller or the KDC rejects the ticket request.
- Clock skew between the workstation and the KDC exceeds the allowed window (default 5 minutes).
- Service Principal Name (SPN) for the target service is missing or duplicated in Active Directory.
- Schannel rejects the TLS handshake because the cipher suite or protocol version is disabled.
- An NTLM fallback is blocked by group policy and Kerberos isn't available.
- A Credential Guard or LSA isolation policy refuses to release the requested credential.
If you have an event log entry with 0x80090316, note the source provider (the value in the ProviderName column). That provider name tells you which binary actually raised the error and is the first clue for which fix below to start with.
How to fix 0x80090316
Work top-down. Each block below is runnable on a stock Windows install with administrator rights. Run them in PowerShell elevated unless the comment says otherwise.
Detect what raised 0x80090316
# Detect: search the event log and recent application logs for 0x80090316.
Get-WinEvent -LogName Application -MaxEvents 200 |
Where-Object { $_.Message -match '0x80090316' -or $_.Message -match 'SEC_E_BAD_PKGID' } |
Format-Table TimeCreated, ProviderName, Id, LevelDisplayName, Message -AutoSize
# Capture the live process that surfaced the error so you can re-run it under
# a debugger or transcript.
Get-Process |
Where-Object { $_.MainWindowTitle -ne '' } |
Select-Object Id, ProcessName, Path |
Sort-Object ProcessName
# Re-run the failing call with verbose output. Replace the placeholder with the
# real command that triggered 0x80090316 for you.
$ErrorActionPreference = 'Stop'
try {
& 'C:\Path\To\FailingApp.exe' --verbose
} catch {
Write-Host "Caller surfaced: $($_.Exception.Message)"
Write-Host "HResult: 0x{0:X8}" -f $_.Exception.HResult
}
Cross-check with CMD
:: Surface the numeric meaning of 0x80090316 from the local message tables.
net helpmsg 790
:: Pull the most recent matching events from the Application log.
wevtutil qe Application /q:"*[System[Provider[@Name='Application Error']]]" /c:50 /rd:true /f:text | findstr /i "0x80090316 SEC_E_BAD_PKGID"
:: Show installed Windows features that touch the failing subsystem.
dism /online /get-features /format:table | findstr /i "Crypt Cert SmartCard TPM COMPlus MSDTC"
Targeted commands for the Security Support Provider Interface
# Verify time sync (Kerberos refuses tickets when clocks drift > 5 minutes).
w32tm /query /status
w32tm /resync /force
# Inspect cached Kerberos tickets and purge if needed.
klist
klist purge
# Confirm the SPN that the failing service expects.
setspn -L $env:COMPUTERNAME
Repair the underlying components
# Repair pass 1: confirm system files are intact. Security Support Provider Interface relies on a
# correctly installed Windows image, and 0x80090316 often clears once SFC and DISM
# repair tampered or missing components.
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
# Repair pass 2: re-register the most common helper DLLs for the affected
# subsystem. Run elevated.
regsvr32 /s wintrust.dll
regsvr32 /s softpub.dll
regsvr32 /s mssip32.dll
regsvr32 /s initpki.dll
# Repair pass 3: reset the Windows Update + cryptographic services group so any
# corrupted state in catroot2 or SoftwareDistribution is rebuilt.
Stop-Service -Name wuauserv, bits, cryptsvc, msiserver -Force
Rename-Item C:\Windows\SoftwareDistribution C:\Windows\SoftwareDistribution.bak -Force
Rename-Item C:\Windows\System32\catroot2 C:\Windows\System32\catroot2.bak -Force
Start-Service -Name wuauserv, bits, cryptsvc, msiserver
If you can't fix it immediately
Workarounds buy time, they don't solve the underlying issue. Use these only while you schedule a proper fix:
- Run the failing process elevated (
Start-Process -Verb RunAs) so it stops tripping over permission checks. - Roll back the most recent Windows update if 0x80090316 started after a Patch Tuesday. Use
wusa /uninstall /kb:<KB-number>. - If the failing app is a service, restart the service group it depends on. For example:
Restart-Service -Name CryptSvc, BITS, wuauserv -Forcefor crypto-related codes. - Create a System Restore point and try a known-good restore. Restore is non-destructive to user data but will revert recent driver and update changes.
- Boot into safe mode (
bcdedit /set {current} safeboot minimal && shutdown /r /t 0) to isolate whether a third-party driver or filter is in the call path.
How to verify the fix worked
Re-run the operation that originally surfaced 0x80090316. The exact verification depends on which subsystem you're testing, but the pattern is always the same: trigger the failure path, watch the event log, and confirm the code no longer appears.
# 1. Clear the application log so you start with a clean slate.
wevtutil cl Application
# 2. Re-run the operation that produced 0x80090316.
# (Replace this with the command, installer, or app launch that failed before.)
# 3. Inspect the application log for any new entries that mention 0x80090316.
$matches = Get-WinEvent -LogName Application -MaxEvents 200 |
Where-Object { $_.Message -match '0x80090316' }
if ($matches) {
Write-Host "0x80090316 still surfaces, see entries above." -ForegroundColor Yellow
$matches | Format-Table TimeCreated, ProviderName, Id, Message -AutoSize
} else {
Write-Host "0x80090316 no longer appears in the application log." -ForegroundColor Green
}
If the code is gone from the log and the previously failing operation now completes, the fix is in place. If it returns, capture a fresh trace with Get-WinEvent and compare the ProviderName field against the list of triggers above.
Frequently asked questions
What does 0x80090316 mean exactly?
0x80090316 is the HRESULT value that the security support provider interface returns when a security support provider interface reports 'the requested security package does not exist' (symbolic name sec e bad pkgid). The numeric value is reserved by Microsoft and won't be reused for another condition.
Is 0x80090316 dangerous?
On its face the message is informational, not destructive. The code is a symptom, not the disease. It tells you a permission, state, or configuration check failed inside a Windows subsystem. The risk depends entirely on what the calling app does when the call fails. A signed-update check that fails is more serious than a transient registry read that retries successfully.
Will reinstalling Windows fix 0x80090316?
Almost certainly yes, but it is far more work than the situation calls for. 0x80090316 usually clears with a targeted fix to a service, driver, certificate store, or registry key. A repair install (in-place upgrade) is a reasonable last step if the targeted fixes don't take. A clean reinstall should be the final option, not the first.
How is 0x80090316 different from other codes in the same group?
The numeric value is unique. Two codes can come from the same security support provider interface and look related, but Microsoft reserves each one for a distinct condition. Always cross-reference the symbolic name in MS-ERREF before assuming two codes share a fix.
Where do I get the official meaning of 0x80090316?
The canonical reference is the MS-ERREF specification. The HRESULT and NTSTATUS tables there are the definitive list of codes, their symbolic names, and the official message text.
Related error codes
Errors that share the same security support provider interface are often resolved by the same fix. Start with these:
- How to fix 0x80090300: SEC_E_INSUFFICIENT_MEMORY
- How to fix 0x80090301: SEC_E_INVALID_HANDLE
- How to fix 0x80090302: SEC_E_UNSUPPORTED_FUNCTION
- How to fix 0x80090303: SEC_E_TARGET_UNKNOWN
- How to fix 0x80090304: SEC_E_INTERNAL_ERROR
Related fixes
Related guides worth a look while you sort this one out:
- How to Fix Windows Error 0x8009030C
- How to Fix Windows Error 0x8009030D
- How to Fix Windows Error 0x8009030E
- How to Fix Windows Error 0x8009030F
- How to Fix Windows Error 0x80090310
- How to Fix Windows Error 0x80090311
References
- Microsoft Learn, System Error Codes (Win32): https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes
- Microsoft MS-ERREF (full Windows error code reference): https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/
- Microsoft Learn, HRESULT values: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a
- Microsoft Learn, Security Support Provider Interface (SSPI): https://learn.microsoft.com/en-us/windows/win32/secauthn/sspi
Field notes from real Windows incidents
When I work on the 0x80090316 symptom the rhythm I lean on is the one I have built over years of these tickets. DISM RestoreHealth needs network or a known-good source image; the most common cause of a failed RestoreHealth is a blocked Windows Update endpoint. Windows error codes come in a handful of families; once you recognise the family, the doc page is one search away. Reliability Monitor is the single most underused triage surface in Windows — it gives 30 days of crash history without writing a query.
Tools I actually reach for
For the 0x80090316 symptom on Windows the cheapest signal I can land usually comes from DISM and sfc, then Windows Performance Recorder, Process Monitor (procmon), Reliability Monitor (perfmon /rel) when DISM and sfc cannot see the layer the fault sits in, and PowerShell Get-WinEvent for the cases where neither of those answers cleanly. That ordering is not academic. It matches the layers the failure tends to surface through, so the cheap signal lands first and the heavier tooling only comes out when the simpler answer does not hold up under scrutiny.
Verification I run before I close the ticket
Before I mark the 0x80090316 symptom resolved on a Windows unit, the verification loop below is what I actually run. Each step proves a different layer is green, and the order matters - the cheap checks gate the more expensive ones.
sfc /scannowIf that one comes back clean, move to the next check. If it does not, stop and dig in there before layering more verification on top of a red signal.
Get-WinEvent -FilterHashtable @{LogName='System'; Level=1,2; StartTime=(Get-Date).AddDays(-7)}If that one comes back clean, move to the next check. If it does not, stop and dig in there before layering more verification on top of a red signal.
err.exe 0xXXXXXXXX # symbolic decodeIf that one comes back clean, move to the next check. If it does not, stop and dig in there before layering more verification on top of a red signal.
wevtutil epl System system.evtx # export for offline reviewOnly when every line above runs clean do I close the ticket and update the runbook with the timestamps.
Where I check first when the docs disagree
When two sources contradict each other on a Windows detail, the disambiguation order I lean on is stable. I usually start at techcommunity.microsoft.com/category/windows for the ground-truth view on Windows. I usually start at learn.microsoft.com/windows/win32/debug/system-error-codes for the ground-truth view on Windows. I usually start at support.microsoft.com for the ground-truth view on Windows. I usually start at github.com/microsoft/Windows-Driver-Frameworks for the ground-truth view on Windows. Random blog posts and reseller wikis are signal, not ground truth, and I treat them as such until the references above either confirm or contradict the claim.
Pitfalls I have walked into on this exact path
The shortcuts that look smart on the 0x80090316 symptom have a habit of biting back. The pitfalls below are the ones I have personally walked into on a Windows unit, not things I read about. DISM RestoreHealth needs network or a known-good source image; the most common cause of a failed RestoreHealth is a blocked Windows Update endpoint. STOP codes look terrifying but the first DWORD almost always points directly at the responsible driver. When in doubt I revert to the slower path that the manual prescribes - the time I save by skipping it is always smaller than the time I spend cleaning up afterwards.
What I tell the next on-call
When I hand the 0x80090316 symptom off to the next person on rotation, the three lines I leave in the runbook are these. First, the symptom signature for Windows on the Windows family - not a paraphrase, the exact string that surfaces. Second, the diagnostic that gave the highest signal in the least time. Third, the exact verification command whose green output justified closing the ticket. That trio is what turns a one-off fix into a runbook entry the next engineer can use without paging me at three in the morning.
I also add a one-line note on the cost of getting this wrong. For the 0x80090316 symptom on a Windows unit, the cost is rarely the replacement part. It is the downtime, the second site visit, and the trust deficit you spend with whoever owns the asset when the fix does not hold. That framing keeps the next on-call from choosing the cheap-looking shortcut that ends up costing the most in elapsed hours and goodwill.