Sql server ошибка 4014

Some times you may observe 4014 error messages in SQL Server errorlog, like below
Error: 4014, Severity:20, State: 11.
A fatal error occurred while reading the input stream from the network. The session will be terminated

To continue analyze it, we should firstly know which is the issue client servers, and we can schedule to run below script during the issue most frequent time:

;WITH RingBufferConnectivity as
( SELECT
records.record.value(‘(/Record/@id)[1]’, ‘int’) AS [RecordID],
records.record.value(‘(/Record/ConnectivityTraceRecord/RecordType)[1]’, ‘varchar(max)’) AS [RecordType],
records.record.value(‘(/Record/ConnectivityTraceRecord/RecordTime)[1]’, ‘datetime’) AS [RecordTime],
records.record.value(‘(/Record/ConnectivityTraceRecord/SniConsumerError)[1]’, ‘int’) AS [Error],
records.record.value(‘(/Record/ConnectivityTraceRecord/State)[1]’, ‘int’) AS [State],
records.record.value(‘(/Record/ConnectivityTraceRecord/Spid)[1]’, ‘int’) AS [Spid],
records.record.value(‘(/Record/ConnectivityTraceRecord/RemoteHost)[1]’, ‘varchar(max)’) AS [RemoteHost],
records.record.value(‘(/Record/ConnectivityTraceRecord/RemotePort)[1]’, ‘varchar(max)’) AS [RemotePort],
records.record.value(‘(/Record/ConnectivityTraceRecord/LocalHost)[1]’, ‘varchar(max)’) AS [LocalHost]
FROM
( SELECT CAST(record as xml) AS record_data
FROM sys.dm_os_ring_buffers
WHERE ring_buffer_type= ‘RING_BUFFER_CONNECTIVITY’
) TabA
CROSS APPLY record_data.nodes(‘//Record’) AS records (record)
)
SELECT RBC.*, m.text
FROM RingBufferConnectivity RBC
LEFT JOIN sys.messages M ON
RBC.Error = M.message_id AND M.language_id = 1033
WHERE RBC.RecordType=’Error’ and RBC.Error=4014
ORDER BY RBC.RecordTime DESC

Check the column of ‘RemoteHost’ and find one of the most frequent IP, and you will need to collect network monitor between the server and SQL Server.

See below analysis sample of network trace:
Client sent 8000 bytes data:
123.45.0.789 789.123.0.45 TDS TDS:Continuous BulkLoadBCP, Version = Undefined TDS version(0x74000004), SPID = 0, PacketID = 4, Flags=…AP…, SrcPort=54541, DstPort=52343, PayloadLen=8000, Seq=1077286218 — 1077294218, Ack=3825055476, Win=262656

The packets was large so it was divided, but server only received 1460*5=7300 bytes of data, so it lost 700 bytes of data
123.45.0.789 789.123.0.45 TDS TDS:Continuous BulkLoadBCP, Version = Undefined TDS version(0x74000004), SPID = 0, PacketID = 4, Flags=…A…., SrcPort=54541, DstPort=52343, PayloadLen=1460, Seq=1077286218 — 1077287678, Ack=3825055476, Win=262656
123.45.0.789 789.123.0.45 TCP TCP:[Continuation to #96]Flags=…A…., SrcPort=54541, DstPort=52343, PayloadLen=1460, Seq=1077287678 — 1077289138, Ack=3825055476, Win=1026 (scale factor 0x8) = 262656
123.45.0.789 789.123.0.45 TCP TCP:[Continuation to #96]Flags=…A…., SrcPort=54541, DstPort=52343, PayloadLen=1460, Seq=1077289138 — 1077290598, Ack=3825055476, Win=1026 (scale factor 0x8) = 262656
123.45.0.789 789.123.0.45 TCP TCP:[Continuation to #96]Flags=…A…., SrcPort=54541, DstPort=52343, PayloadLen=1460, Seq=1077290598 — 1077292058, Ack=3825055476, Win=1026 (scale factor 0x8) = 262656
123.45.0.789 789.123.0.45 TCP TCP:[Continuation to #96]Flags=…A…., SrcPort=54541, DstPort=52343, PayloadLen=1460, Seq=1077292058 — 1077293518, Ack=3825055476, Win=1026 (scale factor 0x8) = 262656

Then the server reset the communication:
123.45.0.789 789.123.0.45 TCP TCP:Flags=…..R.., SrcPort=52343, DstPort=54541, PayloadLen=0, Seq=3825055476, Ack=1077293518, Win=0

So generally speaking, it was when the network tried to sperate a large packets, it lost one of them, it can be caused by TCPChimney offloading or other network communication issues, you need engage your network team to continue check where was the packet lost.

SQL Server Recovery

SQL Server Error 4014: Know the Cause and Fix It!

sql error 4014

Introduction

At the time of batch processing, SQL Server 2008 frequently shows a SQL error 4014 on screen and details of the message in event log is as below:

SQL Error 4014

The error stated above suggest that there is some problem with the network due to which the data packets at the network are dropped. There are different reasons for which this error is recorded in the error log of SQL Server. The SQL Error 4014 error is mainly caused due to the TCP/IP Chimney Offload. Disabling this feature can give you solution to the problem.

With release of Microsoft Scalable Networking Pack (SNP), few features were launched that includes the TCP/IP Chimney, NetDMA, and the Receive Side Scaling (RSS). This isn’t the only error as users also try to fix Microsoft error 9003 as well. Let us discuss what they actually are.

Key Elements

  • Reasons of the Error
  • Solution to Fix Error
  • The Conclusion

TCP/IP Chimney Offload

It is a networking technology that allows transferring the workload from CPU to the network adapter. It is made to take processing of the network.Users need to be aware of this in order to understand the error 4014 SQL server with ease.

Receive Side Scaling

It gives the facility of distributing the load from the network adaptor to the CPU that works with multiple processors.

Network Direct Memory Access offers the facility of discharging memory copy operation which is the job of networking subsystem.

You can check out all these services on system by running the following command: netsh int tcp show global

TCP Global Parameters

From the image,we can see how the activation/deactivation mode of the services can be checked out. If we talk about SQL 2008 and above versions, the TCP Chimney. In order to check out if the TCP Chimney offload is in functional state or not, run the command: netstat –t.

Reason Behind SQL Error 4014

There can be a few causes of error: 4014, severity: 20, state: 11. in SQL server database. Let’s have a look at that in detail to proceed further.

The cause for SQL error 4014 is activation of TCP Chimney service running SQL 2005 instance on Windows Server 2003 service pack 2. And ideally, the service is meant for Windows Server 2003 scalable networking pack which is integrated with Win server 2003.

Fixing SQL Server Error 4014

Make sure that all latest updates are installed on the server machine. Check out if following updates are installed properly.

  • The update for network adaptor. This comes under firmware or driver update section.
  • The BIOS update for the server. This might need an update as a work around to the problem.

The above-mentioned hardware-related problems can be checked accordingly in order to fix the error 4014 error. But if there are no updates available, then you can recover SQL database and refresh the settings of server configuration.

Also Read: Various Scenarios to Handle SQL Server Error 983

Conclusion

Fatal error 4014 is caused due to the dissruption in network which result in drop in network packets. The error is captured due to the error in the error logs caused due to different reasons. Evidently, this blog discusses about the causes of this fatal error and what steps could be taken to fix this error.

One of our servers would periodically suffer from a fatal error during batch processing. This was a SQL Server 2008 instance running on Windows 2008 R2.

The error in question:

A fatal error occurred while reading the input stream from the network. The session will be terminated (input error: 10054, output error: 0). Error: 4014, Severity: 20, State: 11.

Solution

The problem is related to Microsoft’s Scalable Networking Pack (SNP) which consists of these three main features:

  • TCP/IP Chimney Offload – helps to transfer the workload away from the CPU to a network adapter during network data transfer. This helps to reduce the processing load on the CPU.
  • Receive Side Scaling (RSS)- enabled the network load from a NIC to be distributed across multiple CPUs in a multiprocessor computer.
  • Network Direct Memory Access (NetDMA) – provides services for offloading the memory copy operation that is performed by the networking subsystem to a dedicated direct memory access (DMA) engine when receiving network packets.

So first I checked the settings on the server by running the following command:

netsh int tcp show global

This returns:

tcp_chimner

As we can see these settings were all enabled. Windows Server 2008 disables TCP Chimney Offload by default so it seems an application has enabled this feature.

If we drill into the NIC driver settings we find:

tcp_chimner.png

So we can see the NIC vendor has enabled this feature in the driver so these need to be disabled as highlighted above.

Now we need to disable these settings at the OS level by running these commands in the command prompt:

Disable TCP/IP Chimney Offload:

netsh int tcp set global chimney=disabled

Disable RSS:

netsh int tcp set global rss=disabled

1 ) Disabling NetDMA can only be achieved by modifying the registry so make sure you take a backup first.

2) Locate the registry sub-key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

3) Locate the EnableTCPA registry entry. If this registry entry does not exist, right-click the Parameters sub-key, point to New, and then click DWORD Value.

4) Replace the New Value #1 by typing EnableTCPA, and then press ENTER. Double-click the EnableTCPA registry value you just created and type 0 in the Value to disable NetDMA, and then click OK.

Note NetDMA requires a system reboot to take effect. To confirm the changes have been made run the netsh int tcp show global command again.

  • Remove From My Forums

 locked

Error while executing SSIS package — Error: 4014, Severity:20, State: 11. A fatal error occurred while reading the input stream from the network. The session will be terminated (input error: 109, output error: 0)

  • Question

  • Hi,

    We are getting the following error when running our SSIS packages on Microsoft SQL Server 2012 R2 on Windows Server 2008 R2 SP1:

    Error: 4014, Severity:20, State: 11.   A fatal error occurred while reading the input stream from the network. The session will be terminated (input error: 109, output error: 0)

    SQL Server Data Tools and SQL Server Database Engine reside on the same server.

    We tried the following:

    • Disabling TCP Chimney Offload
    • Installed Windows Server 2008 SP1
    • Splitting our SSIS code into multiple steps so it is not all one large continuous operation

    The error occurs during a BulkDataLoad task.

    Other options we are investigating with the engineering team (out-sourced, so delayed responses):

    • Firewall configurations (everything is local, so this should not make a difference)
    • Disabling the anti-virus scanner

    Are there other things we can try?

    Any insight is greatly appreciated.

    Thanks!

    • Edited by

      Friday, November 14, 2014 8:30 PM

    • Moved by
      Kevin Cunnane [MSFT]
      Friday, November 14, 2014 8:54 PM
      Moving this to the SSIS forum as it’s related to that topic.

Answers

  • Hi HenryKwan,

    Based on the current information, the issue can be caused by many reasons. Please refer to the following tips:

    • Install the latest hotfix based on your SQL Server version. Ps: there is no SQL Server 2012 R2 version.
    • Change the MaxConcurrentExecutables property from -1 to another one based on the MAXDOP. For example, 8.
    • Set «RetainSameConnection» Property to FALSE on the all the connection managers.

    Reference:
    https://connect.microsoft.com/SQLServer/feedback/details/774370/ssis-packages-abort-with-unexpected-termination-message

    If the issue is still existed, as Jakub suggested, please provide us more information about this issue.

    Thanks,
    Katherine Xiong


    Katherine Xiong
    TechNet Community Support

    • Marked as answer by
      Katherine Xiong
      Monday, November 24, 2014 1:49 AM

  • Hi all,

    Apologies in the delayed response.  We were able to resolve the with the help of Microsoft Support.

    They suggested we install SP2, which allowed the SSIS package to progress beyond the unexpected termination.

    Thanks everyone for their input and support!

    • Marked as answer by
      HenryKwan
      Wednesday, November 26, 2014 12:21 AM

  • Remove From My Forums
  • Question

  • SQL error logged in Windows event log: Error 4014, Severity, 20, State, 13. MSG: A fatal error occurred while reading the input streamfrom the network. The session will be terminated, Input error
    121, Output error 0. This error causes approx 10-15 users problems — When error occurs users are not able to access Citrix Desktop Published Apps until their Citrix session is reset…

    I will also check to see if a dump file was generated…

    Microsoft SQL Server 2008 Standard
    Microsoft Windows Server 2008 Standard

    Regards,
    Derek.

Answers

  • Hi Derek,

    It looks like a network error. The error indicates that SQL has started reading a message from client which potentially spans multiple TDS packets. And the error is as expected — state 13 means exactly that a read failed after we attempted to read the remainder
    of a partially read packet .You could use the connectivity ring buffer to find out which client triggered the 4014 error:

    SELECT * FROM sys.dm_os_ring_buffers where ring_buffer_type=’RING_BUFFER_CONNECTIVITY’

    What you can also do though is to enable trace flag 7827 (DBCC TRACEON(7827, -1)) and all connection closures will be recorded into the ring buffer. As soon as you experience the 4014, query the ring buffer again and seek for a nearby record of the connection
    closure which shows the error 64 in the input and is indicated as killed or other abnormal flag in the TdsDisconnectFlags.

    Here is a similar
    connection posted.


    Best Regards,
    Peja

    Please remember to click «Mark as Answer» on the post that helps you, and to click «Unmark as Answer» if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Proposed as answer by

      Wednesday, May 18, 2011 9:16 AM

    • Marked as answer by
      Peja Tao
      Monday, May 23, 2011 3:35 PM

    • Proposed as answer by
      Peja Tao
      Wednesday, May 18, 2011 9:17 AM
    • Marked as answer by
      Peja Tao
      Monday, May 23, 2011 3:35 PM

Понравилась статья? Поделить с друзьями:
  • Sql server ошибка 3624
  • Sql server ошибка 29506
  • Sql server код ошибки 5023
  • Sql server ошибка 1827
  • Sql server ошибка 15407