Yearning icon indicating copy to clipboard operation
Yearning copied to clipboard

2.3.5.docker-compose部署:用户名,密码错误

Open linux998 opened this issue 3 years ago • 11 comments

Describe the bug 描述Bug 使用docker/docker-compose.yml 部署

使用信息:# 默认账号:admin,默认密码:Yearning_admin

To Reproduce 如何复现

使用2.3.5版本中的 docker-compose部署, 方式: 在docker目录下 docker-compose up -d 启动后即可。

linux998 avatar Feb 14 '22 08:02 linux998

进到容器里面, 执行下install命令

kasnet avatar Mar 31 '22 12:03 kasnet

Describe the bug 描述Bug 使用docker/docker-compose.yml 部署

使用信息:# 默认账号:admin,默认密码:Yearning_admin

To Reproduce 如何复现

使用2.3.5版本中的 docker-compose部署, 方式: 在docker目录下 docker-compose up -d 启动后即可。

确认下是否使用的是docker-compose中的数据库。如不是需要先创建好数据库

chaiyd avatar May 10 '22 10:05 chaiyd

进到容器里面, 执行下install命令

我执行install时,提示已经初始化,不能再次初始化。我看了一下db里的yearning库,表是都建了,但是account表里没有记录。我手工加了一条记录之后,登录提示500,后台log报了个错:


yee v0.2.3 [Warn] 2022-05-16 15:14:06 "url":"/login" "method":"POST" "status":500 "protocol":"HTTP/1.1" "remote_ip":"192.168.8.150" "bytes_in": "39 bytes" "bytes_out": "21 bytes"

yee v0.2.3 [Critical] 2022-05-16 15:14:16 (/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/recovery.go:33) [PANIC RECOVER] runtime error: index out of range [2] with length 1 Traceback:

	/usr/local/go/src/runtime/panic.go:88

	/Users/henryyee/Yearning-go/src/lib/encrypt.go:54

	/Users/henryyee/Yearning-go/src/handler/login/login.go:81

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/gzip.go:66

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/recovery.go:38

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/logger.go:57

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/cors.go:96

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/yee.go:196

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/yee.go:128

	/usr/local/go/src/net/http/server.go:2888

	/usr/local/go/src/net/http/server.go:1953

我用的不是demo库,而是连接了外部mysql,看起来执行力schema创建的sql,但是没有初始化数据。

winglight avatar May 16 '22 07:05 winglight

进到容器里面, 执行下install命令

我执行install时,提示已经初始化,不能再次初始化。我看了一下db里的yearning库,表是都建了,但是account表里没有记录。我手工加了一条记录之后,登录提示500,后台log报了个错:


yee v0.2.3 [Warn] 2022-05-16 15:14:06 "url":"/login" "method":"POST" "status":500 "protocol":"HTTP/1.1" "remote_ip":"192.168.8.150" "bytes_in": "39 bytes" "bytes_out": "21 bytes"

yee v0.2.3 [Critical] 2022-05-16 15:14:16 (/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/recovery.go:33) [PANIC RECOVER] runtime error: index out of range [2] with length 1 Traceback:

	/usr/local/go/src/runtime/panic.go:88

	/Users/henryyee/Yearning-go/src/lib/encrypt.go:54

	/Users/henryyee/Yearning-go/src/handler/login/login.go:81

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/gzip.go:66

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/recovery.go:38

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/logger.go:57

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/cors.go:96

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/yee.go:196

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/yee.go:128

	/usr/local/go/src/net/http/server.go:2888

	/usr/local/go/src/net/http/server.go:1953

我用的不是demo库,而是连接了外部mysql,看起来执行力schema创建的sql,但是没有初始化数据。

ok,已经找到原因了。是因为默认没有执行install的原因。README已经更新,等待合并吧。后面看看有什么好的初始化的办法

chaiyd avatar May 16 '22 07:05 chaiyd

进到容器里面, 执行下install命令

我执行install时,提示已经初始化,不能再次初始化。我看了一下db里的yearning库,表是都建了,但是account表里没有记录。我手工加了一条记录之后,登录提示500,后台log报了个错:


yee v0.2.3 [Warn] 2022-05-16 15:14:06 "url":"/login" "method":"POST" "status":500 "protocol":"HTTP/1.1" "remote_ip":"192.168.8.150" "bytes_in": "39 bytes" "bytes_out": "21 bytes"

yee v0.2.3 [Critical] 2022-05-16 15:14:16 (/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/recovery.go:33) [PANIC RECOVER] runtime error: index out of range [2] with length 1 Traceback:

	/usr/local/go/src/runtime/panic.go:88

	/Users/henryyee/Yearning-go/src/lib/encrypt.go:54

	/Users/henryyee/Yearning-go/src/handler/login/login.go:81

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/gzip.go:66

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/recovery.go:38

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/logger.go:57

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/cors.go:96

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/yee.go:196

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/yee.go:128

	/usr/local/go/src/net/http/server.go:2888

	/usr/local/go/src/net/http/server.go:1953

我用的不是demo库,而是连接了外部mysql,看起来执行力schema创建的sql,但是没有初始化数据。

ok,已经找到原因了。是因为默认没有执行install的原因。README已经更新,等待合并吧。后面看看有什么好的初始化的办法

我删了表,重新执行了install,然而account里虽然有admin数据了,但是登录依然提示密码错误

winglight avatar May 16 '22 08:05 winglight

进到容器里面, 执行下install命令

我执行install时,提示已经初始化,不能再次初始化。我看了一下db里的yearning库,表是都建了,但是account表里没有记录。我手工加了一条记录之后,登录提示500,后台log报了个错:


yee v0.2.3 [Warn] 2022-05-16 15:14:06 "url":"/login" "method":"POST" "status":500 "protocol":"HTTP/1.1" "remote_ip":"192.168.8.150" "bytes_in": "39 bytes" "bytes_out": "21 bytes"

yee v0.2.3 [Critical] 2022-05-16 15:14:16 (/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/recovery.go:33) [PANIC RECOVER] runtime error: index out of range [2] with length 1 Traceback:

	/usr/local/go/src/runtime/panic.go:88

	/Users/henryyee/Yearning-go/src/lib/encrypt.go:54

	/Users/henryyee/Yearning-go/src/handler/login/login.go:81

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/gzip.go:66

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/recovery.go:38

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/logger.go:57

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/middleware/cors.go:96

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/context.go:106

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/yee.go:196

	/Users/henryyee/go/pkg/mod/github.com/cookie!y/[email protected]/yee.go:128

	/usr/local/go/src/net/http/server.go:2888

	/usr/local/go/src/net/http/server.go:1953

我用的不是demo库,而是连接了外部mysql,看起来执行力schema创建的sql,但是没有初始化数据。

ok,已经找到原因了。是因为默认没有执行install的原因。README已经更新,等待合并吧。后面看看有什么好的初始化的办法

我删了表,重新执行了install,然而account里虽然有admin数据了,但是登录依然提示密码错误

库删掉重建呢?

chaiyd avatar May 16 '22 09:05 chaiyd

删掉库之后执行install,提示:mysql连接失败! 亲 数据库建了没? 配置填对了没?

winglight avatar May 17 '22 03:05 winglight

yearning

删掉库之后,再次手动新增库,再执行install,这次可以登录——这个步骤,跟我第一次的操作一模一样呀?

winglight avatar May 17 '22 03:05 winglight

yearning

删掉库之后,再次手动新增库,再执行install,这次可以登录——这个步骤,跟我第一次的操作一模一样呀?

  • 如图,首次安装把command 取消注释。先初始化,初始化完成之后把这一行删掉重启
  • https://github.com/cookieY/Yearning/tree/next/docker image

chaiyd avatar May 17 '22 03:05 chaiyd