ServiceList请求报错
来源:5-16 服务管理 - 服务列表 - 格式化接入方式1

Kurama丶
2021-03-06
问题描述
Get获取列表报错,interface conversion: interface {} is lib.TraceContext, not lib.TraceContext
Request param
Info string `关键词(非必填)`
Page_Size int `每页条数(必填)`
Page_No int `当前页数(必填)`
Response body
"errno": 500,
"errmsg": "interface conversion: interface {} is *lib.TraceContext, not *lib.TraceContext (types from different scopes)", "data": "",
"trace_id": "ac185001604435ad76644eec104dc7b0",
"stack": "interface conversion: interface {} is *lib.TraceContext, not *lib.TraceContext (types from different scopes)"
我的代码
代码链接
Error Log
[INFO][2021-03-07T10:08:45.486][log.go:58] _com_request_in||traceid=ac185001604435ad76644eec104dc7b0||spanid=cc5c65ac380704bb||method=GET||args=map[]||body=||from=127.0.0.1||cspanid=||uri=/service/service_list?page_size=22&page_no=1
[INFO][2021-03-07T10:08:45.486][log.go:58] _com_mysql_success||proc_time=0.000000000||cspanid=||spanid=cc5c65ac380704bb||level=sql||source=E:/go_gateway/gin_scaffold/dao/service_info.go:79||affected_row=5||traceid=ac185001604435ad76644eec104dc7b0||current_time=2021-03-07 10:08:45||sql=SELECT * FROM `gateway_service_info` WHERE (is_delete=0) ORDER BY id desc LIMIT 22 OFFSET 0
[INFO][2021-03-07T10:08:45.486][log.go:58] _com_mysql_success||proc_time=0.000000000||sql=SELECT count(*) FROM `gateway_service_info` WHERE (is_delete=0) LIMIT 22 OFFSET 0||affected_row=0||spanid=cc5c65ac380704bb||level=sql||source=E:/go_gateway/gin_scaffold/dao/service_info.go:82||current_time=2021-03-07 10:08:45||traceid=ac185001604435ad76644eec104dc7b0||cspanid=
[INFO][2021-03-07T10:08:45.486][log.go:58] _com_request_out||args=map[]||response=<nil>||proc_time=0.0029998||traceid=ac185001604435ad76644eec104dc7b0||cspanid=||spanid=cc5c65ac380704bb||uri=/service/service_list?page_size=22&page_no=1||from=127.0.0.1||method=GET
[INFO][2021-03-07T10:08:45.486][log.go:58] _com_panic||stack=goroutine 41 [running]:nruntime/debug.Stack(0xe851a0, 0xc000244960, 0xf774d0)ntC:/Go/src/runtime/debug/stack.go:24 +0xa5ngithub.com/e421083458/gin_scaffold/middleware.RecoveryMiddleware.func1.1(0xc0000dc000)ntE:/go_gateway/gin_scaffold/middleware/recovery.go:21 +0x234npanic(0xe924c0, 0xc000442d80)ntC:/Go/src/runtime/panic.go:969 +0x1c7ngithub.com/e421083458/gorm.(*Scope).callCallbacks.func1(0xc0001d2900)ntE:/Golang_Workspace/src/pkg/mod/github.com/e421083458/gorm@v1.0.1/scope.go:863 +0xbanpanic(0xe924c0, 0xc000442d80)ntC:/Go/src/runtime/panic.go:969 +0x1c7ngithub.com/e421083458/golang_common/lib.(*MysqlGormLogger).CtxPrint(0xc0002a06a0, 0xc0002d6d80, 0xc00044a360, 0x6, 0x6)ntE:/Golang_Workspace/src/pkg/mod/github.com/e421083458/golang_common@v1.0.3/lib/mysql.go:139 +0x1abngithub.com/e421083458/gorm.(*DB).print(0xc0002d6d80, 0xc00044a360, 0x6, 0x6)ntE:/Golang_Workspace/src/pkg/mod/github.com/e421083458/gorm@v1.0.1/main.go:803 +0x69ngithub.com/e421083458/gorm.(*DB).slog(0xc0002d6d80, 0xc0002b6de0, 0x5f, 0xc0092b4b5d2170b0, 0x5dc034fa9, 0x1e14c80, 0xc000384160, 0x1, 0x1)ntE:/Golang_Workspace/src/pkg/mod/github.com/e421083458/gorm@v1.0.1/main.go:817 +0x225ngithub.com/e421083458/gorm.(*Scope).trace(0xc0001d2900, 0xc0092b4b5d2170b0, 0x5dc034fa9, 0x1e14c80)ntE:/Golang_Workspace/src/pkg/mod/github.com/e421083458/gorm@v1.0.1/scope.go:1034 +0x91ngithub.com/e421083458/gorm.queryCallback(0xc0001d2900)ntE:/Golang_Workspace/src/pkg/mod/github.com/e421083458/gorm@v1.0.1/callback_query.go:97 +0x8c5ngithub.com/e421083458/gorm.(*Scope).callCallbacks(0xc0001d2900, 0xc0001d6480, 0x3, 0x4, 0x0)ntE:/Golang_Workspace/src/pkg/mod/github.com/e421083458/gorm@v1.0.1/scope.go:867 +0x8angithub.com/e421083458/gorm.(*DB).Find(0xc0002d6cc0, 0xeb57a0, 0xc00044a120, 0x0, 0x0, 0x0, 0xc0002d6cc0)ntE:/Golang_Workspace/src/pkg/mod/github.com/e421083458/gorm@v1.0.1/main.go:336 +0x9fngithub.com/e421083458/gin_scaffold/dao.(*HttpRule).Find(0xc00044a0c0, 0xc0000dc000, 0xc0002d6000, 0xc00044a0c0, 0x1, 0xc0002d69c0, 0xc0002d6300)ntE:/go_gateway/gin_scaffold/dao/service_http_rule.go:27 +0xf3ngithub.com/e421083458/gin_scaffold/dao.(*ServiceInfo).ServiceDetail(0xc000150e00, 0xc0000dc000, 0xc0002d6000, 0xc000150e00, 0xc000120e00, 0x5, 0x8)ntE:/go_gateway/gin_scaffold/dao/service_info.go:34 +0x8fngithub.com/e421083458/gin_scaffold/controller.(*ServiceController).ServiceList(0x1e48e98, 0xc0000dc000)ntE:/go_gateway/gin_scaffold/controller/service.go:54 +0x29cngithub.com/gin-gonic/gin.(*Context).Next(0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/context.go:124 +0x42ngithub.com/e421083458/gin_scaffold/middleware.TranslationMiddleware.func1(0xc0000dc000)ntE:/go_gateway/gin_scaffold/middleware/translation.go:64 +0x35bngithub.com/gin-gonic/gin.(*Context).Next(0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/context.go:124 +0x42ngithub.com/e421083458/gin_scaffold/middleware.SessionAuthMiddleware.func1(0xc0000dc000)ntE:/go_gateway/gin_scaffold/middleware/session_auth.go:18 +0x14bngithub.com/gin-gonic/gin.(*Context).Next(0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/context.go:124 +0x42ngithub.com/e421083458/gin_scaffold/middleware.RequestLog.func1(0xc0000dc000)ntE:/go_gateway/gin_scaffold/middleware/request_log.go:59 +0x65ngithub.com/gin-gonic/gin.(*Context).Next(0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/context.go:124 +0x42ngithub.com/e421083458/gin_scaffold/middleware.RecoveryMiddleware.func1(0xc0000dc000)ntE:/go_gateway/gin_scaffold/middleware/recovery.go:33 +0x55ngithub.com/gin-gonic/gin.(*Context).Next(0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/context.go:124 +0x42ngithub.com/gin-gonic/contrib/sessions.Sessions.func1(0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/contrib@v0.0.0-20191209060500-d6e26eeaa607/sessions/sessions.go:65 +0x1b3ngithub.com/gin-gonic/gin.(*Context).Next(0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/context.go:124 +0x42ngithub.com/gin-gonic/gin.RecoveryWithWriter.func1(0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/recovery.go:83 +0x67ngithub.com/gin-gonic/gin.(*Context).Next(0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/context.go:124 +0x42ngithub.com/gin-gonic/gin.LoggerWithConfig.func1(0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/logger.go:240 +0xf4ngithub.com/gin-gonic/gin.(*Context).Next(0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/context.go:124 +0x42ngithub.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc00028c000, 0xc0000dc000)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/gin.go:389 +0x5c5ngithub.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc00028c000, 0x1092d80, 0xc0002f41c0, 0xc000400300)ntE:/Golang_Workspace/src/pkg/mod/github.com/gin-gonic/gin@v1.4.0/gin.go:351 +0x13bnnet/http.serverHandler.ServeHTTP(0xc0002f40e0, 0x1092d80, 0xc0002f41c0, 0xc000400300)ntC:/Go/src/net/http/server.go:2843 +0xaannet/http.(*conn).serve(0xc00007a000, 0x1095200, 0xc0002a2380)ntC:/Go/src/net/http/server.go:1925 +0x8adncreated by net/http.(*Server).ServentC:/Go/src/net/http/server.go:2969 +0x36dn||traceid=ac185001604435ad76644eec104dc7b0||cspanid=||spanid=cc5c65ac380704bb||error=interface conversion: interface {} is *lib.TraceContext, not *lib.TraceContext (types from different scopes)
写回答
1回答
-
Kurama丶
提问者
2021-03-09
应该是导错lib库了,更改后又出现了新的问题,登录和获取列表都提示get pool error,数据库配置没问题啊。。
122021-03-10
相似问题