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]: Collection not getting created even though max len is passed. #35047

Closed
1 task done
Pankaj-Sharma-01 opened this issue Jul 27, 2024 · 3 comments
Closed
1 task done
Assignees
Labels
kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@Pankaj-Sharma-01
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version:2.4.4
- Deployment mode(standalone or cluster):standalone local
- OS: Sonoma 14.5 Macbook air m1
- CPU/Memory:8 GB

Current Behavior

I am trying to create a new collection locally with a custom schema but it is throwing up a MAX len not found error.

pymilvus.exceptions.MilvusException: <MilvusException: (code=2000, message=Assert "type_map.count(MAX_LENGTH)" at /Users/zilliz/milvus-lite/thirdparty/milvus/internal/core/src/common/Schema.cpp:70

Expected Behavior

No response

Steps To Reproduce

Using the following code:

from pymilvus import (
    connections,
    utility,
    FieldSchema,
    CollectionSchema,
    DataType,
    Collection,
    MilvusClient
)

milvus_client = MilvusClient(f"pdf_para.db" )

collection_name = "test_schema"

has_collection = milvus_client.has_collection(collection_name, timeout=5)
if has_collection:
    milvus_client.drop_collection(collection_name)

schema = milvus_client.create_schema(enable_dynamic_field=True)

schema.add_field(field_name="paragraph_id", datatype=DataType.VARCHAR,  max_length=65,is_primary = True, auto_id = False)
schema.add_field(field_name="embeddings", datatype=DataType.FLOAT_VECTOR, dim=512)
schema.add_field(field_name = "text",datatype=DataType.STRING )
schema.add_field(field_name = "file",datatype=DataType.STRING)

index_params = milvus_client.prepare_index_params()

index_params.add_index(
    field_name="embeddings",
    metric_type="COSINE",
    index_type="IVF_FLAT",
    index_name="vector_index",
)
milvus_client.create_collection(collection_name, schema=schema, index_params=index_params, consistency_level="Strong", )

Milvus Log

pymilvus.exceptions.MilvusException: <MilvusException: (code=2000, message=Assert "type_map.count(MAX_LENGTH)" at /Users/zilliz/milvus-lite/thirdparty/milvus/internal/core/src/common/Schema.cpp:70

Anything else?

No response

@Pankaj-Sharma-01 Pankaj-Sharma-01 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 Jul 27, 2024
@Pankaj-Sharma-01 Pankaj-Sharma-01 changed the title [Bug]: Index not getting creating even though max len is passed. [Bug]: Collection not getting created even though max len is passed. Jul 27, 2024
@xiaofan-luan
Copy link
Collaborator

hi @Pankaj-Sharma-01
please move this to https://github.com/milvus-io/milvus-lite repo

@Pankaj-Sharma-01
Copy link
Author

sure

@huy-qn
Copy link

huy-qn commented Jul 28, 2024

wow so this just happened to day? happening for me as well, not sure what is happening

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 needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

4 participants