WordsOnTech

Fixed: Login failed for user ‘(null)’

The subject line of this post is very interesting, right? Login failed for user ‘(null)’. How come, a login can fail for user “null”? Interesting because, login is failing, and we don’t even know for which user it is failing for.

Login failed for user ‘(null)’ – Error: 18452

Summary

We received an urgent mail from the client stating that they cannot connect to SQL 2000 instances from any of the servers (app, web, or DB). They initially thought the SQL 2000 instances were down. They also informed that, the issue was only with windows authentication and not with SQL authentication.

Analysis

We logged in and tried to connect from our end and voila! We were able to connect to the target instances. However, this did not resolve the issue and the client still faced the issue. We did some analysis and below were some of our observations:

With these observations, we discovered that the problem was not with SQL connectivity but with the mode from which all authentications are done, i.e., Active Directory (AD). We also found that a security patch was applied on AD the previous day, which could have been the reason for this issue.

Workaround

Some detail investigation revealed that this issue may happen for older SQL versions like 2000. There is a concept of loopback check which causes trusted connections via the loopback adapter to fail.

A workaround to this problem is to disable loopback check at registry level on source server. In our case, it was SQL 2012 instance server. This is how, it can be done:

Create registry entry to “disable loopback check”.

Pros n Cons

This workaround works fine, and we were able to test it in our test environment. But we should highlight the few cons of this:

A DBA’s life is full of such situations where a decision has to be made, and based of situation, customer requirement, there can be pros and cons of any solution. This was once such situation.

Happy Learning!
Exit mobile version