Milvus报错[ERROR][SERVER][TakeToEUse milvus.has_collection to verify whether the collection exists

202 篇文章 13 订阅
21 篇文章 4 订阅

文档:https://pymilvus.readthedocs.io/en/latest/

报错

[2022-04-25 23:07:20,681][ERROR][SERVER][TakeToExecute][reqsched_thread] Request failed with code: Error code(30100): Collection xxx does not exist. Use milvus.has_collection to verify whether the collection exists. You also can check whether the collection name exists.

解决方案

删除的时候一定是先删除索引,再删除集合,顺序反了会报错

创建的时候一定是后创建索引,先创建集合,顺序反了会报错

    def insert_ini(self, collection_name, vectors, ids=None, partition_tag=None):
        try:
            if self.has_collection(collection_name):
                self.client.drop_index(collection_name)
                self.client.drop_collection(collection_name)
            self.creat_collection(collection_name)
            self.create_index(collection_name)
            print('collection info: {}'.format(self.client.get_collection_info(collection_name)[1]))
            self.create_partition(collection_name, partition_tag)
            if vectors != -1:
                status, ids = self.client.insert(
                    collection_name=collection_name,
                    records=vectors,
                    ids=ids,
                    partition_tag=partition_tag)
                self.client.flush([collection_name])
                print(
                    'Insert {} entities, there are {} entities after insert data.'.
                    format(
                        len(ids), self.client.count_entities(collection_name)[1]))
                return status, ids
            else:
                return -1, ids
        except Exception as e:
            print("Milvus insert error:", e)

整体弄完后,一定要去组件的后台查看日志,看是否有异常

单机版

 cd /home/$USER/milvus/logs

无报错日志才算彻底正常

cat milvus-22-04-25-22:22-error.log

在这里插入图片描述

mishards集群版,还是报错

[2022-04-26 01:13:47,971][ERROR][SERVER][TakeToExecute][reqsched_thread] Request failed with code: Error: Collection already exists and it is in delete state, please wait a second
[2022-04-26 01:13:47,975][ERROR][SERVER][TakeToExecute][reqsched_thread] Request failed with code: Error code(30100): Collection call_12345_prd does not exist. Use milvus.has_collection to verify whether the collection exists. You also can check whether the collection name exists.
[2022-04-26 01:13:47,978][ERROR][SERVER][TakeToExecute][reqsched_thread] Request failed with code: Error code(30100): Collection call_12345_prd does not exist. Use milvus.has_collection to verify whether the collection exists. You also can check whether the collection name exists.
[2022-04-26 01:13:47,981][ERROR][SERVER][TakeToExecute][reqsched_thread] Request failed with code: Error code(30100): Collection call_12345_prd does not exist. Use milvus.has_collection to verify whether the collection exists. You also can check whether the collection name exists.
[2022-04-26 01:13:47,985][ERROR][SERVER][OnExecute][reqsched_thread] [insert][0] Collection call_12345_prd not found
[2022-04-26 01:13:47,985][ERROR][SERVER][TakeToExecute][reqsched_thread] Request failed with code: Error code(30100): Collection call_12345_prd does not exist. Use milvus.has_collection to verify whether the collection exists. You also can check whether the collection name exists.
[2022-04-26 01:13:47,987][ERROR][SERVER][TakeToExecute][reqsched_thread] Request failed with code: Error code(30100): Collection call_12345_prd does not exist. Use milvus.has_collection to verify whether the collection exists. You also can check whether the collection name exists.
[2022-04-26 01:13:47,990][ERROR][SERVER][TakeToExecute][reqsched_thread] Request failed with code: Error code(30100): Collection call_12345_prd does not exist. Use milvus.has_collection to verify whether the collection exists. You also can check whether the collection name exists.

进相应的节点,查看日志文件,一样挨个做检查。

 	kubectl get pods

    kubectl exec -it milvus-release-mishards-767dc476bf-fxz8v -- /bin/bash

    kubectl exec -it milvus-release-readonly-6cb6c5bcd9-9m4c5 -- /bin/bash
    kubectl exec -it milvus-release-readonly-6cb6c5bcd9-mzrh6 -- /bin/bash

    kubectl exec -it milvus-release-writable-7776777fcc-dsdmv -- /bin/bash
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值