Skip to content

[Upload Error]: [upload part: send upload part 81 RPC: rpcDoRequest: retryUntilAck: engine forcibly closed: context canceled] #1021

@jhemmmm

Description

@jhemmmm

What version of gotd are you using?

github.com/gotd/td v0.71.0

Can this issue be reproduced with the latest version?

Yes

What did you do?

func (d *Telegram) upload(path string) (int, *tg.Document, error) {
	f, err := uploader.NewUploader(d.TGClient).WithPartSize(524288).WithProgress(d).WithThreads(12).FromPath(d.Context, path)
	if err != nil {
		return 0, nil, err
	}
	msg, err := unpack.Message(message.NewSender(d.TGClient).Media(d.Context, message.UploadedDocument(f)))
	if err != nil {
		return 0, nil, err
	}
	doc, ok := msg.Media.(*tg.MessageMediaDocument).Document.AsNotEmpty()
	if !ok {
		return 0, nil, fmt.Errorf("invalid document")
	}
	return msg.ID, doc, nil
}

What did you expect to see?

No error

What did you see instead?

upload part: send upload part 81 RPC: rpcDoRequest: retryUntilAck: engine forcibly closed: context canceled
upload part: send upload part 154 RPC: rpcDoRequest: engine forcibly closed: context canceled

What Go version and environment are you using?

go version go1.19.2 linux/amd64
go env Output
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=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/user/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/user/gotelegram/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1435934855=/tmp/go-build -gno-record-gcc-switches"

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions