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

"The connection was reset" error when uploading a ~10MB file #68715

Closed
korovindenis opened this issue Aug 2, 2024 · 2 comments
Closed

"The connection was reset" error when uploading a ~10MB file #68715

korovindenis opened this issue Aug 2, 2024 · 2 comments

Comments

@korovindenis
Copy link

Go version

go version go1.22.4 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/user/.cache/go-build'
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/user/go/pkg/mod'
GONOPROXY='none'
GONOSUMDB='xxx/*'
GOOS='linux'
GOPATH='/home/user/go'
GOPRIVATE='xxx/*'
GOPROXY='https://proxy.golang.org'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/user/Documents/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2691332075=/tmp/go-build -gno-record-gcc-switches'

What did you do?

I'm running into an issue with my Go server when trying to upload files around 10MB using a simple file upload form. In my browser, I'm seeing a "The connection was reset" error, and I'm not sure what is causing this problem or how to fix it.

Here’s my current setup: https://go.dev/play/p/7TVn-njfeiH

When I attempt to upload a file around 10MB through this form, the browser gives me a "The connection was reset" error. I’ve verified that smaller files upload without any issues.

What did you see happen?

image

When I attempt to upload a file around 10MB through this form, the browser gives me a "The connection was reset" error. I’ve verified that smaller files upload without any issues.

What did you expect to see?

My uploadHandler currently does nothing but send a 200 OK status. Ideally, I'd like to process the file upload without reading it entirely into memory, to handle larger file uploads efficiently.

Can anyone help me understand why I'm getting this error and how to properly handle large file uploads without reading them completely into memory?

Thanks in advance!

@gabyhelp
Copy link

gabyhelp commented Aug 2, 2024

@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants