AlistGo/alist · error

list failed: %s

Error message

list failed: %s

What it means

Returned by BitQiu.List (drivers/bitqiu/driver.go:137): the paginated list API returned a code other than success ('10200'), and the server message is wrapped as 'list failed: %s'. Codes '10401' and '10404' are handled inline by re-logging-in and retrying the page; this error means a different, non-auth failure code got through.

Source

Thrown at drivers/bitqiu/driver.go:137

			"desc":        desc,
			"model":       "1",
			"userId":      d.userID,
			"currentPage": strconv.Itoa(page),
			"page":        strconv.Itoa(page),
			"org_channel": orgChannel,
		}
		var resp Response[ResourcePage]
		if err := d.postForm(ctx, listURL, form, &resp); err != nil {
			return nil, err
		}
		if resp.Code != successCode {
			if resp.Code == "10401" || resp.Code == "10404" {
				if err := d.login(ctx); err != nil {
					return nil, err
				}
				continue
			}
			return nil, fmt.Errorf("list failed: %s", resp.Message)
		}

		objs, err := utils.SliceConvert(resp.Data.Data, func(item Resource) (model.Obj, error) {
			return item.toObject(parentID, dirPath)
		})
		if err != nil {
			return nil, err
		}
		results = append(results, objs...)

		if !resp.Data.HasNext || len(resp.Data.Data) == 0 {
			break
		}
		page++
	}

	return results, nil
}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Read resp.Message in the error text — it is the server's own description and pinpoints the code
  2. Verify the credentials (username/password) by re-initializing the storage
  3. Confirm the directory still exists by listing its parent
  4. Map recurring codes to explicit handling next to the existing 10401/10404 branch

Example fix

// before
return nil, fmt.Errorf("list failed: %s", resp.Message)

// after (surface the code for diagnosability, keep auth-retry behavior)
return nil, fmt.Errorf("list failed: code=%s msg=%s", resp.Code, resp.Message)
Defensive patterns

Strategy: try-catch

Type guard

func isBitQiuAuthCode(code string) bool {
    return code == "10401" || code == "10404"
}

Try / catch

objs, err := d.List(ctx, dir, args)
if err != nil {
    if strings.HasPrefix(err.Error(), "list failed:") {
        // resp.Message is embedded; distinguish auth (auto-handled) from business errors
        return nil, fmt.Errorf("bitqiu list failed for %s: %w", dir.GetPath(), err)
    }
    return nil, err
}

Prevention

When it happens

Trigger: Listing with an invalid/explicitly wrong parent resource id; account out of quota or banned; server-side message like permission denied or malformed request; any business error code beyond 10401/10404 on the list endpoint.

Common situations: Stored session went stale in a way re-login does not fix; the listed folder was deleted server-side; API changes introducing new business codes.

Related errors


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