Comments (8)
https://milvus.io/docs/quickstart.md
We have the document here. but we'd better give directly code example on how to connect with cluster with SSL and how to set username password.
from milvus-docs.
Added token=username:password to below script example:
from pymilvus import connections
_HOST = '127.0.0.1'
_PORT = '19530'
print(f"\nCreate connection...")
connections.connect(host=_HOST, port=_PORT, token="username:password" secure=True, client_pem_path="cert/client.pem",
client_key_path="cert/client.key",
ca_pem_path="cert/ca.pem", server_name="localhost")
print(f"\nList connections:")
print(connections.list_connections())
Otherwise, you will get error below:
Create connection...
grpc RpcError: [__internal_register], <_InactiveRpcError: StatusCode.UNAUTHENTICATED, missing authorization in header>, <Time:{'RPC start': '2024-04-16 13:48:28.405191', 'gRPC error': '2024-04-16 13:48:28.407480'}>
Traceback (most recent call last):
File "/opt/tools/ssl1.py", line 8, in
connections.connect(host=_HOST, port=_PORT, secure=True, server_pem_path="/opt/tools/configs/cert/server.pem", server_name=“hostname.domain”)
File "/usr/local/lib/python3.9/site-packages/pymilvus/orm/connections.py", line 420, in connect
connect_milvus(**kwargs, user=user, password=password, token=token, db_name=db_name)
File "/usr/local/lib/python3.9/site-packages/pymilvus/orm/connections.py", line 371, in connect_milvus
gh._wait_for_channel_ready(timeout=timeout)
File "/usr/local/lib/python3.9/site-packages/pymilvus/client/grpc_handler.py", line 151, in _wait_for_channel_ready
raise e from e
File "/usr/local/lib/python3.9/site-packages/pymilvus/client/grpc_handler.py", line 144, in _wait_for_channel_ready
self._setup_identifier_interceptor(self._user, timeout=timeout)
File "/usr/local/lib/python3.9/site-packages/pymilvus/client/grpc_handler.py", line 262, in _setup_identifier_interceptor
self._identifier = self.__internal_register(user, host, timeout=timeout)
File "/usr/local/lib/python3.9/site-packages/pymilvus/decorators.py", line 161, in handler
raise e from e
File "/usr/local/lib/python3.9/site-packages/pymilvus/decorators.py", line 143, in handler
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/pymilvus/decorators.py", line 182, in handler
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/pymilvus/decorators.py", line 91, in handler
raise e from e
File "/usr/local/lib/python3.9/site-packages/pymilvus/decorators.py", line 87, in handler
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/pymilvus/decorators.py", line 220, in handler
raise e from e
File "/usr/local/lib/python3.9/site-packages/pymilvus/decorators.py", line 212, in handler
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/pymilvus/client/grpc_handler.py", line 1935, in __internal_register
response = self._stub.Connect(request=req)
File "/usr/local/lib64/python3.9/site-packages/grpc/_interceptor.py", line 277, in call
response, ignored_call = self._with_call(
File "/usr/local/lib64/python3.9/site-packages/grpc/_interceptor.py", line 332, in _with_call
return call.result(), call
File "/usr/local/lib64/python3.9/site-packages/grpc/_channel.py", line 437, in result
raise self
File "/usr/local/lib64/python3.9/site-packages/grpc/_interceptor.py", line 315, in continuation
response, call = self._thunk(new_method).with_call(
File "/usr/local/lib64/python3.9/site-packages/grpc/_channel.py", line 1177, in with_call
return _end_unary_response_blocking(state, call, True, None)
File "/usr/local/lib64/python3.9/site-packages/grpc/_channel.py", line 1003, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAUTHENTICATED
details = "missing authorization in header"
debug_error_string = "UNKNOWN:Error received from peer {created_time:"2024-04-16T13:48:28.406502408-04:00", grpc_status:16, grpc_message:"missing authorization in header"}"
from milvus-docs.
yes the main reason is you enabled authentication in server side.
that requires "token="username:password""
from milvus-docs.
![image](https://private-user-images.githubusercontent.com/83447078/323382208-c882b769-cd14-4ae5-8afc-ac4b9c0d4b23.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIwODUwNzYsIm5iZiI6MTcyMjA4NDc3NiwicGF0aCI6Ii84MzQ0NzA3OC8zMjMzODIyMDgtYzg4MmI3NjktY2QxNC00YWU1LThhZmMtYWM0YjljMGQ0YjIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI3VDEyNTI1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM0OGJlZTNlYWU4Y2QxYzY3ZTlhMGU2MDMzNDUwZGMzMTkxMjM5OThiZTRlODJiMzBiOTlkYWE3MjZiNjI4YTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.s_obeyQfOiyQCF_Yef29AkgfLyWzzXy6Up45_OIRlZk)
from milvus-docs.
we will give more example about it.
from milvus-docs.
I was trying to share what I ran into: your example script on https://milvus.io/docs/tls.md does not have token in the script.
from pymilvus import connections
_HOST = '127.0.0.1'
_PORT = '19530'
print(f"\nCreate connection...")
connections.connect(host=_HOST, port=_PORT, secure=True, client_pem_path="cert/client.pem",
client_key_path="cert/client.key",
ca_pem_path="cert/ca.pem", server_name="localhost")
print(f"\nList connections:")
print(connections.list_connections())
from milvus-docs.
yeh I agreed. because tls and authentication are two different features, but we can improve
from milvus-docs.
yeh I agreed. because tls and authentication are two different features, but we can improve
thanks !! Awesome!!
from milvus-docs.
Related Issues (20)
- [ERROR]: 'make' command not working while trying to work with milvus repo HOT 1
- [ERROR]: StorageClass part is confusing
- [ERROR]: Minor Issue with Langchain Integration Docs HOT 2
- [QUESTION]: .npy bulk_insert problem HOT 2
- [QUESTION]: Load error HOT 1
- [ERROR]: milvus-docs/site/en/about/architecture_overview.md does not exist in branch v2.4.x HOT 1
- Image Similarity Search documentation using LangChain HOT 1
- [QUESTION]: No notebook found of Page: Quickstart with Milvus Lite HOT 1
- [QUESTION]: Install Milvus using Docker Compose, can't find files: 404 Not Found after wget command HOT 1
- [Suggestion]: Adding Code Samples HOT 1
- [ERROR]: Run-Milvus-Lite-Locally page documentation content inappropriate HOT 2
- [Suggestion]: How to enable authentication of Milvus in Docker instead of Docker Compose HOT 2
- [ERROR]: The warmup configuration needs to be updated HOT 2
- [ERROR]: sudo docker-compose up -d failed
- [ERROR]: <ParamError: (code=1, message=UnSupported element type: None for Array field: color_coord)>
- [ERROR]: Milvus Official manual: embedding_field = FieldSchema(...) HOT 1
- [QUESTION]: What should be passed in as the files parameter for uility.do_bulk_insert
- [QUESTION]: How can I export my data to move them to a new server where I host another milvus container?
- [ERROR]: Not considering db name as param while migrating data from milvus to milvus
- [QUESTION]: customize ReRanker for hybrid_search
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from milvus-docs.