{"record":{"id":"02bb6b16b0d1f00a","repo":"AlistGo/alist","slug":"move-file-failed-w","errorCode":null,"errorMessage":"move file failed: %w","messagePattern":"move file failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/darkibox/driver.go","lineNumber":194,"sourceCode":"\tif srcObj.IsDir() {\n\t\treturn nil, errs.NotImplement\n\t}\n\n\tfileCode := fileCodeFromObjID(srcObj.GetID())\n\tif fileCode == \"\" {\n\t\treturn nil, fmt.Errorf(\"empty file code\")\n\t}\n\n\tdstFolderID := d.RootFolderID\n\tif dstDir.GetID() != \"\" {\n\t\tdstFolderID = folderIDFromObjID(dstDir.GetID())\n\t}\n\n\tif err := d.callAPI(ctx, \"/file/move\", map[string]string{\n\t\t\"file_code\": fileCode,\n\t\t\"to_folder\": fldIDStr(dstFolderID),\n\t}, nil); err != nil {\n\t\treturn nil, fmt.Errorf(\"move file failed: %w\", err)\n\t}\n\n\treturn &model.Object{\n\t\tID:       srcObj.GetID(),\n\t\tName:     srcObj.GetName(),\n\t\tSize:     srcObj.GetSize(),\n\t\tModified: srcObj.ModTime(),\n\t\tIsFolder: false,\n\t}, nil\n}\n\nfunc (d *Darkibox) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error) {\n\treturn nil, errs.NotImplement\n}\n\nfunc (d *Darkibox) Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error) {\n\treturn nil, errs.NotImplement\n}","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/darkibox/driver.go#L176-L212","documentation":"The Darkibox driver's Move failed at the remote /file/move API call. The %w wraps the callAPI error, which can be an HTTP status error, a provider status/msg error, or a decode failure. The file was not moved.","triggerScenarios":"POST /file/move with a valid file_code but: destination folder ID doesn't exist, API key lacks permission for the target folder, provider-side rate limit, or network failure to apiBase.","commonSituations":"Moving to a folder deleted since the listing was made; wrong API key scope; provider outage; destination resolved to root while the key cannot write to root.","solutions":["Check the wrapped error text — 'darkibox api error: status=... msg=...' gives the provider's reason; address auth/permission/quota accordingly","Refresh the destination listing to confirm dstDir's encoded folder ID still exists, then retry","Test a move to the root folder to isolate destination-specific permission problems"],"exampleFix":"// before\nif err := d.callAPI(ctx, \"/file/move\", params, nil); err != nil {\n\treturn nil, fmt.Errorf(\"move file failed: %w\", err)\n}\n// after — include file code and destination in the message\nif err := d.callAPI(ctx, \"/file/move\", params, nil); err != nil {\n\treturn nil, fmt.Errorf(\"move file %s to folder %s failed: %w\", fileCode, dstFolderID, err)\n}","handlingStrategy":"retry","validationCode":"if dstDir.GetID() != \"\" {\n\tif _, err := d.Get(ctx, dstDir); err != nil {\n\t\treturn nil, fmt.Errorf(\"destination not reachable: %w\", err)\n\t}\n}","typeGuard":"func isMovableFile(obj model.Obj) bool {\n\treturn !obj.IsDir() && fileCodeFromObjID(obj.GetID()) != \"\"\n}","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"move file failed\") {\n\tif isTransientAPIError(err) { // 5xx/429 in chain\n\t\tbackoffAndRetry()\n\t}\n}","preventionTips":["Confirm destination exists via a List before moving","Handle provider rate-limit msgs by serializing moves","Refresh listings after remote-side changes"],"tags":["darkibox","move","api-error","storage-driver"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}