Error 18056 can be unwanted noise in certain scenarios

Published Jan 15 2019 12:55 PM 844 Views
Microsoft
First published on MSDN on May 05, 2010

I saw a lot of hits on the web when I searched for the Error message 18056 with State 29. I even saw two Microsoft Connect items for this issue filed for SQL Server 2008 instances:

http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=468478

http://connect.microsoft.com/SQLServer/feedback/details/540092/sql-server-2008-sp1-cu6-periodic...

So, I thought it was high time that we pen a blog post on when this message can be safely ignored and when it is supposed to raise alarm bells. Before I get into the nitty-gritty details, let me explain under what condition is 18056 raised with the state = 29.

Most applications today make use of connection pooling to reduce the number of times a new connection need to be opened to the backend database server. When the client application reuses the connection pool to send a new request to the server, SQL Server performs certain operations to facilitate the connection reuse. During this process (we shall call it Redo Login for this discussion) if any exception occurs, we report an 18056 error. The state numbers like the famous 18456: Login Failed error message give us more insight into why the Redo Login task fails. State 29 occurs when there is an Attention received from the client while the Redo Login code is being executed. This is when you would see the message below which has plagued many a mind till date on SQL Server 2008 instances:

2009-02-19 04:40:03.41 spid58 Error: 18056, Severity: 20, State: 29.

2009-02-19 04:40:03.41 spid58 The client was unable to reuse a session with SPID 58, which had been reset for connection pooling. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.

Is this a harmful message?

The answer that always brings a smile to my face: It depends ! The dependency of this error message being just plain noise to something that should send all the admins in the environment running helter-skelter can be summarized in one line.

If the above error message (note that the state number should reflect 29) is the only message in the SQL Server Errorlog along with no other errors noticed in the environment (connectivity failures to the SQL instance in question, degraded performance, high CPU usage, Out of Memory errors), then this message can be treated as benign and safely ignored.

Why is this message there?

Well our intentions here were noble and we didn’t put the error message out there to create confusion. This error message is just reporting that a client is reusing a pooled connection and when the connection was reset, the server received an attention (in this case, a client disconnect) during the connection reset processing on the server side. This could be due to either a performance bottleneck on the server/environment or a plain application disconnect. The error message is aimed at helping in troubleshooting the first category of problems. If you do see some other issues at the same time though, these errors may be an indicator of what is going on at the engine side.

What should you do when you see your Errorlog bloating with these error messages?

a.       The foremost task would be to scan the SQL Errorlog and determine if this error message is accompanied before/after by some other error message or warning like Non-yielding messages, Out of Memory (OOM) error message (Error 701, Failed Allocate Pages etc.).

b.      The next action item would be to determine if there is high CPU usage on the server or any other resource bottleneck on the Windows Server. Windows Performance Monitor (Perfmon) would be your best friend here.

c.       Lastly, check if the Network between the Client and Server is facing any latency issues or if network packets drops are occurring frequently. A Netmon trace should help you here.

Tejas Shah

Escalation Engineer - Microsoft


%3CLINGO-SUB%20id%3D%22lingo-sub-316072%22%20slang%3D%22en-US%22%3EError%2018056%20can%20be%20unwanted%20noise%20in%20certain%20scenarios%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-316072%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20May%2005%2C%202010%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3EI%20saw%20a%20lot%20of%20hits%20on%20the%20web%20when%20I%20searched%20for%20the%20Error%20message%2018056%20with%20State%2029.%20I%20even%20saw%20two%20Microsoft%20Connect%20items%20for%20this%20issue%20filed%20for%20SQL%20Server%202008%20instances%3A%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fconnect.microsoft.com%2FSQL%2Ffeedback%2FViewFeedback.aspx%3FFeedbackID%3D468478%22%20mce_href%3D%22http%3A%2F%2Fconnect.microsoft.com%2FSQL%2Ffeedback%2FViewFeedback.aspx%3FFeedbackID%3D468478%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20http%3A%2F%2Fconnect.microsoft.com%2FSQL%2Ffeedback%2FViewFeedback.aspx%3FFeedbackID%3D468478%20%3C%2FA%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fconnect.microsoft.com%2FSQLServer%2Ffeedback%2Fdetails%2F540092%2Fsql-server-2008-sp1-cu6-periodically-does-not-accept-connections%22%20mce_href%3D%22http%3A%2F%2Fconnect.microsoft.com%2FSQLServer%2Ffeedback%2Fdetails%2F540092%2Fsql-server-2008-sp1-cu6-periodically-does-not-accept-connections%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20http%3A%2F%2Fconnect.microsoft.com%2FSQLServer%2Ffeedback%2Fdetails%2F540092%2Fsql-server-2008-sp1-cu6-periodically-does-not-accept-connections%20%3C%2FA%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ESo%2C%20I%20thought%20it%20was%20high%20time%20that%20we%20pen%20a%20blog%20post%20on%20when%20this%20message%20can%20be%20safely%20ignored%20and%20when%20it%20is%20supposed%20to%20raise%20alarm%20bells.%20Before%20I%20get%20into%20the%20nitty-gritty%20details%2C%20let%20me%20explain%20under%20what%20condition%20is%2018056%20raised%20with%20the%20state%20%3D%2029.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EMost%20applications%20today%20make%20use%20of%20%3CA%20href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2F8xx3tyca(VS.80).aspx%22%20mce_href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2F8xx3tyca(VS.80).aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20connection%20pooling%20%3C%2FA%3E%20to%20reduce%20the%20number%20of%20times%20a%20new%20connection%20need%20to%20be%20opened%20to%20the%20backend%20database%20server.%20When%20the%20client%20application%20reuses%20the%20connection%20pool%20to%20send%20a%20new%20request%20to%20the%20server%2C%20SQL%20Server%20performs%20certain%20operations%20to%20facilitate%20the%20connection%20reuse.%20During%20this%20process%20(we%20shall%20call%20it%20%3CB%3E%20Redo%20Login%20%3C%2FB%3E%20for%20this%20discussion)%20if%20any%20exception%20occurs%2C%20we%20report%20an%2018056%20error.%20The%20state%20numbers%20like%20the%20famous%20%3CB%3E%2018456%3A%20Login%20Failed%20%3C%2FB%3E%20error%20message%20give%20us%20more%20insight%20into%20why%20the%20Redo%20Login%20task%20fails.%20%3CB%3E%20%3CI%3E%20State%2029%20%3C%2FI%3E%20%3C%2FB%3E%20%3CI%3E%20occurs%20when%20there%20is%20an%20Attention%20received%20from%20the%20client%20while%20the%20Redo%20Login%20code%20is%20being%20executed.%20%3C%2FI%3E%20This%20is%20when%20you%20would%20see%20the%20message%20below%20which%20has%20plagued%20many%20a%20mind%20till%20date%20on%20SQL%20Server%202008%20instances%3A%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CB%3E%202009-02-19%2004%3A40%3A03.41%20spid58%20Error%3A%2018056%2C%20Severity%3A%2020%2C%20State%3A%2029.%20%3C%2FB%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E2009-02-19%2004%3A40%3A03.41%20spid58%20The%20client%20was%20unable%20to%20reuse%20a%20session%20with%20SPID%2058%2C%20which%20had%20been%20reset%20for%20connection%20pooling.%20This%20error%20may%20have%20been%20caused%20by%20an%20earlier%20operation%20failing.%20Check%20the%20error%20logs%20for%20failed%20operations%20immediately%20before%20this%20error%20message.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CB%3E%20Is%20this%20a%20harmful%20message%3F%20%3C%2FB%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EThe%20answer%20that%20always%20brings%20a%20smile%20to%20my%20face%3A%20%3CB%3E%20It%20depends%20%3C%2FB%3E%20!%20The%20dependency%20of%20this%20error%20message%20being%20just%20plain%20noise%20to%20something%20that%20should%20send%20all%20the%20admins%20in%20the%20environment%20running%20helter-skelter%20can%20be%20summarized%20in%20one%20line.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EIf%20the%20above%20error%20message%20(note%20that%20the%20state%20number%20should%20reflect%2029)%20is%20the%20only%20message%20in%20the%20SQL%20Server%20Errorlog%20along%20with%20no%20other%20errors%20noticed%20in%20the%20environment%20(connectivity%20failures%20to%20the%20SQL%20instance%20in%20question%2C%20degraded%20performance%2C%20high%20CPU%20usage%2C%20Out%20of%20Memory%20errors)%2C%20then%20this%20message%20can%20be%20treated%20as%20benign%20and%20safely%20ignored.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CB%3E%20Why%20is%20this%20message%20there%3F%20%3C%2FB%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EWell%20our%20intentions%20here%20were%20noble%20and%20we%20didn%E2%80%99t%20put%20the%20error%20message%20out%20there%20to%20create%20confusion.%20This%20error%20message%20is%20just%20reporting%20that%20a%20client%20is%20reusing%20a%20pooled%20connection%20and%20when%20the%20connection%20was%20reset%2C%20the%20server%20received%20an%20attention%20(in%20this%20case%2C%20a%20client%20disconnect)%20during%20the%20connection%20reset%20processing%20on%20the%20server%20side.%20This%20could%20be%20due%20to%20either%20a%20performance%20bottleneck%20on%20the%20server%2Fenvironment%20or%20a%20plain%20application%20disconnect.%20The%20error%20message%20is%20aimed%20at%20helping%20in%20troubleshooting%20the%20first%20category%20of%20problems.%20If%20you%20do%20see%20some%20other%20issues%20at%20the%20same%20time%20though%2C%20these%20errors%20may%20be%20an%20indicator%20of%20what%20is%20going%20on%20at%20the%20engine%20side.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CB%3E%20What%20should%20you%20do%20when%20you%20see%20your%20Errorlog%20bloating%20with%20these%20error%20messages%3F%20%3C%2FB%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3Ea.%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20foremost%20task%20would%20be%20to%20scan%20the%20SQL%20Errorlog%20and%20determine%20if%20this%20error%20message%20is%20accompanied%20before%2Fafter%20by%20some%20other%20error%20message%20or%20warning%20like%20Non-yielding%20messages%2C%20Out%20of%20Memory%20(OOM)%20error%20message%20(Error%20701%2C%20Failed%20Allocate%20Pages%20etc.).%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3Eb.%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20next%20action%20item%20would%20be%20to%20determine%20if%20there%20is%20high%20CPU%20usage%20on%20the%20server%20or%20any%20other%20resource%20bottleneck%20on%20the%20Windows%20Server.%20Windows%20Performance%20Monitor%20(Perfmon)%20would%20be%20your%20best%20friend%20here.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3Ec.%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Lastly%2C%20check%20if%20the%20Network%20between%20the%20Client%20and%20Server%20is%20facing%20any%20latency%20issues%20or%20if%20network%20packets%20drops%20are%20occurring%20frequently.%20A%20Netmon%20trace%20should%20help%20you%20here.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ETejas%20Shah%3C%2FP%3E%0A%20%20%3CP%3EEscalation%20Engineer%20-%20Microsoft%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-316072%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20May%2005%2C%202010%20I%20saw%20a%20lot%20of%20hits%20on%20the%20web%20when%20I%20searched%20for%20the%20Error%20message%2018056%20with%20State%2029.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-316072%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Econnectivity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Etroubleshooting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Jan 15 2019 12:55 PM
Updated by: