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

Hertz HTTP3无法运行在Go 1.19及Go1.22 #11

Open
windygopher opened this issue Oct 29, 2024 · 1 comment
Open

Hertz HTTP3无法运行在Go 1.19及Go1.22 #11

windygopher opened this issue Oct 29, 2024 · 1 comment
Assignees

Comments

@windygopher
Copy link

Describe the bug

HTTP3提供的example代码 https://github.com/hertz-contrib/http3/blob/main/examples/quic-go/main.go
无法运行在Ubuntu Go 1.19及Go 1.22环境下,运行代码和仓库一致,即便配置了自己的TLS也无法运行

To Reproduce
在Go 1.22报错信息如下:

$ go run .
# github.com/lucas-clemente/quic-go/internal/qtls
../go/pkg/mod/github.com/lucas-clemente/[email protected]/internal/qtls/go120.go:5:13: cannot use "The version of quic-go you're using can't be built on Go 1.20 yet. For more details, please see https://github.com/lucas-clemente/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built on Go 1.20 yet. F...) as int value in variable declaration

在Go 1.19报错信息如下:

$ go run .
/usr/local/go/src/runtime/stkframe.go:15:6: stkframe redeclared in this block
        /usr/local/go/src/runtime/runtime2.go:998:6: other declaration of stkframe
/usr/local/go/src/runtime/stkframe.go:262:5: methodValueCallFrameObjs redeclared in this block
        /usr/local/go/src/runtime/stack.go:1362:5: other declaration of methodValueCallFrameObjs
/usr/local/go/src/runtime/stkframe.go:264:6: stkobjinit redeclared in this block
        /usr/local/go/src/runtime/stack.go:1364:6: other declaration of stkobjinit
/usr/local/go/src/runtime/traceback.go:670:6: reflectMethodValue redeclared in this block
        /usr/local/go/src/runtime/stkframe.go:65:6: other declaration of reflectMethodValue
/usr/local/go/src/runtime/unsafe.go:53:6: unsafeslice redeclared in this block
        /usr/local/go/src/runtime/slice.go:127:6: other declaration of unsafeslice
/usr/local/go/src/runtime/unsafe.go:74:6: unsafeslice64 redeclared in this block
        /usr/local/go/src/runtime/slice.go:142:6: other declaration of unsafeslice64
/usr/local/go/src/runtime/unsafe.go:82:6: unsafeslicecheckptr redeclared in this block
        /usr/local/go/src/runtime/slice.go:150:6: other declaration of unsafeslicecheckptr
/usr/local/go/src/runtime/unsafe.go:92:6: panicunsafeslicelen redeclared in this block
        /usr/local/go/src/runtime/slice.go:160:6: other declaration of panicunsafeslicelen
/usr/local/go/src/runtime/unsafe.go:96:6: panicunsafeslicenilptr redeclared in this block
        /usr/local/go/src/runtime/slice.go:164:6: other declaration of panicunsafeslicenilptr
/usr/local/go/src/runtime/arena.go:157:26: span.isUserArenaChunk undefined (type *mspan has no field or method isUserArenaChunk)
/usr/local/go/src/runtime/arena.go:157:26: too many errors

Hertz version:

github.com/cloudwego/hertz v0.9.3
github.com/hertz-contrib/http3/network/quic-go v0.1.0
github.com/hertz-contrib/http3/server/quic-go v0.1.0
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b

直接clone 仓库代码并运行,未更改go.mod,也无法正常运行

go run .
2024/10/29 20:40:53.336393 engine.go:617: [Debug] HERTZ: Method=GET    absolutePath=/ping                     --> handlerName=main.run2.func1 (num=1 handlers)
2024/10/29 20:40:53.336921 engine.go:389: [Info] HERTZ: Using network library=quic
2024/10/29 20:40:53 failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.

Hertz version:

require (
	github.com/cloudwego/hertz v0.6.0
	github.com/hertz-contrib/http3/network/quic-go v0.1.0
	github.com/hertz-contrib/http3/server/quic-go v0.1.0
)

Environment:

运行环境为Ubuntu 20 64位

另外,在windows环境下,
无法配置server.WithAltTransport(netpoll.NewTransporter),netpoll在windows下没有实现NewTransporter方法

@welkeyever
Copy link
Contributor

1.20 is not supported by the former version, there is a PR #12 probably can make a progress which I will check soon.

The 1.19 issue you mentioned may not be related to hertz - check if your go is installed properly.

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