AlistGo/alist · warning

index is running

Error message

index is running

What it means

search.Init(mode) refuses to (re)initialize the search backend while an indexing/build operation is in progress (search.Running() is true). This prevents swapping the searcher instance under a running index job.

Source

Thrown at internal/search/search.go:31

)

var instance searcher.Searcher = nil

// Init or reset index
func Init(mode string) error {
	if instance != nil {
		// unchanged, do nothing
		if instance.Config().Name == mode {
			return nil
		}
		err := instance.Release(context.Background())
		if err != nil {
			log.Errorf("release instance err: %+v", err)
		}
		instance = nil
	}
	if Running() {
		return fmt.Errorf("index is running")
	}
	if mode == "none" {
		log.Warnf("not enable search")
		return nil
	}
	s, ok := searcher.NewMap[mode]
	if !ok {
		return fmt.Errorf("not support index: %s", mode)
	}
	i, err := s()
	if err != nil {
		log.Errorf("init searcher error: %+v", err)
	} else {
		instance = i
	}
	return err
}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Wait for the current indexing run to finish, then re-apply the settings change
  2. Check logs/job status for a hung index job and stop it cleanly
  3. Restart the AList process if the running flag is stuck after a crash
  4. Set search config before triggering large index builds to avoid the race
Defensive patterns

Strategy: retry

Validate before calling

if search.Running() {
    // defer config change until the current index build completes
    return errors.New("defer: index build in progress")
}

Try / catch

err := search.Init(newMode)
if err != nil && strings.Contains(err.Error(), "index is running") {
    // schedule retry after the build finishes instead of failing the settings update
}

Prevention

When it happens

Trigger: Calling search.Init (e.g. via the admin API/setting change of the search config) while a bulk index build (BuildIndex over storages) is still running, or a previous index run never terminated.

Common situations: Admin changes the search driver in settings during a large initial index build; a stuck index job leaves Running() true indefinitely.

Related errors


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