AlistGo/alist · warning · SearchNotAvailable
SearchNotAvailable
SearchNotAvailable
Error message
search not available
What it means
A sentinel error from the internal/errs package meaning the search feature is not usable in the current state — typically because no search driver/index backend is configured or available. It is compared by identity (errs.SearchNotAvailable), not by string matching. Sibling sentinel BuildIndexIsRunning indicates the index is mid-rebuild and the caller should retry later.
Source
Thrown at internal/errs/search.go:6
package errs
import "fmt"
var (
SearchNotAvailable = fmt.Errorf("search not available")
BuildIndexIsRunning = fmt.Errorf("build index is running, please try later")
)
View on GitHub (pinned to 843d9dc814)
Solutions
- Set a valid search driver (e.g. database or bleve) in the site settings and restart/reinitialize.
- If a build is in progress, wait and retry — check for errs.BuildIndexIsRunning separately.
- Verify the search-related settings persisted correctly (no empty driver string).
- In the UI/layer above, surface this as 'search disabled' rather than a generic 500.
Defensive patterns
Strategy: type-guard
Type guard
if err == errs.SearchNotAvailable { /* show 'search disabled' UI */ }
if err == errs.BuildIndexIsRunning { /* retry later */ } Try / catch
results, err := search.Search(ctx, req)
if err != nil {
switch err {
case errs.SearchNotAvailable:
return fmt.Errorf("search is disabled: %w", err)
case errs.BuildIndexIsRunning:
time.Sleep(retryDelay)
// retry once
}
} Prevention
- Check whether a search driver is configured before exposing search UI.
- Distinguish the two sentinels (not available vs. building) with identity comparison, never string matching.
- After changing search settings, trigger an index build and wait for it to finish before serving queries.
When it happens
Trigger: Invoking a search API/handler while the configured search driver is nil, disabled, or failed to initialize; calling search before the index has ever been built.
Common situations: Fresh install with no search driver selected in settings; search driver set to 'none' or left empty; database-based search where the index table/driver was never initialized; disabling the search feature and then hitting a search route.
Related errors
- index is running
- not support index: %s
- ocr error:" + jsoniter.Get(vRes.Body(), "msg").ToString()
- resp.String()
- authn not support
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/c4e396f36dc97a11.
Report an issue: GitHub.