zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.06k stars 3.93k forks source link

runtime error: index out of range [1] with length 1 #3874

Closed xujb977644703 closed 6 months ago

xujb977644703 commented 8 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior, if applicable:

  1. The code is

  2. The error is 2024-01-25T20:03:00.709+08:00 error (/vgo/account/info - 10.244.129.166:45156) runtime error: index out of range [1] with length 1 goroutine 726 [running]: runtime/debug.Stack() D:/Program Files/go/src/runtime/debug/stack.go:24 +0x65 github.com/zeromicro/go-zero/rest/handler.RecoverHandler.func1.1() D:/workspace/yunpan/clouddisk/vendor/github.com/zeromicro/go-zero/rest/handler/recoverhandler.go:16 +0x66 panic({0xd58a00, 0xc00004ee28}) D:/Program Files/go/src/runtime/panic.go:884 +0x213 clouddisk/internal/middleware.(AuthInterceptorMiddleware).Handle.func1({0xef3080?, 0xc0003a2d80}, 0xc00014bf00) D:/workspace/yunpan/clouddisk/internal/middleware/authinterceptormiddleware.go:43 +0x1516 net/http.HandlerFunc.ServeHTTP(0x0?, {0xef3080?, 0xc0003a2d80?}, 0x1d89cd01f?) D:/Program Files/go/src/net/http/server.go:2122 +0x2f github.com/zeromicro/go-zero/rest/handler.GunzipHandler.func1({0xef3080, 0xc0003a2d80}, 0xc00014bf00) D:/workspace/yunpan/clouddisk/vendor/github.com/zeromicro/go-zero/rest/handler/gunziphandler.go:26 +0xe9 net/http.HandlerFunc.ServeHTTP(0xedd4444f4?, {0xef3080?, 0xc0003a2d80?}, 0x8fc5c6636e0?) D:/Program Files/go/src/net/http/server.go:2122 +0x2f github.com/zeromicro/go-zero/rest/handler.MaxBytesHandler.func2.1({0xef3080?, 0xc0003a2d80?}, 0x147da00?) D:/workspace/yunpan/clouddisk/vendor/github.com/zeromicro/go-zero/rest/handler/maxbyteshandler.go:24 +0xff net/http.HandlerFunc.ServeHTTP(0xc00001b6c8?, {0xef3080?, 0xc0003a2d80?}, 0x50?) D:/Program Files/go/src/net/http/server.go:2122 +0x2f github.com/zeromicro/go-zero/rest/handler.MetricHandler.func1.1({0xef3080, 0xc0003a2d80}, 0x4?) D:/workspace/yunpan/clouddisk/vendor/github.com/zeromicro/go-zero/rest/handler/metrichandler.go:21 +0xd5 net/http.HandlerFunc.ServeHTTP(0xc00001b730?, {0xef3080?, 0xc0003a2d80?}, 0xc00001b748?) D:/Program Files/go/src/net/http/server.go:2122 +0x2f github.com/zeromicro/go-zero/rest/handler.RecoverHandler.func1({0xef3080?, 0xc0003a2d80?}, 0x74217e?) D:/workspace/yunpan/clouddisk/vendor/github.com/zeromicro/go-zero/rest/handler/recoverhandler.go:21 +0x83 net/http.HandlerFunc.ServeHTTP(0xc0000c10e0?, {0xef3080?, 0xc0003a2d80?}, 0x442de5?) D:/Program Files/go/src/net/http/server.go:2122 +0x2f github.com/zeromicro/go-zero/rest/handler.(timeoutHandler).ServeHTTP.func1() D:/workspace/yunpan/clouddisk/vendor/github.com/zeromicro/go-zero/rest/handler/timeouthandler.go:82 +0x7c created by github.com/zeromicro/go-zero/rest/handler.(timeoutHandler).ServeHTTP D:/workspace/yunpan/clouddisk/vendor/github.com/zeromicro/go-zero/rest/handler/timeouthandler.go:76 +0x35b caller=internal/log.go:77 trace=2c41bca35d421f0ea2c54836d068be13 span=3d9399a41e24ac9a 2024-01-25T20:03:00.710+08:00 error [HTTP] 500 - GET /vgo/account/info - 10.244.129.166:45156 - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 GET /vgo/account/info HTTP/1.0 Host: netdisk-prds:8084 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9 Connection: close Cookie: weboffice_device_id=b9f8279f74674ab96a5b664f833b35e1; lang=zh-CN; bk_token=74-BX5zyYCvaoArHfXm9hthc7fT-NPJwE_Wt4luSkZg Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36

    duration=2.1ms  caller=handler/loghandler.go:149        trace=2c41bca35d421f0ea2c54836d068be13  span=3d9399a41e24ac9a

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environments (please complete the following information):

More description Add any other context about the problem here.

kevwan commented 8 months ago

Please show your code.

xujb977644703 commented 8 months ago

[Uploading clouddisk.zip…]()

kevwan commented 8 months ago

Uploading clouddisk.zip…

No code.