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

上传图片提示runtime error: invalid memory address or nil pointer dereference #107

Open
TurboHsu opened this issue Jun 14, 2020 · 0 comments

Comments

@TurboHsu
Copy link

TurboHsu commented Jun 14, 2020

Question(提问)

Build了dev分支的源码,上传图片提示如下

TurboCloud-IMG:runtime error: invalid memory address or nil pointer dereference

Request Method: | POST
-- | --
Request URL: | /api/v1/web_upload
RemoteAddr: | ***********************

/usr/lib/golang/src/runtime/panic.go:679
/usr/lib/golang/src/runtime/panic.go:199
/usr/lib/golang/src/runtime/signal_unix.go:394
/root/go/pkg/mod/github.com/astaxie/[email protected]/controller.go:557
/usr/lib/golang/src/reflect/value.go:460
/usr/lib/golang/src/reflect/value.go:321
/root/go/pkg/mod/github.com/astaxie/[email protected]/router.go:853
/usr/lib/golang/src/net/http/server.go:2802
/usr/lib/golang/src/net/http/server.go:1890
/usr/lib/golang/src/runtime/asm_amd64.s:1357

后端抛这个

2020/06/14 11:18:55.113 [C] [panic.go:679]  the request url is  /api/v1/web_upload
2020/06/14 11:18:55.113 [C] [panic.go:679]  Handler crashed with error runtime error: invalid memory address or nil pointer dereference
2020/06/14 11:18:55.113 [C] [panic.go:679]  /usr/lib/golang/src/runtime/panic.go:679
2020/06/14 11:18:55.113 [C] [panic.go:679]  /usr/lib/golang/src/runtime/panic.go:199
2020/06/14 11:18:55.113 [C] [panic.go:679]  /usr/lib/golang/src/runtime/signal_unix.go:394
2020/06/14 11:18:55.113 [C] [panic.go:679]  /root/go/pkg/mod/github.com/astaxie/[email protected]/controller.go:557
2020/06/14 11:18:55.113 [C] [panic.go:679]  /usr/lib/golang/src/reflect/value.go:460
2020/06/14 11:18:55.113 [C] [panic.go:679]  /usr/lib/golang/src/reflect/value.go:321
2020/06/14 11:18:55.113 [C] [panic.go:679]  /root/go/pkg/mod/github.com/astaxie/[email protected]/router.go:853
2020/06/14 11:18:55.113 [C] [panic.go:679]  /usr/lib/golang/src/net/http/server.go:2802
2020/06/14 11:18:55.113 [C] [panic.go:679]  /usr/lib/golang/src/net/http/server.go:1890
2020/06/14 11:18:55.113 [C] [panic.go:679]  /usr/lib/golang/src/runtime/asm_amd64.s:1357

这个问题在2.3.9的源码build中发现上传小的图片不会报错,大图就gg

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

1 participant