Intermittent error: Cannot open database "DBNAME" requested by the login. The login failed. Login failed for user 'USER'.

  • We started to get intermittent errors today, this is happening from multiple application servers that connect to a central SQL 2008 R2 database. The errors are always pointing to the same database and same user having issues to log in.

    The user is an account we always use to authenticate the applications onto the database. This is an SQL User Account, not an AD account. We already checked the permissions of this user account on the database and it looks fine, we can also login with this user in Management Studio and query the database in question without a problem.

    As the subject says, this is happening randomly and just started today. We don't have any logs in SQL that will explain this either.

    I read some posts online that were making reference of this been a problem in other companies that use either mirroring or replication. We use replication, not sure if that is true but the guy that made the comment didn't explain why and what to do about it. We are been running these systems and databases with replication for years and just now started happening.

    Any ideas?

    Thanks in advance

  • We ended up fixing the problem by rebooting our database server and applications servers that connect to it. Still unclear what caused the problem, if someone has any info I'll greatly appreciate it.

    Regards

  • Verify that the db does not have autoclose or autoshrink set to on.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • lfajardo (2/11/2015)


    We ended up fixing the problem by rebooting our database server and applications servers that connect to it. Still unclear what caused the problem, if someone has any info I'll greatly appreciate it.

    Regards

    If that fixed it, then you might have a connection leak or a memory leak.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Hi Jeff, I assume you are referring to a connection leak on the application side, correct? Which causes uncontrollable number of connections and I assume at some point it presents a problem to the database and it cannot longer open the connection and throws the error, is this what you are referring?

    If that's what you are referring to, its weird that the issue will go away with a database reboot, because I'll think the application will start doing the same again, we didn't make any changes to the application to correct the issue, please advise.

    As far as memory leak, are you referring to a memory leak on SQL server?

    In either case, I found an article that talks about how to detect a connection leak, but again it suggests the issue comes from the application.

    Thanks again for your input

  • @SSCrazy, just confirmed, we don't have autoclose or autoshrink on, thanks for your feedback

  • lfajardo (2/12/2015)


    Hi Jeff, I assume you are referring to a connection leak on the application side, correct? Which causes uncontrollable number of connections and I assume at some point it presents a problem to the database and it cannot longer open the connection and throws the error, is this what you are referring?

    If that's what you are referring to, its weird that the issue will go away with a database reboot, because I'll think the application will start doing the same again, we didn't make any changes to the application to correct the issue, please advise.

    As far as memory leak, are you referring to a memory leak on SQL server?

    In either case, I found an article that talks about how to detect a connection leak, but again it suggests the issue comes from the application.

    Thanks again for your input

    Most of the connection and memory leaks that I've seen on SQL Server have been caused internally and I've not personally seen otherwise so I am talking a bit out of school. I have been told that such things occur quite frequently. Same goes with memory leaks. Googling "sql server connection leaks" and "sql server memory leaks" seems promising as to how to find external sources of the problems, which leads me to believe that such problems can be cause by the app without the app necessarily blowing up.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply