Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Other SQL Server Topics / July 2005

Tip: Looking for answers? Try searching our database.

general network error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
galina betz - 27 Jul 2005 23:42 GMT
Please help!

Getting this error intermittently:

System.Data.SqlClient.SqlException: Timeout expired.  The timeout period
elapsed prior to completion of the operation or the server is not
responding.
  at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
  at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

After getting a fair number of these errors I get this one also:

System.Data.SqlClient.SqlException: General network error.  Check your
network documentation.
  at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
  at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()


SQL connection pooling is turned off. All sql parameters passed to the
stored procedure and all the data types are correct.


Simon Hayes - 28 Jul 2005 08:44 GMT
Assuming that that there are no basic network connectivity issues,
there are several articles in the MS Knowledge Base about specific
errors or bugs which might produce that error message, so you should
also go through them to see if they might apply to your situation (eg.
827452, 826829 and others).

Simon
NotAGuru - 28 Jul 2005 18:01 GMT
I checked all the articles i can find with no avail...
serge - 29 Jul 2005 02:47 GMT
Maybe it's the SQL statement that is timing out. In how many
seconds approximately do you get the timeout message?

> Getting this error intermittently:
>
[quoted text clipped - 15 lines]
> SQL connection pooling is turned off. All sql parameters passed to the
> stored procedure and all the data types are correct.
NotAGuru - 29 Jul 2005 04:22 GMT
It only happends a couple times a day, so it is intermittent error - it
is not timing out every time the sql is called. It can run for hours or
even days without a problem and then suddenly it starts getting these
timeouts...
serge - 29 Jul 2005 04:49 GMT
Like Simon pointed out, you should also search the MS KB.
A quick search lead me to this:

http://support.microsoft.com/default.aspx?scid=kb;en-us;827393

I don't know what SQL statement is causing you this error but
I suggest what the KB article says, which is to check for any
Locks in SQL EM when you get the error.
You could also run the SQL Profiler the whole day and see
on which statement you are getting the Timeout error.
At least you might see a SQL Statement that is running for
a long period in the SQL Profiler.

"Additionally, when you view the current locks in SQL Server
Enterprise Manager (expand Management, expand Current
Activity, and then expand Locks/Process ID), you may find
that the sps_rCheckTreeForDelete object is blocking other
connections."

There are a ton of posts on others experiencing the same error:

http://groups-beta.google.com/groups?q=System.Data.SqlClient.SqlException%3A+Tim
eout+expired


Maybe you could find some hints when you go through those
posts.

> It only happends a couple times a day, so it is intermittent error - it
> is not timing out every time the sql is called. It can run for hours or
> even days without a problem and then suddenly it starts getting these
> timeouts...
NotAGuru - 29 Jul 2005 09:08 GMT
Guys, there is nothing on KB I did not read about this error and none of
the cases apply to me. As for the statement - I know exactly what stored
procedure it is timing out on and it is the same procedure that's
working just fine the rest of the time. I am really at the end of my
wits. I posted this question on several discussion groups via Google and
all. So far I did not get anything I did not think of before. I looked
at the locks, I did the profiling - I can't profile all day since it's a
production server, but I can get a 5 minutes or so when the errors are
going on and there is nothing - except that the duration of the request
goes way up and then times out after about 30000.... I see that lots of
people experiencing the same error (general network error)- there are
explanations to it though like the variable passed to the stored proc
are not the correct size or SSL encription, or connection timeout set to
zero - things like that. I am thinking about switching from the sql
server to something more robust...
Erland Sommarskog - 29 Jul 2005 09:53 GMT
> Guys, there is nothing on KB I did not read about this error and none of
> the cases apply to me. As for the statement - I know exactly what stored
[quoted text clipped - 11 lines]
> zero - things like that. I am thinking about switching from the sql
> server to something more robust...

Have you checked the SQL Server error log?

"General Network Error" means that the connection with SQL Server
was severed in some unexpected way. This can be as simple as a dropped
network conection. But it also be due to a crash in the SQL Server process.
In this case, the SQL Server log will contain a stack dump.

From your description, it sounds that first you get these timeouts, and
then you get these network errors. It sounds as if SQL Server comes under
stress for some reason.

Could you post the output of "SELECT @@version"?

When this starts to happen, does it happen to all users that are
running this procedure? Do other processes also experience problems,
or is everything else working OK? What does this procedure do? Plain
SELECT? Updates? Access to linked servers? Would it be possible for you
to post the code?
Signature

Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

NotAGuru - 29 Jul 2005 18:25 GMT
Could you post the output of "SELECT @@version"?

When this starts to happen, does it happen to all users that are
running this procedure?

The account it runs under is the only account that uses it,so i don't
really know, but i think it would error for all users.

Do other processes also experience problems,
or is everything else working OK?

Everything else is working, there are no errors in the event log on sql
server.

What does this procedure do? Plain
SELECT? Updates?

Updates

Access to linked servers? nope

Would it be possible for you
to post the code? no, it's production code but it is an update on the
database.
Erland Sommarskog - 29 Jul 2005 22:37 GMT
>> Could you post the output of "SELECT @@version"?

You couldn't?

>> Do other processes also experience problems,
>> or is everything else working OK?
>
> Everything else is working, there are no errors in the event log on sql
> server.

Note that I asked you to look for stack dumps in the SQL Server
error log. That is not the event log. The error log is in
C:\Program Files\Microsoft SQL Server\MSSQL\Log\Errror. (Replace MSSQL
if on named instance.)

>> Would it be possible for you to post the code?
>
> no, it's production code but it is an update on the database.

OK. Since you don't share much information, I don't think we will
be able to help you here. I would suggest that you open a case with
Microsoft. That is likely to cost you some sum of money, but I would
assume that condition also costs you money when you tracking it down.
Having a support professional to look at it, could be more cost-
effective.

Signature

Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

NotAGuru - 29 Jul 2005 23:20 GMT
Thanks! I looked at errors log too - there are no errors.
The code would not tell you anything it is just an update statement but
here it is:

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Name]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Name]
GO

CREATE  PROCEDURE Name
    @var1 varchar(64),
    @var2 tinyint = NULL,
    @var3 char(2) = NULL,
    @var4 smallint = NULL,
    @var5 int = NULL,
    @var6 smallint = NULL,
    @var7 varchar(20) = NULL,
    @var8 smallint = NULL
AS

set nocount on
declare @section_name varchar(500)
declare @error integer
set @error = 0
DECLARE @return_code INTEGER
SET @return_code = 0
declare @proc_name varchar(100)
set @proc_name = (select name from sysobjects (NOLOCK) where id =
@@procid)

set @section_name = 'Update '

    UPDATE Name
        SET col2= @var2,
        col3= @var3,
        col4= @var4,
        col5= @var5,
        col6= @var6,
        col7= @var7,
        date= GETDATE()
    WHERE col1= @var1

   /**** check for errors and log results
******************************/
   set @error = @@error
   if @error <> 0 goto failure

/********************************************************************/

set @section_name = 'exit procedure with success'

goto exit_procedure

failure:
 begin
   declare @error_text varchar(1500)
   set @error_text =
     'Procedure: "' + @proc_name + '" '  + char(13) +
     'Parameters: ' + char(13) +
     'Section Name: ' + isnull(@section_name,'(null)')

   if @@trancount > 0
     begin
       rollback transaction
       set @error_text = @error_text + char(13) + 'Rollback occurred. '
     end
 
   if @error >= 50000 raiserror(@error, 16, 1)
   raiserror(@error_text, 16, 1)

   set @return_code = @error
 end

exit_procedure:
return @return_code   

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

 
Erland Sommarskog - 29 Jul 2005 23:54 GMT
> Thanks! I looked at errors log too - there are no errors.
> The code would not tell you anything it is just an update statement but
> here it is:

Thanks for the code. The benefit I have from it, is that I can see
that there is nothing hiding in it. Then again, this also means that
I don't very many more suggestions. Blocking is the only thing I can
think of, but you seem to have ruled that out. And it should lead to
the connection being severed.

I assume that the .Net code uses ExecuteNonQuery to run the query?

And just to check - there are no triggers on the table, are there?


Signature

Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.