3 Replies Latest reply on Apr 25, 2007 2:48 PM by ufitzi

    DB Problem: "Connection reset by peer: socket write error"

      Our site works fine, but once a month, without fail, our site breaks with the following error:

      "Connection reset by peer: socket write error The specific sequence of files included or processed is: (path_to_file)"

      At which point, visiting any web page with a db query keeps producing that error. The error won't go away until I restart the db server (IIS and CF in one box, DB in another). Sometimes it's hours before I discover it's broken. The worst part is, the error is NOT trapped by the exception handler. The error message is shown directly in the page to the user. Once a month CF apparently has problem connecting to the DB server for some reason.

      Here is my setup:

      Windows Server 2003 SP1
      IIS 6 / CF MX 7.0.2 Standard in one box
      SQL Server 2005 in another box

      Data source settings:
      Maintain Connections (checked)
      Timeout (20 min)
      Interval (7 min)

      Found this page addressing the problem (ID 45290):

      Except it's different with me:
      1) I am not on DB2 or Informix, I'm on SQL Server 2005
      2) The problem does not go away after the 20 min (or whatever the timeout setting is)

      Any assistance is greatly appreciated. Thx.
        • 1. Re: DB Problem: "Connection reset by peer: socket write error"
          mvierow Level 1
          Just brainstorming here..

          What about simply stopping CF? (yes confirms script is running on this server)

          Is it exactly one month? (possibly a schedued task that may be running with it's own timeout)

          Are you logging page load times above X seconds?

          Is anyone else connecting to the db, or any other applications?

          Have you checked the activity monitor in SQL management studio?

          What protocol are you connecting with, and what auth method are you using? (Windows auth would involve a lot more chance for probems)

          What about stopping the specific services for the db only without restarting the entire box?
          • 2. Re: DB Problem: "Connection reset by peer: socket write error"
            Grizzly9279 Level 1
            Given that you're working with SQL Server here - I have a hunch it might indeed be protocal related. I've never worked with SQL Server 2005, but I know that previous versions of SQL Server used "named pipes" by default which was the source of a great many issues I've battled in previous years. It's typically suggested that you use TCP instead of named-pipes.

            I'd also take a look at the event log on the DB server. Are there any errors/warnings regarding client access licenses (CALs)? A DB server might exhibit this very behavior if it was running out of CALs approx. once a month. You may need to purchase additional CALs, or change your licensing mode from per-seat to per-server.
            • 3. Re: DB Problem: "Connection reset by peer: socket write error"
              We are experiencing a similar problem, on two pages, each on its' respective site, that are essentially identical. The datasource and styles of the page vary, but the code is essentially the same. The error is showing up in the logs and does not seem to "bring" the entire site down, in fact, the pages themselves load fine. I personally have never gotten the error, only see it frequently in the logs. The fact that this error is occurring on BOTH pages of course points to the code itself, or the properties of the databases (again, the tables are identical, save the data in them).
              On these pages we basically output a number of images available to the user for download. Once an image is selected, the high resolution version of the image is presented to the user's browser using the tags <cfheader> and <cfcontent>.
              My gut tells me that it is these tags that are causing the problem, as this is one of the few places where these tags are used. Coupled with the fact that we are using these tags to output large image files, could this "Socket Write" error NOT BE related to a query at all?