AlistGo/alist · error

index creation failed, task status is

Error message

index creation failed, task status is %s

What it means

When bootstrapping the Meilisearch search index, CreateIndex was accepted by the server but the resulting task finished with a status other than succeeded (e.g. failed or canceled). The Meilisearch client's WaitForTask returned without transport error, so only the task status is checked.

Solutions

  1. Check the task in Meilisearch (GET /tasks) and read its error payload for the root cause
  2. Delete the conflicting index (DELETE /indexes/<uid>) and let AList recreate it
  3. Free resources on the Meilisearch host or increase limits
  4. Verify the API key has index-creation rights and the configured host/port are correct
Defensive patterns

Strategy: try-catch

Try / catch

if err := search.Init("meilisearch"); err != nil {
    if strings.Contains(err.Error(), "index creation failed") {
        // query Meilisearch /tasks for the failed task, fix root cause (conflicting uid, disk, key), optionally delete index and retry once
    }
    return err
}

Prevention

When it happens

Trigger: Starting AList with search mode 'meilisearch' while an index with the same UID but incompatible settings already exists, the Meilisearch server runs out of disk, or the master key/permissions allow task submission but not index creation.

Common situations: Reusing a Meilisearch instance across AList versions or projects with colliding index UIDs; Meilisearch under-provisioned (disk/RAM) so index building tasks fail; wrong API key scope.

Related errors


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

Appendix: source

Thrown at internal/search/meilisearch/init.go:47

		_, err := m.Client.GetIndex(m.IndexUid)
		if err != nil {
			var mErr *meilisearch.Error
			ok := errors.As(err, &mErr)
			if ok && mErr.MeilisearchApiError.Code == "index_not_found" {
				task, err := m.Client.CreateIndex(&meilisearch.IndexConfig{
					Uid:        m.IndexUid,
					PrimaryKey: "id",
				})
				if err != nil {
					return nil, err
				}
				forTask, err := m.Client.WaitForTask(task.TaskUID)
				if err != nil {
					return nil, err
				}
				if forTask.Status != meilisearch.TaskStatusSucceeded {
					return nil, fmt.Errorf("index creation failed, task status is %s", forTask.Status)
				}
			} else {
				return nil, err
			}
		}
		attributes, err := m.Client.Index(m.IndexUid).GetFilterableAttributes()
		if err != nil {
			return nil, err
		}
		if attributes == nil || !utils.SliceAllContains(*attributes, m.FilterableAttributes...) {
			_, err = m.Client.Index(m.IndexUid).UpdateFilterableAttributes(&m.FilterableAttributes)
			if err != nil {
				return nil, err
			}
		}

		attributes, err = m.Client.Index(m.IndexUid).GetSearchableAttributes()
		if err != nil {

View on GitHub (pinned to 843d9dc814)