NT authority\network service error

~J~

~J~

Soldato
Joined
20 Oct 2003
Posts
7,558
Location
London
I'm getting an error when I install my solution onto my customers server and look at any webpage that tries to connect to the SQL server.

It's a VERY well documentated error, but each and every step I've followed across a multitude of websites still hasn't fixed it and I was wondering if anyone else has had this problem and fixed it.

In a nutshell, the error message says that "Login failed for NT AUTHORITY/NETWORK SERVICE".

There's a good link here which tells you about it.

Now I've followed those steps accordingly, an IT guy on site has followed those steps, as well as a few others.

My connection string within the web.config file reads as follows: (UN and PWD removed)

<add name="sql_DMConnectionString" connectionString="Data Source=localhost;Initial Catalog=databasename;Integrated Security=SSPI;user=????;pwd=????" providerName="System.Data.SqlClient"/>

The SQL server has had the user as detailed in the link added, but still the error persists!

Has anyone had any experience of this as I'm due to deliver the solution to the client tomorrow. He's given me full access to his server via VNC so I can test off-site.

Any ideas?

TIA


 
I've had this error many times in the past with other windows products. In most cases it has always been down to that users permissions; more specifically the permission group they are in. Although without having a good look at the system you could try the following:

Change your authentication to SQL only. You will need to edit your config so it doesn't attempt to use integrated. For this to work the SQL server must have SQL only or both types of auth enabled. Depending on the options chosen when it was first installed, you might not have SQL login available. The only way that i know to enable it again is to uninstall/reinstall.
In very few cases i use windows integrated auth; most of the time it causes more problems than its worth like in your case.

Consider changing the security group of the login to a higher level like administrators or service account. Although this is far from the best solution, it will confirm that the problem is caused with lack of permissions.

Once you have confirmed it, you might want to look at changing the security on policies rather than the user itself. If they're inheriting a higher level policy then any special changes you make to that users permissions will be ignored.

If i couldn't find a solution to this problem in a timely matter i would seriously change the auth type to SQL only instead. I understand this might not be possible with your application, but i can't think of many cases where it would be required. I've always believed (never actually researched) that there is a higher security risk by using windows integrated with an SQL server, especially if your app was hacked as it can potentially leave your whole system wide open for interigation.

I hope what i said helps. Many times i have gone to clients and travelled hundreds of miles to find im without the right stuff or there are problems i can't immediately resolve. In the worst cases i have had to make up stupid excuses and lie as to why i couldn't perform the job that day! If you still can't sort it whilst your with the client, post back in the thread and ill try and help you further.
 
Cheers for the help.

Had no option but to get the IT guys to re-install the SQL server and it now seems to have worked :confused:

Thankfully they ok by it, as they are pretty desperate for the work I've done to go on so their IT guys were on the case at around 7am this morning to backup and reinstall.

Thanks again, really appreciate it.
 
Back
Top Bottom