• With issues:
  • Use the search tool before opening a new issue.
  • Please provide source code and commit sha if you found a bug.
  • Review existing issues and provide feedback or react to them.

Description

panic: write tcp [::1]:8085->[::1]:41908: write: broken pipe

goroutine 45712 [running]: github.com/gin-gonic/gin/render.JSON.Render(...) /home/arman/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/render/json.go:58 github.com/gin-gonic/gin.(Context).Render(0xc000e99100, 0x1f4, {0xa04bf0, 0xc000025470}) /home/arman/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:910 +0xf8 github.com/gin-gonic/gin.(Context).JSON(...) /home/arman/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:953 github.com/gin-gonic/gin.(Context).AbortWithStatusJSON(...) /home/arman/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:204 github.com/armanokka/transloapi/cmd/api/v3.(App).BatchTranslateHandler.func2() /home/arman/rapidapi-translate/cmd/api/v3/batch_translate.go:129 +0x509 golang.org/x/sync/errgroup.(Group).Go.func1() /home/arman/go/pkg/mod/golang.org/x/sync@v0.0.0-20220722155255-886fb9371eb4/errgroup/errgroup.go:75 +0x64 created by golang.org/x/sync/errgroup.(Group).Go /home/arman/go/pkg/mod/golang.org/x/sync@v0.0.0-20220722155255-886fb9371eb4/errgroup/errgroup.go:72 +0xa5

Content of /home/arman/rapidapi-translate/cmd/api/v3/batch_translate.go:129: c.AbortWithStatusJSON(500, ErrInternal) c == *gin.Context

And I have: r := gin.New() r.Use(gin.Recovery()) but I am getting panic

Environment

  • go version: 1.19
  • gin version (or commit ref): 1.8.1
  • operating system: linux (ubuntu 22.04)

Comment From: eeonevision

Slava, hello. I tried to fix this in issue: #2150

Check it, please. Maybe it solves your issue. Now, we are waiting for our maintainers to approve #2150

Comment From: krupyansky

@eeonevision yes, it solves my issue.

I'm surprised your pull request hasn't been accepted since 2019. However, many people have a similar problem.

I am shocked by the creators of gin.

Comment From: hustuhao

@eeonevision yes, it solves my issue.

I'm surprised your pull request hasn't been accepted since 2019. However, many people have a similar problem.

I am shocked by the creators of gin.

I met the same problem.

Now the committed codes of issue #2150 is merged. Try to update gin to the version v1.9.0 which declared that issue #2150 is fixed.