{"record":{"id":"e79ac93a974de071","repo":"AlistGo/alist","slug":"failed-move-for-v-and-failed-try-copying-for","errorCode":null,"errorMessage":"failed move for %+v, and failed try copying for %+v","messagePattern":"failed move for %\\+v, and failed try copying for %\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/ftp/fsmanage.go","lineNumber":76,"sourceCode":"\t}\n\tsrcDir, srcBase := stdpath.Split(srcPath)\n\tdstDir, dstBase := stdpath.Split(dstPath)\n\tpermSrc := common.MergeRolePermissions(user, srcPath)\n\tif srcDir == dstDir {\n\t\tif !common.HasPermission(permSrc, common.PermRename) || !common.HasPermission(permSrc, common.PermFTPManage) {\n\t\t\treturn errs.PermissionDenied\n\t\t}\n\t\treturn fs.Rename(ctx, srcPath, dstBase)\n\t} else {\n\t\tif !common.HasPermission(permSrc, common.PermFTPManage) || !common.HasPermission(permSrc, common.PermMove) || (srcBase != dstBase && !common.HasPermission(permSrc, common.PermRename)) {\n\t\t\treturn errs.PermissionDenied\n\t\t}\n\t\tif err = fs.Move(ctx, srcPath, dstDir); err != nil {\n\t\t\tif srcBase != dstBase {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, err1 := fs.Copy(ctx, srcPath, dstDir); err1 != nil {\n\t\t\t\treturn fmt.Errorf(\"failed move for %+v, and failed try copying for %+v\", err, err1)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\tif srcBase != dstBase {\n\t\t\treturn fs.Rename(ctx, stdpath.Join(dstDir, srcBase), dstBase)\n\t\t}\n\t\treturn nil\n\t}\n}\n","sourceCodeStart":58,"sourceCodeEnd":86,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/server/ftp/fsmanage.go#L58-L86","documentation":"FTP fsmanage rename/move handler: fs.Move failed (typically EXDEV — cross-storage or cross-filesystem move), and the fallback fs.Copy within the same base also failed. Both errors are reported together: the move error and the copy error.","triggerScenarios":"FTP RNFR/RNTO moving an entry where the source and destination live on different mounts/drivers so Move is unsupported, and Copy then fails on permissions, size limits, or the same underlying driver error.","commonSituations":"Moving files between two different storages mounted in AList via FTP; destination storage out of space or read-only; network storage driver failing copy of large files.","solutions":["Read both errors: the first (%+v err) says why Move failed, the second why Copy failed — fix the Copy cause","Check destination storage is writable and has space","For cross-storage moves, ensure the destination driver supports upload (Copy needs it)","Retry after fixing driver connectivity/credentials for the involved storages"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if srcBase != dstBase && !sameDriverSupportsMove(srcStorage, dstStorage) {\n    // plan an explicit copy+delete instead of relying on server-side fallback\n}","typeGuard":null,"tryCatchPattern":"if err := fs.Move(ctx, src, dst); err != nil {\n    if _, copyErr := fs.Copy(ctx, src, dst); copyErr != nil {\n        // both failed: report both errors, check writability/space on destination, retry after fixing\n        return fmt.Errorf(\"move: %v; copy: %w\", err, copyErr)\n    }\n    _ = fs.Remove(ctx, src)\n}","preventionTips":["Confirm destination storage is writable and has capacity before FTP moves","For cross-storage moves, prefer clients that issue copy then delete","Watch storage health so driver-level failures are caught early"],"tags":["go","ftp","move","copy","cross-storage"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}