none
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

    Question

  • I am currently trying to debug an existing issue with a clients machine.  90% of the time the machine runs fine and sql connections are working just the way they should.  But periodically the server starts refusing certaint connections with this basic error

    Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

    the server is located on one machine we will call 'ms1' and the web applications are on 'ms8'.  The app pools use the 'NETWORK SERVICE' user to make connections, and said user is a login user of the DB.  also 90% of the time the current settigns eork fine.

    we run on a private network that and all apps use asp.net, and verifies users through windows authorization. 

    In the SQL server it is set to accept both windows and sql authorization.

    In the past the only way to fix this issue is to reboot the machine.  Since this in not an ideal solution or the client and am looking for possiblew cuases and solutions for this issue.

     

    Any help would be greatly appreciated

    Thursday, February 03, 2011 2:19 PM

Answers

  • Sounds like an ASP.net session time-out. Try increasing it or setting it to 0 = no timeout. When the session times-out(the page is idle for too long), the NTLogin that is passed to SQL Server using Windows Authentication will be null. Adam
    • Marked as answer by QBM5 Thursday, February 03, 2011 6:25 PM
    Thursday, February 03, 2011 2:27 PM
  • Use SQL Authentication in your connection strings. It's much easier to debug. There's too many factors involved in Windows Authentication, including but not limited to, Active Directory, IIS, SQL Server, Corrupted Profiles, etc...

    Which box are you rebooting to get it to work again?

    Adam


    Ctrl+Z
    • Marked as answer by QBM5 Thursday, February 03, 2011 6:25 PM
    Thursday, February 03, 2011 3:03 PM
  • Well I would make sure your SQL Server Services are running.

    Start | Run | Services.msc

    Rebooting most likely is restarting a stopped service.

    Adam


    Ctrl+Z
    • Marked as answer by QBM5 Thursday, February 03, 2011 6:25 PM
    • Unmarked as answer by QBM5 Thursday, February 03, 2011 6:25 PM
    • Marked as answer by QBM5 Thursday, February 03, 2011 6:25 PM
    Thursday, February 03, 2011 4:03 PM

All replies

  • Sounds like an ASP.net session time-out. Try increasing it or setting it to 0 = no timeout. When the session times-out(the page is idle for too long), the NTLogin that is passed to SQL Server using Windows Authentication will be null. Adam
    • Marked as answer by QBM5 Thursday, February 03, 2011 6:25 PM
    Thursday, February 03, 2011 2:27 PM
  • thanks for the suggestion but it did not help, i changed the timeout to 300 and still had the same issue.   Also, we have an error page that is triggered when errors like this occur, and it is triggered very quickly. 1-2 seconds. 

    Do you know of any way to simulate a comp reboot without actually doing so.  I have tried to restart the SQL server in SQL studio but it did not solve the issue.  IN the past the only solution has been to restart, which I would like to try to avoid this time. 

     

    Also, a co worker informed me that he is doing a very large file transfer onto the machine that hosts our sql server, and in the past this issue always seems to coinside with a server backup of sorts, sould these cause this issue?

     

    Thursday, February 03, 2011 2:52 PM
  • Use SQL Authentication in your connection strings. It's much easier to debug. There's too many factors involved in Windows Authentication, including but not limited to, Active Directory, IIS, SQL Server, Corrupted Profiles, etc...

    Which box are you rebooting to get it to work again?

    Adam


    Ctrl+Z
    • Marked as answer by QBM5 Thursday, February 03, 2011 6:25 PM
    Thursday, February 03, 2011 3:03 PM
  • We have to reboot SQL server (call it ms1), while all the apps run on 'ms8'.  If we reboot ms8 the error persists, but if we reboot ms1 the error is solved.  The boss man made the call to reboot ms1 today, so that will solve the issue for today, but it will arrise again in a few more days.   

    I do really appreciate you help, next time the proplem arises I will change the conn string to use SQL authentication instead of windows.

    hopefully that can help me solve the issue.

     

    Thank You

    Q.

    Thursday, February 03, 2011 3:53 PM
  • Well I would make sure your SQL Server Services are running.

    Start | Run | Services.msc

    Rebooting most likely is restarting a stopped service.

    Adam


    Ctrl+Z
    • Marked as answer by QBM5 Thursday, February 03, 2011 6:25 PM
    • Unmarked as answer by QBM5 Thursday, February 03, 2011 6:25 PM
    • Marked as answer by QBM5 Thursday, February 03, 2011 6:25 PM
    Thursday, February 03, 2011 4:03 PM