Solved

System.Data.SqlClient.SqlException (0x80131904): Timeout expired

Posted on 2014-12-23
1
5,906 Views
Last Modified: 2014-12-24
I have a application that keeps track of time for payroll. It was working up until a few days ago when end-users all of a sudden could not log back in. Users who were logged in do not seem to be logged out, there is no automatic closing of inactive sessions, however users who logged out could not log back in. We seem to hit a maximum connection limit somewhere and no other users are able to log back in, they get the following below error message.

This is not a network issue, because I tried to log in on the localhost and on the same network, still get same issue. When using a fake credential, it comes back with a wrong password prompt almost immediately. When using a correct username/password, it spins for about 30 seconds before giving us the "System.Data.SqlClient.SqlException (0x80131904): Timeout expired" error.

Where in the SQL database would I check for the underlying issue? Strangely, rebooting the server (both the application and database servers) did not seem to have helped, I thought it would have flushed the connections.

=====


System.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at REDACTED(IdType companyId, IdTypeList employeeIds, IdTypeList workedDepartmentIds, DateType startDate, DateType endDate, BooleanType IncludeHomeDepartmentInDepartmentVerification)
   at REDACTED
0
Comment
Question by:openflow
1 Comment
 
LVL 46

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40516106
You can run the following query to know the maximum connections are allowed in the SQL Server instance:
SELECT @@MAX_CONNECTIONS

Open in new window

and then run sp_who2 to see how many lines it returns, so you can be sure you reached the limit of connections allowed.
EXEC sp_who2

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now