How to Fix SQL Server Error 15404 (Msg 15404)

Published
Length
3 min read

Luis Felipe Dias

All posts

You get sql server error 15404 when the database engine cannot check a Windows user or group. You can fix it by restoring domain trust, changing the account owner, or using SQL logins. This failure returns message 15404 at severity 16. The database engine states that it could not obtain information about the Windows NT group or user. It also prints a specific system error code at the end of the message. Why sql server error 15404 happens in production The database engine often needs to check

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You get sql server error 15404 when the database engine cannot check a Windows user or group. You can fix it by restoring domain trust, changing the account owner, or using SQL logins.

This failure returns message 15404 at severity 16. The database engine states that it could not obtain information about the Windows NT group or user. It also prints a specific system error code at the end of the message.

Why sql server error 15404 happens in production

The database engine often needs to check Windows accounts with your domain controller. This check happens during login, job runs, or permission checks. If the engine cannot reach Active Directory, it throws message 15404.

A common cause is a deleted Windows account that still owns a database or scheduled job. When the job starts, the engine tries to check the missing owner account. The domain controller reports that the user does not exist, and the job fails.

Service account permissions can also trigger this issue. If the database service runs under a local account, it cannot query domain groups. Network drops between the database host and the domain controller cause the same fault.

Trust issues between separate Windows domains also cause this error. If a user belongs to a foreign domain, the engine service account needs read rights there. Without those rights, the lookup fails with severity 16.

How to diagnose and fix the failure

Start by reading the exact account name and hex code in the error log. Check with your domain team to see if that Windows user still exists. If someone removed the person from Active Directory, you must update the object owner.

For scheduled jobs, change the job owner to an active service account. For databases, assign a valid login as the database owner. Never grant broad owner rights to normal user accounts just to bypass a lookup error.

Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Remember that a database user is the identity of a login inside a database. People who need many databases on an instance often use a SQL user with a login. That login lives in the master database and does not need Windows domain lookups.

For one or a few databases, you can use a contained database user instead. This is a SQL user with a password that is not tied to master. An admin must first turn on contained databases on the server and the database.

Note that SQL Server supports thirteen types of database users across different setups. When you set up replacement users, keep their permissions tight and scoped to their task. Do not add users to the full owner role unless they manage the database.

Scoping permissions after you fix the account

When you replace a broken Windows login, assign the smallest fixed role that works. Members of the full owner role can run all maintenance tasks and drop the database. Instead, use the data reader role for people who only need to read tables and views.

Use the data writer role only if the user must add, change, or delete table rows. You cannot change the permissions assigned to these built-in fixed database roles. If you need to block access, the deny roles stop a user from reading or writing data.

All fixed roles, including the default public role, hold basic permission to connect. Admins add users to these roles with the standard alter role command in SQL Server. Keeping roles strict ensures that a quick fix for error 15404 does not create a security gap.

Add runtime guardrails beside SQL Server

Role grants and network rules are needed setup for SQL Server. Still, an allowed user or agent tool can send a bad delete or read raw customer fields over a valid session. In practice, hoop.dev sits inline in the TDS protocol beside the database as a sidecar for your SQL Server. For every query an agent or human runs in production, hoop.dev decides whether to pass, mask, block, or escalate it for review.

With hoop.dev SQL Server controls, rules refuse banned statements before they run, hold risky queries for human review, and mask matched sensitive values in supported result columns in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for HIPAA, PCI DSS, SOX, and GDPR audits. See the source on GitHub.

Frequently asked questions

What does severity 16 mean for message 15404?

Severity 16 means the error comes from a user mistake or setup problem. The database engine stays online, but the specific job or query stops right away.

Why do scheduled jobs fail with error 15404?

The job server checks the Windows owner of a job before it runs any steps. If that person left the company and lost their domain account, the check fails.

Can SQL logins avoid Windows domain lookup failures?

Yes, SQL users with passwords inside master or contained databases do not query Active Directory. They verify identity inside the database engine itself, which avoids domain lookup faults.

The query runs. The emails stay hidden.