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

bug 点击创建用户的时候会提示Cannot read properties of undefined (reading 'roles') #785

Open
a67793581 opened this issue Feb 28, 2025 · 3 comments
Labels
bug Something isn't working ready_to_release

Comments

@a67793581
Copy link

Describe the bug:

点击创建用户的时候会提示Cannot read properties of undefined (reading 'roles')
真实的原因是因为注册用户密码不符合要求 导致下一个接口异常 中间少了注册的接口判断

Steps to reproduce:

Image

1.curl 'http://127.0.0.1:8000/api/v1/users'
-H 'Accept: application/json, text/plain, /'
-H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,zh-TW;q=0.5'
-H 'Connection: keep-alive'
-H 'Content-Type: application/json'
-H 'DNT: 1'
-H 'Origin: http://127.0.0.1:8000'
-H 'Sec-Fetch-Dest: empty'
-H 'Sec-Fetch-Mode: cors'
-H 'Sec-Fetch-Site: same-origin'
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0'
-H 'milvus-client-id: 5xzqfe'
-H 'sec-ch-ua: "Not(A:Brand";v="99", "Microsoft Edge";v="133", "Chromium";v="133"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "macOS"'
-H 'x-attu-database: test'
--data-raw '{"username":"test","password":"test","roles":["test","admin"]}'
{
"data": {
"extra_info": {},
"error_code": "IllegalArgument",
"reason": "invalid password length: invalid parameter[4 out of range 6 <= value <= 72]",
"code": 1100,
"retriable": false,
"detail": "invalid password length: invalid parameter[4 out of range 6 <= value <= 72]"
},
"statusCode": 200
}
2.curl 'http://127.0.0.1:8000/api/v1/users/test/role/update'
-X 'PUT'
-H 'Accept: application/json, text/plain, /'
-H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,zh-TW;q=0.5'
-H 'Connection: keep-alive'
-H 'Content-Type: application/json'
-H 'DNT: 1'
-H 'Origin: http://127.0.0.1:8000'
-H 'Sec-Fetch-Dest: empty'
-H 'Sec-Fetch-Mode: cors'
-H 'Sec-Fetch-Site: same-origin'
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0'
-H 'milvus-client-id: 5xzqfe'
-H 'sec-ch-ua: "Not(A:Brand";v="99", "Microsoft Edge";v="133", "Chromium";v="133"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "macOS"'
-H 'x-attu-database: test'
--data-raw '{"username":"test","roles":["test","admin"]}'
{
"statusCode": 500,
"message": "Cannot read properties of undefined (reading 'roles')"
}

Attu version:
v 2.5.4

Milvus version:
pkg/v2.5.5-gpu

@shanghaikid shanghaikid added the bug Something isn't working label Feb 28, 2025
@shanghaikid
Copy link
Collaborator

这里的根本原因是你的password太短了,导致了milvus创建用户失败,下个版本attu会做一些提示和限制。

@a67793581
Copy link
Author

这里的根本原因是你的password太短了,导致了milvus创建用户失败,下个版本attu会做一些提示和限制。

是的 我修复了

@shanghaikid
Copy link
Collaborator

我已经修了:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready_to_release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants