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]: KeyError sometimes occurs when taking indexes from a collection #40463

Open
1 task done
dkchung0 opened this issue Mar 7, 2025 · 2 comments
Open
1 task done
Assignees
Labels
kind/bug Issues or changes related a bug triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@dkchung0
Copy link

dkchung0 commented Mar 7, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Environment

Current Behavior

I want to ask

self.collection = Collection(collection_name)

self.collection.load()

self.collection_index_schema = self.collection.indexes[0]

self.collection_index_schema._index_params['index_type']

Sometimes key error occurs but sometimes it works. How to solve it?

Expected Behavior

No response

Steps To Reproduce

Milvus Log

No response

Anything else?

No response

@dkchung0 dkchung0 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 Mar 7, 2025
Copy link

dosubot bot commented Mar 7, 2025

Hello @dkchung0! I'm here to assist you with any bugs, questions, or contributions you may have. Let's work together to resolve any issues you're encountering.

A KeyError when accessing _index_params in a Milvus index schema can occur if the index parameters are not properly set or if the index creation fails. Here are a few things to consider:

  1. Index Creation: Ensure that the index is created successfully with the correct parameters. If the index type or other parameters are incorrect, the index might not be created, leading to missing _index_params.

  2. Collection Load State: Make sure the collection is properly loaded before accessing the index parameters. If the collection is not fully loaded, the index parameters might not be available.

  3. Index Schema Updates: If there are any updates or changes to the index schema, ensure that the collection is released before making changes, as Milvus does not allow altering index properties on a loaded collection [1].

  4. Intermittent Issues: If the issue is intermittent, it might be related to the environment or specific conditions under which the index is accessed. Double-check the consistency of the environment and any conditions that might affect the index loading or creation.

If these steps do not resolve the issue, further investigation into the specific conditions and environment might be necessary.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@yanliang567
Copy link
Contributor

@dkchung0 which version of milvus and pymilvus are you running?
any error msg or Milvus logs?

/assign @dkchung0
/unassign

@sre-ci-robot sre-ci-robot assigned dkchung0 and unassigned yanliang567 Mar 9, 2025
@yanliang567 yanliang567 added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 9, 2025
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/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

2 participants