babelfish_extensions icon indicating copy to clipboard operation
babelfish_extensions copied to clipboard

[Bug]: bcp giving "An existing connection was forcibly closed by the remote host." error

Open calmitchell617 opened this issue 1 year ago • 8 comments

What happened?

I am loading a large amount of tables in a for loop with bcp. It is working well most of the time but sometimes errors out (on the same tables).

My powershell commands, on a Windows server, look like this:

-- data export command

bcp "<SELECT * FROM MYDB.MYSCHEMA.MYTABLE>" <FILEPATH> -c -t"<CUSTOM DELIM>" -r"<CUSTOM NEWLINE>" -S <RDS ENDPOINT> -U <USERNAME> -P <PASSWORD>

--data import command

bcp <MYDB.MYSCHEMA.MYTABLE> in <FILEPATH> -c -t"<CUSTOM DELIM>" -r"<CUSTOM NEWLINE>" -S <BABELFISH ENDPOINT> -U <USERNAME> -P <PASSWORD>

I can't see anything in those tables that seem special, but it consistently errors on the same ones. Does anyone have any knowledge of what might be causing this?

Version

BABEL_3_X_DEV (Default)

Extension

None

Which flavor of Linux are you using when you see the bug?

No response

Relevant log output

Starting copy...
1000 rows sent to SQL Server. Total sent: 1000
SQLState = 08S01, NativeError = 10054
Error = [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: An existing connection was forcibly closed by the remote host.

SQLState = 08S01, NativeError = 10054
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure
SQLState = 08S01, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure
SQLState = 08S01, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure
SQLState = 08S01, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure
SQLState = 08S01, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure
SQLState = 08S01, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure
SQLState = 08S01, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure
SQLState = 08S01, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure
SQLState = 08S01, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure
SQLState = 08S01, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Text column data incomplete
SQLState = 08S01, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure
SQLState = 08S01, NativeError = -2147467259
Error = [Microsoft][ODBC Driver 17 for SQL Server]Communication link failure

BCP copy in failed


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct.

calmitchell617 avatar Jul 25 '23 16:07 calmitchell617