Closed LL-MF closed 1 year ago
补充信息如下 sh-4.4# ./iatp init --mongourl mongodb://IATP:IATP-by-360@127.0.0.1:27017 --domainname test.com --domainserver 172.17.0.1 1 --username xxtest --password test5656 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1060acc]
goroutine 1 [running]: iatp/common/domain.(Domain).RegisterDomain(...) /go/src/iatp_opensource/common/domain/domain_helper.go:77 iatp/cmd.addDomainConf(0xc000196f00, 0x12efe48, 0x3) /go/src/iatp_opensource/cmd/init.go:113 +0x1cc iatp/cmd.glob..func1(0x1d0f0e0, 0xc0005862c0, 0x1, 0xb) /go/src/iatp_opensource/cmd/init.go:66 +0x136 github.com/spf13/cobra.(Command).execute(0x1d0f0e0, 0xc000586210, 0xb, 0xb, 0x1d0f0e0, 0xc000586210) /go/src/iatp_opensource/vendor/github.com/spf13/cobra/command.go:860 +0x2c2 github.com/spf13/cobra.(Command).ExecuteC(0x1d0e6e0, 0x0, 0x0, 0x0) /go/src/iatp_opensource/vendor/github.com/spf13/cobra/command.go:974 +0x375 github.com/spf13/cobra.(Command).Execute(...) /go/src/iatp_opensource/vendor/github.com/spf13/cobra/command.go:902 iatp/cmd.Execute() /go/src/iatp_opensource/cmd/root.go:47 +0x2d main.main() /go/src/iatp_opensource/main.go:21 +0x25 sh-4.4#
我们在最新版本中,对域用户注册逻辑进行了优化,您可以使用最新版本看下还有没报错~
我们在最新版本中,对域用户注册逻辑进行了优化,您可以使用最新版本看下还有没报错~ 使用最新版本后,登录报错,报错信息如下 [+] demoTEST 域注册失败: 未查询到域控制器. 创建日志缓存.... [-]认证域配置失败:数据库中未注册该域信息, mongo: no documents in result panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe25a43]
goroutine 1 [running]: iatp/cmd.glob..func4(0x1a7f740, {0x1039ae7, 0x5, 0x5}) /go/src/iatp_opensource/cmd/web.go:55 +0x1a3 github.com/spf13/cobra.(Command).execute(0x1a7f740, {0xc0000932c0, 0x5, 0x5}) /go/src/iatp_opensource/vendor/github.com/spf13/cobra/command.go:860 +0x5f8 github.com/spf13/cobra.(Command).ExecuteC(0x1a7efc0) /go/src/iatp_opensource/vendor/github.com/spf13/cobra/command.go:974 +0x3bc github.com/spf13/cobra.(*Command).Execute(...) /go/src/iatp_opensource/vendor/github.com/spf13/cobra/command.go:902 iatp/cmd.Execute() /go/src/iatp_opensource/cmd/root.go:47 +0x25 main.main() /go/src/iatp_opensource/main.go:21 +0x17
.env如下
KAFKAHOST=172.17.10.102 KAFKAADV=PLAINTEXT://172.17.10.102:9092 BROKER=172.17.10.102:9092
MONGOUSER=IATP MONGOPWD=IATP-by-360
DCNAME="demotest.com" DCSERVER=172.17.0.1 DCUSER="CN=test, OU=别名测试, OU=系统账号及组, DC=demotest, DC=com" DCPWD="test"
WEBUSER="test" ~
通过手工执行启动成功
抓取到报错日志如下: mongo_1 | 2023-07-27T05:21:08.377+0000 I NETWORK [listener] connection accepted from 172.20.0.1:55860 #102 (2 connections now open) mongo_1 | 2023-07-27T05:21:08.377+0000 I NETWORK [conn102] received client metadata from 172.20.0.1:55860 conn102: { driver: { name: "mongo-go-driver", version: "v1.8.2" }, os: { type: "linux", architecture: "amd64" }, platform: "go1.15.15" } mongo_1 | 2023-07-27T05:21:08.378+0000 I NETWORK [listener] connection accepted from 172.20.0.1:55864 #103 (3 connections now open) mongo_1 | 2023-07-27T05:21:08.378+0000 I NETWORK [conn103] received client metadata from 172.20.0.1:55864 conn103: { driver: { name: "mongo-go-driver", version: "v1.8.2" }, os: { type: "linux", architecture: "amd64" }, platform: "go1.15.15" } mongo_1 | 2023-07-27T05:21:08.379+0000 I ACCESS [conn103] Supported SASL mechanisms requested for unknown user 'IATP@admin' mongo_1 | 2023-07-27T05:21:08.379+0000 I ACCESS [conn103] SASL SCRAM-SHA-1 authentication failed for IATP on admin from client 172.20.0.1:55864 ; UserNotFound: Could not find user "IATP" for db "admin" mongo_1 | 2023-07-27T05:21:08.380+0000 I NETWORK [conn102] end connection 172.20.0.1:55860 (2 connections now open) mongo_1 | 2023-07-27T05:21:08.380+0000 I NETWORK [conn103] end connection 172.20.0.1:55864 (1 connection now open) mongo_1 | 2023-07-27T05:21:08.784+0000 I NETWORK [listener] connection accepted from 172.20.0.1:55868 #104 (2 connections now open) mongo_1 | 2023-07-27T05:21:08.784+0000 I NETWORK [conn104] received client metadata from 172.20.0.1:55868 conn104: { driver: { name: "mongo-go-driver", version: "v1.8.2" }, os: { type: "linux", architecture: "amd64" }, platform: "go1.15.15" } iatp_1 | [HTTP Server] http: panic serving 172.19.32.6:25381: runtime error: invalid memory address or nil pointer dereference iatp_1 | goroutine 140 [running]: iatp_1 | net/http.(conn).serve.func1(0xc0003db360) iatp_1 | /usr/local/go/src/net/http/server.go:1801 +0x147 iatp_1 | panic(0x11860a0, 0x1d003b0) iatp_1 | /usr/local/go/src/runtime/panic.go:975 +0x47a iatp_1 | go.mongodb.org/mongo-driver/mongo.(Cursor).closeImplicitSession(0x0) iatp_1 | /go/src/iatp_opensource/vendor/go.mongodb.org/mongo-driver/mongo/cursor.go:267 +0x22 iatp_1 | panic(0x11860a0, 0x1d003b0) iatp_1 | /usr/local/go/src/runtime/panic.go:969 +0x1b9 iatp_1 | go.mongodb.org/mongo-driver/mongo.(Cursor).Close(0x0, 0x157a3e0, 0xc0000b4048, 0x0, 0x0) iatp_1 | /go/src/iatp_opensource/vendor/go.mongodb.org/mongo-driver/mongo/cursor.go:180 +0x51 iatp_1 | panic(0x11860a0, 0x1d003b0) iatp_1 | /usr/local/go/src/runtime/panic.go:969 +0x1b9 iatp_1 | go.mongodb.org/mongo-driver/mongo.(Cursor).All(0x0, 0x157a3e0, 0xc0000b4048, 0x10d82e0, 0xc0003a4740, 0x0, 0x0) iatp_1 | /go/src/iatp_opensource/vendor/go.mongodb.org/mongo-driver/mongo/cursor.go:209 +0x1e7 iatp_1 | iatp/iatp_wbm/repositories.(userMemoryRepository).SearchByName(0xc00043fc20, 0xc0004f63ca, 0x5, 0x12f66c4, 0x8, 0xc0004e1ac0) iatp_1 | /go/src/iatp_opensource/iatp_wbm/repositories/user_repository.go:46 +0xb9 iatp_1 | iatp/iatp_wbm/services.(userService).SearchByName(0xc00042fb10, 0xc0004f63ca, 0x5, 0xc0004f63d9, 0xc, 0x159eb20) iatp_1 | /go/src/iatp_opensource/iatp_wbm/services/user_service.go:33 +0x47 iatp_1 | iatp/iatp_wbm/controllers.(UserController).PostLogin(0xc0002cccc0, 0x0, 0x0) iatp_1 | /go/src/iatp_opensource/iatp_wbm/controllers/user_controller.go:118 +0xed iatp_1 | reflect.Value.call(0x1229fa0, 0xc0002cccc0, 0x1613, 0x12f07c5, 0x4, 0x1d68040, 0x0, 0x0, 0x7, 0xc0005ed800, ...) iatp_1 | /usr/local/go/src/reflect/value.go:476 +0x8c7 iatp_1 | reflect.Value.Call(0x1229fa0, 0xc0002cccc0, 0x1613, 0x1d68040, 0x0, 0x0, 0x1613, 0xc0002a9a00, 0xc00005b8b8) iatp_1 | /usr/local/go/src/reflect/value.go:337 +0xb9 iatp_1 | github.com/kataras/iris/v12/mvc.(ControllerActivator).handlerOf.func2(0x159eb20, 0xc0000eaab0) iatp_1 | /go/src/iatp_opensource/vendor/github.com/kataras/iris/v12/mvc/controller.go:497 +0x3cb iatp_1 | github.com/kataras/iris/v12/context.DefaultNext(0x159eb20, 0xc0000eaab0) iatp_1 | /go/src/iatp_opensource/vendor/github.com/kataras/iris/v12/context/context.go:1343 +0x10c iatp_1 | github.com/kataras/iris/v12/context.(context).Next(0xc0000eaab0) iatp_1 | /go/src/iatp_opensource/vendor/github.com/kataras/iris/v12/context/context.go:1352 +0x3e iatp_1 | github.com/kataras/iris/v12/sessions.(Sessions).Handler.func1(0x159eb20, 0xc0000eaab0) iatp_1 | /go/src/iatp_opensource/vendor/github.com/kataras/iris/v12/sessions/sessions.go:105 +0x12d iatp_1 | github.com/kataras/iris/v12/context.Do(0x159eb20, 0xc0000eaab0, 0xc0003c68e0, 0x2, 0x2) iatp_1 | /go/src/iatp_opensource/vendor/github.com/kataras/iris/v12/context/context.go:1030 +0x82 iatp_1 | github.com/kataras/iris/v12/context.(context).Do(0xc0000eaab0, 0xc0003c68e0, 0x2, 0x2) iatp_1 | /go/src/iatp_opensource/vendor/github.com/kataras/iris/v12/context/context.go:1217 +0x55 iatp_1 | github.com/kataras/iris/v12/core/router.(routerHandler).HandleRequest(0xc0002abb80, 0x159eb20, 0xc0000eaab0) iatp_1 | /go/src/iatp_opensource/vendor/github.com/kataras/iris/v12/core/router/handler.go:250 +0x562 iatp_1 | github.com/kataras/iris/v12/core/router.(Router).BuildRouter.func1(0x15766a0, 0xc00023c2a0, 0xc000321900) iatp_1 | /go/src/iatp_opensource/vendor/github.com/kataras/iris/v12/core/router/router.go:135 +0x8f iatp_1 | github.com/kataras/iris/v12/core/router.(Router).ServeHTTP(0xc00007e1e0, 0x15766a0, 0xc00023c2a0, 0xc000321900) iatp_1 | /go/src/iatp_opensource/vendor/github.com/kataras/iris/v12/core/router/router.go:227 +0x48 iatp_1 | net/http.serverHandler.ServeHTTP(0xc00023c0e0, 0x15766a0, 0xc00023c2a0, 0xc000321900) iatp_1 | /usr/local/go/src/net/http/server.go:2843 +0xa3 iatp_1 | net/http.(conn).serve(0xc0003db360, 0x157a3a0, 0xc0001fc300) iatp_1 | /usr/local/go/src/net/http/server.go:1925 +0x8ad iatp_1 | created by net/http.(Server).Serve iatp_1 | /usr/local/go/src/net/http/server.go:2969 +0x36c