AlistGo/alist · error

error:%v

Error message

error:%v

What it means

Returned by ChaoXing Put when /pc/resource/addResource (registering the uploaded file in the drive) answers with respd.Result != 1. Note a source bug: the message formats resp.Msg (the earlier UploadDataRsp whose Msg is a struct), not respd.Msg, so the reported text is unhelpful like 'error:{%!v(PANIC=...) }' or a struct dump.

Source

Thrown at drivers/chaoxing/driver.go:301

	if err != nil {
		return err
	}
	query := map[string]string{
		"bbsid":  d.Addition.Bbsid,
		"pid":    dstDir.GetID(),
		"type":   "yunpan",
		"params": url.QueryEscape("[" + string(params) + "]"),
	}
	var respd ListFileResp
	_, err = d.request("/pc/resource/addResource", http.MethodGet, func(req *resty.Request) {
		req.SetQueryParams(query)
	}, &respd)
	if err != nil {
		return err
	}
	if respd.Result != 1 {
		msg := fmt.Sprintf("error:%v", resp.Msg)
		return errors.New(msg)
	}
	return nil
}

var _ driver.Driver = (*ChaoXing)(nil)

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Fix the variable locally or patch upstream: use respd.Msg instead of resp.Msg in the error format string, then rebuild
  2. Re-list the destination to confirm the file truly did not register; retry the upload
  3. Verify bbsid and destination pid are valid before uploading
  4. Update alist once the upstream fix lands; check issue tracker for chaoxing upload fixes

Example fix

// before (drivers/chaoxing/driver.go:300)
msg := fmt.Sprintf("error:%v", resp.Msg)
// after
msg := fmt.Sprintf("error:%v", respd.Msg)
Defensive patterns

Strategy: try-catch

Validate before calling

null

Try / catch

if err := d.Put(ctx, dst, f, up); err != nil && strings.Contains(err.Error(), "error:") {
    // message is garbled due to driver bug (resp vs respd); re-list dst to verify,
    // retry once, and patch driver to use respd.Msg for real diagnostics
}

Prevention

When it happens

Trigger: Finalizing an upload where addResource rejects the params — invalid bbsid, wrong pid, malformed params JSON, or expired session — while the driver's error text reads from the wrong variable (resp instead of respd at drivers/chaoxing/driver.go:300).

Common situations: Uploads that succeed byte-wise but never appear in the listing; any addResource business failure surfaces a garbled message, masking the real server reason.

Related errors


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