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]: [privilege_group] The error message is wrong when input invalid "db_name" for "grant_v2" interface #37974

Closed
1 task done
binbinlv opened this issue Nov 25, 2024 · 6 comments
Assignees
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@binbinlv
Copy link
Contributor

binbinlv commented Nov 25, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: master-20241125-0b9edb62-amd64
- Deployment mode(standalone or cluster): both
- MQ type(rocksmq, pulsar or kafka):    all
- SDK version(e.g. pymilvus v2.0.0rc2): 2.5.0rc126
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others: 

Current Behavior

The error message is wrong when input invalid "db_name" for "grant_v2" interface:

role.grant_v2(privilege="CollectionReadWrite", db_name="$%", collection_name="binbin")
code=1100, message=the first character of role name must be an underscore or letter: invalid parameter[expected=95][actual=36]

input invalid "db_name", but it reports "role name"...

Expected Behavior

Invalid db_name: $%. the first character of a db name must be an underscore or letter: invalid parameter

Steps To Reproduce

from pymilvus import connections
connections.connect(host="", user="", password="")
from pymilvus import Role
role = Role("binbin_new")
role.grant_v2(privilege="CollectionReadWrite", db_name="$%", collection_name="binbin")

Milvus Log

No response

Anything else?

No response

@binbinlv binbinlv added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 25, 2024
@binbinlv
Copy link
Contributor Author

binbinlv commented Nov 25, 2024

/assign @shaoting-huang

@shaoting-huang
Copy link
Contributor

shaoting-huang commented Nov 25, 2024

/assign

@yanliang567
Copy link
Contributor

/assign @shaoting-huang
/unassign

@yanliang567 yanliang567 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 25, 2024
@yanliang567 yanliang567 added this to the 2.5.0 milestone Nov 25, 2024
@shaoting-huang
Copy link
Contributor

fix:

the first character of a database name must be an underscore or letter: invalid database name[database=$%]

@binbinlv
Copy link
Contributor Author

Verified and fixed in dev branch.
milvus: shaoting-huang-rbacv2fix-df5df8d-20241125
pymilvus: 2.5.0rc126

results:

pymilvus.exceptions.MilvusException: <MilvusException: (code=802, message=the first character of a database name must be an underscore or letter: invalid database name[database=$%])>

@binbinlv
Copy link
Contributor Author

Close it first, and will reopen it if there are any errors on the master image when the fix pr is merged.

sre-ci-robot pushed a commit that referenced this issue Dec 2, 2024
related issue: #37031

fixed issues:
#37974: better error messages for grant v2 interface
#37903: fix meta built-in privilege group object name
#37843: better error messages for custom privilege group interface 
#38002: fix built-in privilege group meta to pass proxy interceptor
check
#38008: fix revoke v2 to support revoking v1 granted privileges

Signed-off-by: shaoting-huang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants