{"record":{"id":"f9119abb5137248a","repo":"AlistGo/alist","slug":"failed-to-find-destination-w","errorCode":null,"errorMessage":"failed to find destination: %w","messagePattern":"failed to find destination: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/proton_drive/util.go","lineNumber":746,"sourceCode":"\n\treturn nil\n}\n\nfunc (d *ProtonDrive) DirectMove(ctx context.Context, srcObj model.Obj, dstDir model.Obj) (model.Obj, error) {\n\t//fmt.Printf(\"DEBUG DirectMove: srcPath=%s, dstPath=%s\", srcObj.GetPath(), dstDir.GetPath())\n\n\tsrcLink, err := d.searchByPath(ctx, srcObj.GetPath(), srcObj.IsDir())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to find source: %w\", err)\n\t}\n\n\tvar dstParentLinkID string\n\tif dstDir.GetPath() == \"/\" {\n\t\tdstParentLinkID = d.RootLink.LinkID\n\t} else {\n\t\tdstLink, err := d.searchByPath(ctx, dstDir.GetPath(), true)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to find destination: %w\", err)\n\t\t}\n\t\tdstParentLinkID = dstLink.LinkID\n\t}\n\n\tif srcObj.IsDir() {\n\n\t\t// Check if destination is a descendant of source\n\t\tif err := d.checkCircularMove(ctx, srcLink.LinkID, dstParentLinkID); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// Encrypt the filename for the new location\n\tencryptedName, err := d.encryptFileName(ctx, srcObj.GetName(), dstParentLinkID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to encrypt filename: %w\", err)\n\t}\n","sourceCodeStart":728,"sourceCodeEnd":764,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/proton_drive/util.go#L728-L764","documentation":"DirectMove failed to resolve the destination directory's path to a link. The '/' shortcut maps to d.RootLink, so this fires only for non-root destinations whose path cannot be walked (missing folder, deleted, or not actually a folder — searchByPath is called with isFolder=true).","triggerScenarios":"Destination folder deleted between selection and move; destination path belonging to a file; destination inside a share the mount cannot decrypt; wrong path casing or separators.","commonSituations":"Drag-drop into a folder that vanished after a sync; stale directory listings in the client; moving into shared folders with undecryptable keys for this account.","solutions":["Re-list the destination directory before the move to confirm it exists and is a folder","Surface a 'destination not found' error and let the UI refresh the tree","Verify the destination is not itself the file being moved"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"dstObj, err := d.get(ctx, dstDir.GetPath())\nif err != nil { return fmt.Errorf(\"destination missing: %w\", err) }\nif !dstObj.IsDir() { return fmt.Errorf(\"destination is not a folder\") }","typeGuard":null,"tryCatchPattern":"if err := d.DirectMove(ctx, src, dst); err != nil {\n    if strings.Contains(err.Error(), \"failed to find destination\") {\n        refreshTree(dstDir.GetPath()); // user re-selects folder\n    }\n}","preventionTips":["Refresh the destination folder listing right before the move","Block UI drop targets that no longer exist in the latest listing"],"tags":["proton-drive","move","path","validation"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}