Skip to content

错误码:10101 错误信息:内部服务器错误 #97

Description

@zhangduanya

初始化安装之后返回登录显示 “错误码:10101 错误信息:内部服务器错误”
image

后端日志:

{"level":"error","time":"2023-04-07 11:48:14","caller":"core/core.go:371","msg":"got panic","domain":"go-gin-api[fat]","panic":"runtime error: invalid memory address or nil pointer derefer
ence","stack":"goroutine 60 [running]:\nruntime/debug.Stack(0xc0000186f8, 0xedcbe0, 0x3152430)\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x9f\ngithub.com/xinliangnote/go-gin-api/inte
rnal/pkg/core.New.func2.1(0x199dc90, 0xc000010f08, 0xc0001a1b60, 0xc000460120, 0xc00040eb00, 0xc104027fa2748869, 0x31563732a, 0xc0003e7d50)\n\t/opt/repo/src/github.com/xinliangnote/go-gin-
api/internal/pkg/core/core.go:370 +0x20d1\npanic(0xedcbe0, 0x3152430)\n\t/usr/local/go/src/runtime/panic.go:965 +0x1b9\ngithub.com/xinliangnote/go-gin-api/internal/services/admin.(*service
).Detail(0xc00044ece0, 0x199dc90, 0xc0000ad248, 0xc00178d130, 0x0, 0x0, 0x0)\n\t/opt/repo/src/github.com/xinliangnote/go-gin-api/internal/services/admin/service_detail.go:47 +0x1f7\ngithub
.com/xinliangnote/go-gin-api/internal/api/admin.(*handler).Login.func1(0x199dc90, 0xc0000ad248)\n\t/opt/repo/src/github.com/xinliangnote/go-gin-api/internal/api/admin/func_login.go:56 +0x3
8c\ngithub.com/xinliangnote/go-gin-api/internal/pkg/core.wrapHandlers.func1(0xc00040eb00)\n\t/opt/repo/src/github.com/xinliangnote/go-gin-api/internal/pkg/core/core.go:212 +0xad\ngithub.co
m/gin-gonic/gin.(*Context).Next(...)\n\t/opt/repo/pkg/mod/github.com/gin-gonic/gin@v1.7.4/context.go:165\ngithub.com/xinliangnote/go-gin-api/internal/pkg/core.New.func3(0xc00040eb00)\n\t/o
pt/repo/src/github.com/xinliangnote/go-gin-api/internal/pkg/core/core.go:541 +0x108\ngithub.com/gin-gonic/gin.(*Context).Next(...)\n\t/opt/repo/pkg/mod/github.com/gin-gonic/gin@v1.7.4/cont
ext.go:165\ngithub.com/xinliangnote/go-gin-api/internal/pkg/core.New.func2(0xc00040eb00)\n\t/opt/repo/src/github.com/xinliangnote/go-gin-api/internal/pkg/core/core.go:523 +0x250\ngithub.co
m/gin-gonic/gin.(*Context).Next(...)\n\t/opt/repo/pkg/mod/github.com/gin-gonic/gin@v1.7.4/context.go:165\ngithub.com/xinliangnote/go-gin-api/internal/pkg/core.New.func1(0xc00040eb00)\n\t/o
pt/repo/src/github.com/xinliangnote/go-gin-api/internal/pkg/core/core.go:327 +0x67\ngithub.com/gin-gonic/gin.(*Context).Next(...)\n\t/opt/repo/pkg/mod/github.com/gin-gonic/gin@v1.7.4/conte
xt.go:165\ngithub.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc0002489c0, 0xc00040eb00)\n\t/opt/repo/pkg/mod/github.com/gin-gonic/gin@v1.7.4/gin.go:489 +0x2aa\ngithub.com/gin-gonic/gin
.(*Engine).ServeHTTP(0xc0002489c0, 0x19861b8, 0xc00042ad20, 0xc001827600)\n\t/opt/repo/pkg/mod/github.com/gin-gonic/gin@v1.7.4/gin.go:445 +0x15c\ngithub.com/xinliangnote/go-gin-api/interna
l/pkg/core.(*mux).ServeHTTP(0xc000010c10, 0x19861b8, 0xc00042ad20, 0xc001827600)\n\t/opt/repo/src/github.com/xinliangnote/go-gin-api/internal/pkg/core/core.go:232 +0x4c\nnet/http.serverHan
dler.ServeHTTP(0xc00042a460, 0x19861b8, 0xc00042ad20, 0xc001827600)\n\t/usr/local/go/src/net/http/server.go:2868 +0xa3\nnet/http.(*conn).serve(0xc00011a6e0, 0x1988c18, 0xc0001f7880)\n\t/us
r/local/go/src/net/http/server.go:1933 +0x8cd\ncreated by net/http.(Server).Serve\n\t/usr/local/go/src/net/http/server.go:2994 +0x39b\n"}
{"level":"error","time":"2023-04-07 11:48:14","caller":"alert/alert.go:21","msg":"Mail config error","domain":"go-gin-api[fat]"}
{"level":"info","time":"2023-04-07 11:48:14","caller":"core/core.go:509","msg":"trace-log","domain":"go-gin-api[fat]","method":"POST","path":"/api/login","http_code":500,"business_code":10
101,"success":false,"cost_seconds":0.000834516,"trace_id":"093d611b2027c5a1a3cd","trace_info":{"trace_id":"093d611b2027c5a1a3cd","request":{"ttl":"un-limit","method":"POST","decoded_url":"
/api/login","header":{"Authorization":"admin KBaSIIb5rTT0rbgLrixpnIl5ZdtJahdYRHCa+up8mGo=","Authorization-Date":"2023-04-07 11:48:13","Content-Type":"application/x-www-form-urlencoded; cha
rset=UTF-8","Token":""},"body":"username=admin&password=21232f297a57a5a743894a0e4a801fc3"},"response":{"header":{"Access-Control-Allow-Credentials":["true"],"Access-Control-Allow-Origin":[
"
"],"Content-Type":["application/json; charset=utf-8"],"Trace-Id":["093d611b2027c5a1a3cd"],"Vary":["Origin"]},"body":null,"business_code":10101,"business_code_msg":"内部服务器错误"
,"http_code":500,"http_code_msg":"Internal Server Error","cost_seconds":0.000834228},"third_party_requests":null,"debugs":null,"sqls":null,"redis":null,"success":false,"cost_seconds":0.000
834516}}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions