Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Login failed for user NT AUTHORITY\NETWORK SERVICE
Message
From
06/04/2011 23:54:27
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Login failed for user NT AUTHORITY\NETWORK SERVICE
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01506324
Message ID:
01506324
Views:
114
Recently, I adjusted my framework to use a new SQL connection for every SQL requests. This is in regards to a recent thread. This has resolved the issue which led us to that R & D. So, basically, for every SQL request, there is now a new SQL connection being used, which comes from the SQL connection pool, and that is extremely fast.

This change of architecture didn't affect all the servers my framework runs on, including my own PC, except one server. On that particular server, when the application is being shutted down, such as when I send a new DLL in the Bin directory for a new compilation, I get this error:

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

In my Global class, I have a design like this:
Imports System.Web
Imports System.Reflection

Namespace Framework

    Public Class GlobalBase
        Inherits System.Web.HttpApplication

        Sub Application_End()
So, when a new DLL is being sent, this goes in Application_End(). Then, in there, it goes into my Data.SQLUpdate() method to update a record in the IISApplicationCycle table. This determines the duration the worker process was running for, when it shuted down and the shutdown message.

However, since recently, I have observed that I didn't get any info at shutdown on one particular server. So, I thought I would do some R & D tonight and investigate on this. This is where I found that this particular section of code in Data.SQLUpdate() is causing this:
                                Using loSQLConnection As New SqlConnection(oApp.aConnection(nConnectionString, 1))
                                    loSQLConnection.Open()
                                    oCommand.Connection = loSQLConnection
                                    nResult = oDataAdapter.SelectCommand.ExecuteNonQuery()
                                End Using
The error comes from loSQLConnection.Open(). It seems when the application is shuting down that it requires additional or different priviledges to be able to open a connection to SQL Server. Like I said, I do not have that on six other servers. So, I assume the NT AUTHORITY\NETWORK SERVICE account is probably set up so it does not cause any conflict on those servers. But, I get this error on one server only. Can someone explain me the relation with this account and why I get such an error in one particular environment?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform