Solved

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

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

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Job Hung 17 37
SQL Server Sum Over Multiple Tables 20 33
getting error while running below query  in sql 2 16
T-SQL: How to extract records into a new table 7 20
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

733 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