Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database/sql: failed to send SQL Batch error #35215

lw-bmc opened this issue Oct 28, 2019 · 1 comment

database/sql: failed to send SQL Batch error #35215

lw-bmc opened this issue Oct 28, 2019 · 1 comment


Copy link

@lw-bmc lw-bmc commented Oct 28, 2019

$ go version
go version go1.12 windows/amd64
go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\\go
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config

While using database/sql and jmoiron/sqlx modules, 99% of the time everything works fine. Occasionally, I get the following error:

failed to send SQL Batch: write tcp :58725->:1433: wsasend: An existing connection was forcibly closed by the remote host.

This happens randomly; I can't reproduce it reliably, although it seems to happen when the API (gin-gonic) hasn't handled any requests for a few minutes. It only seems to happen when API is running through IIS on my web server (tried both ASP.Net Core and HTTP Platform handlers). Could not reproduce it on my local dev machine.

Has anyone seen this at all? I have no idea how to go about diagnosing or fixing this, any help at all is much appreciated.

Copy link

@bcmills bcmills commented Nov 5, 2019

This issue seems to be a question about how to use Go, rather than a feature request or defect report about the Go language and/or toolchain.

We have decided that our experiment to allow questions on the issue tracker has not had the outcome we desired, so I am closing this issue. I'm sorry that we can't answer your question here.

There are many other methods to get help if you're still looking for answers:


@bcmills bcmills closed this Nov 5, 2019
@golang golang locked and limited conversation to collaborators Nov 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.