{"record":{"id":"330d0454c1417709","repo":"AlistGo/alist","slug":"failed-to-marshal-move-request-w","errorCode":null,"errorMessage":"failed to marshal move request: %w","messagePattern":"failed to marshal move request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"drivers/proton_drive/util.go","lineNumber":698,"sourceCode":"\t//fmt.Printf(\"DEBUG Move Request - ContentHash: %v\\n\", req.ContentHash)\n\t//fmt.Printf(\"DEBUG Move Request - NodePassphrase length: %d\\n\", len(req.NodePassphrase))\n\t//fmt.Printf(\"DEBUG Move Request - NodePassphraseSignature length: %d\\n\", len(req.NodePassphraseSignature))\n\n\t//fmt.Printf(\"DEBUG Move Request - SrcLinkID: %s\\n\", linkID)\n\t//fmt.Printf(\"DEBUG Move Request - DstParentLinkID: %s\\n\", req.ParentLinkID)\n\t//fmt.Printf(\"DEBUG Move Request - ShareID: %s\\n\", d.MainShare.ShareID)\n\n\tsrcLink, _ := d.getLink(ctx, linkID)\n\tif srcLink != nil && srcLink.ParentLinkID == req.ParentLinkID {\n\t\treturn fmt.Errorf(\"cannot move to same parent directory\")\n\t}\n\n\tmoveURL := fmt.Sprintf(d.apiBase+\"/drive/v2/volumes/%s/links/%s/move\",\n\t\td.MainShare.VolumeID, linkID)\n\n\treqBody, err := json.Marshal(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to marshal move request: %w\", err)\n\t}\n\n\thttpReq, err := http.NewRequestWithContext(ctx, \"PUT\", moveURL, bytes.NewReader(reqBody))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create HTTP request: %w\", err)\n\t}\n\n\thttpReq.Header.Set(\"Authorization\", \"Bearer \"+d.credentials.AccessToken)\n\thttpReq.Header.Set(\"Accept\", d.protonJson)\n\thttpReq.Header.Set(\"X-Pm-Appversion\", d.webDriveAV)\n\thttpReq.Header.Set(\"X-Pm-Drive-Sdk-Version\", d.sdkVersion)\n\thttpReq.Header.Set(\"X-Pm-Uid\", d.credentials.UID)\n\thttpReq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(httpReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to execute move request: %w\", err)","sourceCodeStart":680,"sourceCodeEnd":716,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/proton_drive/util.go#L680-L716","documentation":"Returned when json.Marshal of MoveRequest fails. MoveRequest consists of strings, a nil-able ContentHash, and passphrase strings — all JSON-safe — so this branch is effectively unreachable with the current type definition.","triggerScenarios":"Only if MoveRequest gains a channel/func/cyclic field in a fork; nothing in the shipped type can trigger it.","commonSituations":"Essentially none; treat any occurrence as a sign the error is actually a wrapped child from elsewhere or a modified struct.","solutions":["Verify the error's %w chain actually points at this Marshal call","Keep MoveRequest limited to JSON-encodable scalar fields, or add custom MarshalJSON"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"marshal move request\") {\n    log.Error(\"MoveRequest schema defect — not a runtime condition\")\n}","preventionTips":["Keep MoveRequest to JSON-encodable fields","Treat occurrence as code smell, never retry"],"tags":["proton-drive","json","unreachable"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}