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

  1. Set a valid search driver (e.g. database or bleve) in the site settings and restart/reinitialize.
  2. If a build is in progress, wait and retry — check for errs.BuildIndexIsRunning separately.
  3. Verify the search-related settings persisted correctly (no empty driver string).
  4. 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

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


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/c4e396f36dc97a11. Report an issue: GitHub.