Subversion (SVN) error: E120106: ra_serf: The server sent a truncated HTTP response body – Automate the command line workaround with VBScript

SVN error: ra_serf: The server sent a truncated HTTP response body.

While working on a large enterprise project, I’m getting a Subversion (SVN) error “SVN error: ra_serf: The server sent a truncated HTTP response body.” when updating a repository to a network drive.

I found part of the answer on a Stack Overflow post about SVN error: E120106: ra_serf: The server sent a truncated HTTP response body.

This work around assumes the SVN checkout folder is already present provided was a two SVN command line commands.

$ svn cleanup
$ svn up

I ran the SVN command line commands manually for days but still the huge project updates would hang after about 5-10 minutes.

I decided I would try to automate this process a little bit to see if I could run the commands via a script and just repeat the cleanup and update commands every time it hung or stopped until the Subversion (SVN) update process has successfully completed.

Automating the SVN Cleanup and Update Commands in a VBScript.

Below is the script I just wrote today to try and automate the SVN processes.

  • Create Windows Shell
  • Use Shell and Run method calling taskkill command to kill any SVN processes that might be hung.
  • Use Shell and Run SVN with the “cleanup” w/ path argument to identify the SVN Repository folder we are targeting.
  • Use Shell and Run SVN with the update command, “up”, with path to identify the SVN Repository folder we are targeting.

The VBScript Code

Dim oShell : Set Oshell = CreateObject("WScript.Shell")

For i = 1 to 3
    OShell.Run "taskkill /im svn.exe /F", 5, True
    OShell.Run """C:\Program Files\VisualSVN Server\bin\svn.exe"" cleanup H:\Repo\", 1, True
    OShell.Run """C:\Program Files\VisualSVN Server\bin\svn.exe"" up H:\Repo\", 1, True
Next
Set OShell = Nothing

SVN Error: E120106 in a Nutshell

In summary, the SVN error E120106 for truncated HTTP response body is coming from the SVN server.

Everyone on this team has this issue and checkout code repository to their local C drives to checkout and commit work.

I suspect our network is just slow enough to cause a hiccup in communications between HTTP on SVN repository side and Windows file system.

I hope this work around and simple explanation help somebody out there with the same issue. 🙂

~Cyber Abyss

C# Error: The type or namespace name ‘List’ could not be found (are you missing a using directive or an assembly reference?)

OMG are your Kidding Me!

OK, I just spent an hour on this thing while trying to get started on another Tim Corey C# Developer tutorial for creating Microsoft Excel files.

When creating a custom model/object for your C# project and try to use it to build a List that made of that custom object type, you’ll be greeted with an error.

C# Error CS0246: The type or namespace name ‘List<>’ could not be found

Error: The type or namespace name ‘List’ could not be found (are you missing a using directive or an assembly reference?) 

Error seen when creating a List of custom objects without using including the using generics statement.

The missing element is a reference to using System.Collections.Generic

Code Example

using OfficeOpenXml;
using System;
using System.IO;
using System.Collections.Generic;


namespace ExcelDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            //Set the EPPlus license context to nonCommercial so we can play with it :-)
            ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
            var file = new FileInfo(@"c:\scripts\demo.xlsx");
        }

     static List<PersonModel> GetSetupData() 
        {
            List<PersonModel> output = new()
            {
                new() { Id = 1, FirstName= "rick", LastName = "cable" },
                new() { Id = 2, FirstName="bob",LastName= "marley" },
                new() { Id = 3, FirstName="willie",LastName= "nelson" }
            };

            return output;
        }
    }
}

References

As always, give credit where credit is due. In this case, a big thank you to David Morton for the post on the Microsoft Visual Studio forums.

I hope this blog post helps somebody!

Cyber Abyss!