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

panic "write: broken pipe" not recovered #3470

Closed
krupyansky opened this issue Jan 13, 2023 · 3 comments
Closed

panic "write: broken pipe" not recovered #3470

krupyansky opened this issue Jan 13, 2023 · 3 comments

Comments

@krupyansky
Copy link

  • 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)
@eeonevision
Copy link
Contributor

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

@krupyansky
Copy link
Author

@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.

@hustuhao
Copy link

hustuhao commented Mar 11, 2024

@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.

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

4 participants