Sqlcmd: Error: Internal error at ReadTextLine (Reason: Unspecified error)

Oct 16, 2009 at 6:35 PM

 

I have a little something that's driving me crazy.  I have a pretty straightforward task that should execute a series of sql script files in a folder. (The task is in a file called OperationalDB.msbuild).  The task looks like this:
    <MSBuild.ExtensionPack.SqlServer.SqlCmd
TaskAction="Execute"
Server="$(SqlServerName)"
Database="$(SqlCatalogName)"
InputFiles="@(OperationalStaticDataFiles)"
/>
It fails when running as part of a TFS team build.  The log error says: 
 C:\b\56\S\Main\Builds\OperationalDB.msbuild : warning : Exit Code 1. Failure: Sqlcmd: Error: Internal error at ReadTextLine (Reason: Unspecified error).
Worse (from a debugging perspective), if I log in to my build server with the same account that the build service is running, and run OperationalDB.msbuild through MSBuild from a command line, it works beautifully.  No errors, all the SQL executes.
Any ideas?

I have a little something that's driving me crazy.  I have a pretty straightforward task that should execute a series of sql script files in a folder. (The task is in a file called OperationalDB.msbuild).  The task looks like this:

<MSBuild.ExtensionPack.SqlServer.SqlCmd
    TaskAction="Execute"
    Server="$(SqlServerName)"
    Database="$(SqlCatalogName)"
    InputFiles="@(OperationalStaticDataFiles)"
/>

It fails when running as part of a TFS team build.  The log error says: 

 C:\b\56\S\Main\Builds\OperationalDB.msbuild : warning : Exit Code 1. Failure: Sqlcmd: Error: Internal error at ReadTextLine (Reason: Unspecified error).

Worse, (from a debugging perspective), if I log in to my build server with the same account that the build service is running, and run OperationalDB.msbuild through MSBuild from a command line, it works beautifully.  No errors, all the SQL executes.

Any ideas?

 

Coordinator
Oct 20, 2009 at 2:36 PM

Nothing obvious springs to mind. Have you resolved this?

Mike

 

Jan 7, 2010 at 11:35 AM
Edited Jan 7, 2010 at 11:36 AM

I used to run sqlcmd within the cygwin environment piping commands to sqlcmd. Since the latest cygwin update I get the very same error message:

$ echo "select @@version"|d2u|sqlcmd
Sqlcmd: Error: Internal error at ReadTextLine (Reason: Unbekannter Fehler).

It would be interesting if you are also using a pipe to sqlcmd and I assume that you're only running your programs within Windows!?

It seems as if there is a bug in sqlcmd.