Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#773 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 5 日以内に返信

@nandanadileep がすでに取り組んでいます。

2026年10月23日 から。

  • #775 @sarankumar1325 による — マージされずにクローズ
  • #782 @nandanadileep による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python, redis
領域
backend, database

調査の方向性

まず redisvl/exceptions.py の exists() と _MISSING_INDEX_ERROR_FRAGMENTS を読み、次にインデックスが存在しない場合と create() のテストを確認してください。issue に記載された Valkey の文言を再現し、インデックスが存在しない場合は exists() が False を返し、その他のエラーでは引き続き例外を発生させることを確認してください。その後 create() でインデックスを作成できることも確認してください。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Python
スター
432
フォーク
111
平均マージ
5日 17時間
マージ済み PR(30日)
16

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

redis/redis-vl-python のほかの issue

redis/redis-vl-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。