Solved

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

Posted on 2014-12-23
1
6,174 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 47

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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…
Viewers will learn how the fundamental information of how to create a table.

810 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