qdrant / qdrant/qdrant-client

Unable to close grpc_channel. Connection was interrupted on the server side

Open
#465 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.4k
Forks
304
Avg merge
2d 9h
Merged PRs (30d)
37

Description

I set up a Qdrant Vector DB in a Docker container and created a Python script to query the Vector DB using QdrantClient. However, after executing all queries, when the QdrantClient attempts to close the connection, it throws an error stating, "Unable to close grpc_channel. Connection was interrupted on the server side."

Current Behavior

The error message from QdrantClient:

[2024-01-30 12:27:28,956-WARNING: close:163] Unable to close grpc_channel. Connection was interrupted on the server side
Exception ignored in: <function QdrantClient.__del__ at 0x7fea068b9ee0>
Traceback (most recent call last):
  File "/lib/python3.9/site-packages/qdrant_client/qdrant_client.py", line 132, in __del__
  File "/lib/python3.9/site-packages/qdrant_client/qdrant_client.py", line 139, in close
  File "/lib/python3.9/site-packages/qdrant_client/qdrant_remote.py", line 163, in close
  File "/lib/python3.9/logging/__init__.py", line 2082, in warning
  File "/lib/python3.9/logging/__init__.py", line 1458, in warning
  File "/lib/python3.9/logging/__init__.py", line 1589, in _log
  File "/lib/python3.9/logging/__init__.py", line 1599, in handle
  File "/lib/python3.9/site-packages/sentry_sdk/integrations/logging.py", line 102, in sentry_patched_callhandlers
TypeError: argument of type 'NoneType' is not iterable

Steps to Reproduce

  1. Config the vector DB using docker-compose
version: '3.9'

services:
    vector-db:
        image: qdrant/qdrant
        volumes:
            - ./data/qdrant_storage:/qdrant/storage:z
        ports:
            - 6333:6333
            - 6334:6334
        networks:
            - my-net

networks:
  my-net:
  1. Initialize QdrantClient in a custom Python class's __init__ method to execute queries in other methods:
class MyClass(ABC):
    def __init__(self):
        self.vector_db_client = QdrantClient("vector-db", prefer_grpc=True)

    def my_func(self):
        # Make queries to the Vector DB using `self.vector_db_client`
  1. Run the script and encounter the above error upon exiting.

Expected Behavior

The script should exit successfully without any errors.

Context (Environment)

  • Qdrant Vector DB: v1.7.3
  • qdrant-client: v1.7.1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the shutdown behavior with the provided docker-compose setup, Qdrant v1.7.3, and qdrant-client v1.7.1. Start with qdrant_client.py lines 132-139 and qdrant_remote.py line 163, then trace the close path and its logging interaction. Done means the script exits without the grpc_channel warning or the ignored-exception traceback.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, grpc, python
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.