Many applications that communicate to the SQL DB located on a remote SQL server will at times report an unexpected error ‘Login failed for user ‘<domainname><computername>$’’.
Analysis:
The error usually indicates logon failure for the reported user account for the specified DB on the respective server.
Usually there should be a SQL/Domain user id that may attempt to login, but if it’s a computer name instead then that indicates probably System account or ASP.Net accounts attempts for that login.
Possible Cause:
The most possible case I noticed is that application get configured to use “Built-in ASP.Net” account.
Possible Fix:
Make sure application is configured to use appropriate login credentials for it to succeed or
Enable all needed access rights for the current login account that it’s using.
Logs:
OTOH, the respective SQL server will log below errors stating that Logon failure code.
04/14/2011 11:50:54,Logon,Unknown,Login failed for user ‘TESTDOMTEST-PC3$’. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: 123.14.134.223]
04/14/2011 11:50:54,Logon,Unknown,Error: 18456<c/> Severity: 14<c/> State: 11.
C:>err 18456
# for decimal 18456 / hex 0x4818 :
SQL_18456_severity_14 sql_err
# Login failed for user ‘%.*ls’.
# 1 matches found for "18456"
C:>
Sample Error Log:
Log Name: Application
Source: AppTitudeQueueProcessor
Date: 4/14/2011 11:53:05 AM
Event ID: 0
Task Category: None
Level: Warning
Keywords: Classic
User: N/A
Computer: TEST-PC3.TESTDOM.COM
Description:
2011-04-14 11:53:05Z|7|4/14/2011 11:53:05 AM: ASMAuthoriser.Login with the details: Website URL: http://TEST-PC3:8199/AppTitude/, SQL Server/Instance: TEST-APPDBAPPTITUDE, Database: TestDB, SQLUsername: , SQLPassword: Generated an exception with the following details: Exception was: System.Web.Services.Protocols.SoapException: Server was unable to process request. —> System.Exception: <WrappedException type="System.Data.SqlClient.SqlException">Login failed for user ‘TESTDOMTEST-PC3$’.</WrappedException>
at AppDNA.ASM.Common.Exceptions.XMLExceptionWrapper.wrap_and_throw(Exception err)
at ASMAuthoriser.Login(String username, String password, String server, String database, String sqlusername, String sqlpassword, Boolean ForceLogOff, String BaseURL, Boolean UsingAWS)
— End of inner exception stack trace —