SQL Server 2012 - The message received was unexpected or badly formatted

  • I have a new server I've installed SQL Server 2012 on.

    However, when I try and connect to any other SQL Server from this server, I get the below error, and following that the two screenshots I've attached.

    Has anyone come across this before and have any ideas? I'm trying to setup a LAB environment for Always ON and this is preventing me from getting started.


    TITLE: Connect to Server


    Cannot connect to *****\*****.



    A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The message received was unexpected or badly formatted.) (Microsoft SQL Server, Error: -2146893018)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=-2146893018&LinkId=20476


    The message received was unexpected or badly formatted





  • Anyone got any ideas here?

  • I stumbled upon this error too. We upgrade some servers to .NET Framework 4.5.1 and ran into precisely the same situation ( Win 2008 R2 x64).

    From a command line run "netsh winsock reset"; then reboot. Post with the info.

    This seemed to temporarily solve the problem. Others seemed to have more luck. Other threads suggested targeting framework 4.5.0. I'm in process trying that myself.

    Once I get to a stable system I'm going to have to go to Microsoft PSS and find out what's happening.

  • Thanks for that. We're logging a call with Microsoft about this, so will post back with what they say 🙂

  • Have you gotten anywhere on this?

    We've found the winsock reset will keep it running for 2-4 hours before tipping over and dying. Some other thoughts and debugging....

    From KB 2568167 we dumped the winsock catalog (netsh WinSock Show Catalog). When the system was working all entries had the Service Flag 0x20000 bit set. Once w3wp crashed, however, we found a number of entries where it was NOT set.

    Some of those entries were from Sophos. Sophos has two KB articles (1, 2) that seem to imply it could be the culprit. It would also explain why the problem seems intermitten -- Sophos tries to reenable itself after a winsock reset. We've disabled Sophos as a test. So far the site is up, but it hasn't been long enough to know for sure.

    I have a call with PSS shortly. I'll keep you posted. I'm curious if you've gotten

  • Any update here? Stuck with the same problem.

  • I never heard back from PhilipC, so I don't know what happened on his end. On my end, a few things...

    1) This is the relevant KB article http://support.microsoft.com/kb/2568167 even though it doesn't seem so at first pass.

    2) Microsoft PSS confirmed the behavior as a bug. There is no hotfix at the moment. Supposedly this is high priority (but who knows) -- probably because the relevant KB article suggests you uninstall .net 4.5.1 as your work around.

    3) Upgrading Sophos from a 9.x series to a 10.x series seemed to resolve the problem, but we ran out of time to fully test

    4) We ended up rolling back to .net 4.0 because we were not comfortable with the fix.

  • I have also uninstalled 4.5.1, which also fixed it for me. That broke Visual Studio 2012 and 2013, so they had to be reinstalled, but that might not be relevant to most people here. 🙂

  • Sorry guys, been away on leave from work.

    I plan on logging a support call with Microsoft about this sometime within the next few weeks as the company I work for has a support contract with Microsoft.

    I'll post back with how I go with that.

  • Please let us know what your findings are as I'm having the same issue with SQL Server 2012 and 2014. The temporary netsh fix works at the moment.

  • Well, this post morphed to something totally different than I expected to say ....

    Funny enough,.net 4.5.2 was posted today (link). The known issues article (link) doesn't list this an an issue, like the corresponding 4.5.1 article (link) does. So maybe there's a fix in place?

    If 4.5.2 is too cutting edge, you're left with the options I posted a while back.

  • Scratch that optimism. The 4.5.2 known issues article links to the .net 4.5.1 known issues article -- so it looks like it's not fixed :-/

  • I spent a month on and off with Microsoft support on this, and they were unable to resolve the problem. They ended up thinking it was an internal network issue.

    As it was only a proof of concept environment we were building, we just stopped there as it wasn't anything important to us at that particular time. Who knows when it will come up again....

  • Just an FYI --- the result of this error in my case was an AccessViolationException from ADO. The related KB has been updated, listing .net 4.5.2 as the resolution.


  • Hi everybody,

    I've been able to resolve this issue by:

    1. un-install all .NET 4.5.1 components

    2. install .NET 4.5.2 (downloaded from )

    Many thanks and best regards,


Viewing 15 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic. Login to reply