AlistGo/alist · error

{string(res)}

Error message

{string(res)}

What it means

Returned after a batch operation (the get download URLs / batch task call in aliyundrive/util.go) where the per-item result inside responses[0].status is an HTTP error code (>=400 or <100). The raw response body is returned verbatim as the error, so the message is whatever JSON the server embedded for the failed batch item.

Source

Thrown at drivers/aliyundrive/util.go:203

						"drive_id":          d.DriveId,
						"file_id":           srcId,
						"to_drive_id":       d.DriveId,
						"to_parent_file_id": dstId,
					},
					"url": url,
				},
			},
			"resource": "file",
		})
	}, nil)
	if err != nil {
		return err
	}
	status := utils.Json.Get(res, "responses", 0, "status").ToInt()
	if status < 400 && status >= 100 {
		return nil
	}
	return errors.New(string(res))
}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Parse the nested responses[0] object (code/content) to get the real per-item error instead of relying on the raw dump
  2. Refresh the file list (the target file may be gone) and retry the single item
  3. Add per-item backoff when many links are requested in one batch to avoid 429 item statuses
  4. If a livp/photo edge case, ensure the request targets the correct domain endpoint for that file type

Example fix

// before
return errors.New(string(res))

// after — extract the per-item message
msg := utils.Json.Get(res, "responses", 0, "content", "message").ToString()
if msg == "" {
    msg = string(res)
}
return errors.New(msg)
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

// Go
func isBatchItemFailure(err error) bool {
    return err != nil && strings.Contains(err.Error(), "\"responses\"")
}

Try / catch

_, err := d.request(...)
if isBatchItemFailure(err) {
    // re-fetch listing; per-item 404 usually means the file vanished
    // fall back to a single-item, non-batch request for the survivors
}

Prevention

When it happens

Trigger: The batch API call itself returned 2xx, but the first item's status field (e.g. 404, 429, 403) indicates that item failed — common for expired download URLs on deleted files, rate-limited items, or permission-revoked shares inside an otherwise successful batch response.

Common situations: Listing then immediately linking files that were deleted or moved server-side between calls; batch-linking many files quickly and hitting per-item throttling; tokens lacking scope for specific files. Because the whole body is dumped, the error string is a large JSON blob in logs.

Related errors


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