Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

exists() depends on exact FT.INFO error wording; an unrecognised "missing index" message makes create() never create the index (regression from #672)

Đang mở Phù hợp với người mới
#773 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, redis
Lĩnh vực
backend, database

Hướng nghiên cứu

Bắt đầu bằng cách đọc exists() và _MISSING_INDEX_ERROR_FRAGMENTS trong redisvl/exceptions.py, sau đó kiểm tra các bài kiểm thử cho trường hợp thiếu index và create(). Tái hiện cách diễn đạt của Valkey được mô tả trong issue và xác minh rằng exists() trả về False khi thiếu index nhưng vẫn phát sinh ngoại lệ với các lỗi khác; xác nhận rằng create() sau đó có thể tạo index.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

Since #672 (released in 0.25.1), exists() decides whether an index is missing by matching the FT.INFO error text against _MISSING_INDEX_ERROR_FRAGMENTS. If a server words that error differently, exists() raises RedisSearchError instead of returning False, and because create() calls exists() first, the index is never created. Before #672, FT._LIST made the check independent of wording.

One server where this happens today is Valkey Search (tested on Amazon ElastiCache for Valkey 9.1.0), which replies Index with name '…' not found in database 0.

Cause

exists() treats an FT.INFO error as "missing index" only if it matches one of these, in redisvl/exceptions.py:

_MISSING_INDEX_ERROR_FRAGMENTS = (
    "unknown index name",
    "no such index",
    "search_index_not_found",
    "index not found",
)

Valkey Search words the error differently, so none of the fragments match and exists() re-raises:

FT.INFO no-such-index
(error) Index with name 'no-such-index' not found in database 0

("index not found" does not match because the index name sits between "index" and "not found".)

Before #672, exists() used FT._LIST, which works on Valkey, so this is a regression for Valkey users.

Reproduction

import asyncio
import redis.asyncio as redis
from redisvl.index import AsyncSearchIndex

async def main():
    client = redis.Redis(host="<valkey-host>", port=6379)  # Valkey + Valkey Search
    idx = AsyncSearchIndex.from_dict(
        {"index": {"name": "redisvl_repro_missing", "prefix": "redisvl_repro_missing"},
         "fields": [{"name": "tag", "type": "tag"}]},
        redis_client=client,
    )
    print(await idx.exists())

asyncio.run(main())

Actual:

redisvl.exceptions.RedisSearchError: Error while fetching redisvl_repro_missing index info: Index with name 'redisvl_repro_missing' not found in database 0

Expected: False, and create() then creates the index.

Impact

langgraph-checkpoint-redis's AsyncShallowRedisSaver.asetup() calls index.create(overwrite=False), so on a new Valkey database the checkpoint and checkpoint_write indexes are never created. Anything that queries those indexes (for example adelete_thread) then fails. Databases created before 0.25.1 are unaffected, because their indexes already exist.

Suggested fix

Either add that wording (for example "not found in database") to _MISSING_INDEX_ERROR_FRAGMENTS, or, independent of wording: when FT.INFO fails with an unrecognised ResponseError, fall back to checking FT._LIST (where the ACL allows it) before raising. That keeps #672's least-privilege benefit and stops create() from failing silently on unfamiliar error text.

Environment

  • redisvl 0.28.0 (the fragment list on main is unchanged)
  • redis-py 8.1.0, RESP2
  • langgraph-checkpoint-redis 0.5.2
  • Amazon ElastiCache for Valkey 9.1.0 (Valkey Search), non-cluster mode
  • Python 3.14
Ngôn ngữ chính
Python
Star
431
Fork
107
Merge trung bình
5 ngày 17 giờ
Pull request đã merge (30 ngày)
16

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của redis/redis-vl-python

Tất cả issue của redis/redis-vl-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.