{"record":{"id":"e3ffd2e0c44b686a","repo":"AlistGo/alist","slug":"failed-to-execute-move-request-w","errorCode":null,"errorMessage":"failed to execute move request: %w","messagePattern":"failed to execute move request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/proton_drive/util.go","lineNumber":716,"sourceCode":"\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)\n\t}\n\tdefer resp.Body.Close()\n\n\tvar moveResp RenameResponse\n\tif err := json.NewDecoder(resp.Body).Decode(&moveResp); err != nil {\n\t\treturn fmt.Errorf(\"failed to decode move response: %w\", err)\n\t}\n\n\tif moveResp.Code != 1000 {\n\t\treturn fmt.Errorf(\"move operation failed with code: %d\", moveResp.Code)\n\t}\n\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","sourceCodeStart":698,"sourceCodeEnd":734,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/proton_drive/util.go#L698-L734","documentation":"The raw http.Client (again with no Timeout) failed transport-level on the move PUT: DNS, TCP, TLS, proxy, or context cancellation. Distinct from an API rejection — no HTTP response was obtained.","triggerScenarios":"Offline or firewalled host; proxy env vars routing to a dead proxy; TLS interception rejecting Proton's cert; ctx cancelled mid-request (user abort, shutdown).","commonSituations":"Laptop sleep/resume breaking long-lived connections; container images without CA bundles; moves cancelled by UI navigation; transient ISP resets.","solutions":["Retry once with backoff for transient resets; classify context.Canceled separately","Verify egress to the Proton API host and proxy settings","Set an explicit client Timeout so hangs become errors","Use the shared authenticated client from the proton-go SDK instead of ad-hoc clients"],"exampleFix":"// before\nclient := &http.Client{}\n// after\nclient := &http.Client{Timeout: 120 * time.Second}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var netErr net.Error\nif errors.As(err, &netErr) {\n    // transport failure on move PUT: backoff and retry\n} else if errors.Is(err, context.Canceled) {\n    // aborted by caller — propagate as cancellation\n}","preventionTips":["Give the move client a Timeout; large latency budgets for big trees","Retry moves idempotently — Proton moves are atomic per link"],"tags":["proton-drive","network","http","timeout"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}