{"record":{"id":"9388ef25fb054f65","repo":"AlistGo/alist","slug":"index-creation-failed-task-status-is-s","errorCode":null,"errorMessage":"index creation failed, task status is %s","messagePattern":"index creation failed, task status is (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/search/meilisearch/init.go","lineNumber":47,"sourceCode":"\n\t\t_, err := m.Client.GetIndex(m.IndexUid)\n\t\tif err != nil {\n\t\t\tvar mErr *meilisearch.Error\n\t\t\tok := errors.As(err, &mErr)\n\t\t\tif ok && mErr.MeilisearchApiError.Code == \"index_not_found\" {\n\t\t\t\ttask, err := m.Client.CreateIndex(&meilisearch.IndexConfig{\n\t\t\t\t\tUid:        m.IndexUid,\n\t\t\t\t\tPrimaryKey: \"id\",\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tforTask, err := m.Client.WaitForTask(task.TaskUID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif forTask.Status != meilisearch.TaskStatusSucceeded {\n\t\t\t\t\treturn nil, fmt.Errorf(\"index creation failed, task status is %s\", forTask.Status)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tattributes, err := m.Client.Index(m.IndexUid).GetFilterableAttributes()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif attributes == nil || !utils.SliceAllContains(*attributes, m.FilterableAttributes...) {\n\t\t\t_, err = m.Client.Index(m.IndexUid).UpdateFilterableAttributes(&m.FilterableAttributes)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\tattributes, err = m.Client.Index(m.IndexUid).GetSearchableAttributes()\n\t\tif err != nil {","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/internal/search/meilisearch/init.go#L29-L65","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the task in Meilisearch (GET /tasks) and read its error payload for the root cause","Delete the conflicting index (DELETE /indexes/<uid>) and let AList recreate it","Free resources on the Meilisearch host or increase limits","Verify the API key has index-creation rights and the configured host/port are correct"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := search.Init(\"meilisearch\"); err != nil {\n    if strings.Contains(err.Error(), \"index creation failed\") {\n        // query Meilisearch /tasks for the failed task, fix root cause (conflicting uid, disk, key), optionally delete index and retry once\n    }\n    return err\n}","preventionTips":["Dedicate an index UID per AList instance on shared Meilisearch clusters","Provision adequate disk/memory for index builds","Use an API key with full index permissions","Check Meilisearch /tasks dashboard after first startup"],"tags":["go","meilisearch","search","index","initialization"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}