AlistGo/alist · error

failed to execute move request: %w

Error message

failed to execute move request: %w

What it means

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.

Source

Thrown at drivers/proton_drive/util.go:716

		return fmt.Errorf("failed to marshal move request: %w", err)
	}

	httpReq, err := http.NewRequestWithContext(ctx, "PUT", moveURL, bytes.NewReader(reqBody))
	if err != nil {
		return fmt.Errorf("failed to create HTTP request: %w", err)
	}

	httpReq.Header.Set("Authorization", "Bearer "+d.credentials.AccessToken)
	httpReq.Header.Set("Accept", d.protonJson)
	httpReq.Header.Set("X-Pm-Appversion", d.webDriveAV)
	httpReq.Header.Set("X-Pm-Drive-Sdk-Version", d.sdkVersion)
	httpReq.Header.Set("X-Pm-Uid", d.credentials.UID)
	httpReq.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	resp, err := client.Do(httpReq)
	if err != nil {
		return fmt.Errorf("failed to execute move request: %w", err)
	}
	defer resp.Body.Close()

	var moveResp RenameResponse
	if err := json.NewDecoder(resp.Body).Decode(&moveResp); err != nil {
		return fmt.Errorf("failed to decode move response: %w", err)
	}

	if moveResp.Code != 1000 {
		return fmt.Errorf("move operation failed with code: %d", moveResp.Code)
	}

	return nil
}

func (d *ProtonDrive) DirectMove(ctx context.Context, srcObj model.Obj, dstDir model.Obj) (model.Obj, error) {
	//fmt.Printf("DEBUG DirectMove: srcPath=%s, dstPath=%s", srcObj.GetPath(), dstDir.GetPath())

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry once with backoff for transient resets; classify context.Canceled separately
  2. Verify egress to the Proton API host and proxy settings
  3. Set an explicit client Timeout so hangs become errors
  4. Use the shared authenticated client from the proton-go SDK instead of ad-hoc clients

Example fix

// before
client := &http.Client{}
// after
client := &http.Client{Timeout: 120 * time.Second}
Defensive patterns

Strategy: retry

Try / catch

var netErr net.Error
if errors.As(err, &netErr) {
    // transport failure on move PUT: backoff and retry
} else if errors.Is(err, context.Canceled) {
    // aborted by caller — propagate as cancellation
}

Prevention

When it happens

Trigger: 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).

Common situations: Laptop sleep/resume breaking long-lived connections; container images without CA bundles; moves cancelled by UI navigation; transient ISP resets.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/e3ffd2e0c44b686a. Report an issue: GitHub.