jackwener/OpenCLI · error · CommandExecutionError

TikTok Studio item_list failed: ${statusMsg}

Error message

TikTok Studio item_list failed: ${statusMsg}

What it means

Final guard in assertApiSuccess: status_code is zero/absent but status_msg is a non-success, non-auth string, so the library throws CommandExecutionError with the raw message. It ensures any unexpected TikTok status message is surfaced instead of being treated as success.

Source

Thrown at clis/tiktok/creator-videos.js:128

        throw new CommandExecutionError('TikTok Studio item_list returned an empty response');
    }
    return data.data && typeof data.data === 'object' ? data.data : data;
}

function assertApiSuccess(data) {
    const statusCode = data.status_code ?? data.statusCode;
    const statusMsg = String(data.status_msg ?? data.statusMsg ?? '').trim();
    if (statusCode !== undefined && Number(statusCode) !== 0) {
        if (looksAuthFailure(statusMsg)) {
            throw new AuthRequiredError('www.tiktok.com', `TikTok Studio item_list requires login: ${statusMsg || statusCode}`);
        }
        throw new CommandExecutionError(`TikTok Studio item_list failed: ${statusMsg || statusCode}`);
    }
    if (statusMsg && !/^(success|ok)$/i.test(statusMsg)) {
        if (looksAuthFailure(statusMsg)) {
            throw new AuthRequiredError('www.tiktok.com', `TikTok Studio item_list requires login: ${statusMsg}`);
        }
        throw new CommandExecutionError(`TikTok Studio item_list failed: ${statusMsg}`);
    }
}

function normalizeNumber(value) {
    const n = Number(value);
    return Number.isFinite(n) ? n : 0;
}

function formatDate(value) {
    const seconds = Number(value);
    if (!Number.isFinite(seconds) || seconds <= 0) return '';
    return new Date(seconds * 1000).toLocaleString('zh-CN', {
        timeZone: 'Asia/Shanghai',
        hour12: false,
    });
}

function extractUsername(item) {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Read the status_msg appended to the error for the server's explanation and retry if transient.
  2. Add backoff/retry for messages like 'server busy' or 'data not ready'.
  3. If the message is actually benign, update looksAuthFailure/the success regex in the library to recognize it.
  4. Capture the raw response payload to report/inspect when the message is unclear.

Example fix

// before
if (statusMsg && !/^(success|ok)$/i.test(statusMsg)) { throw ... }
// after
if (statusMsg && !/^(success|ok|success_with_warning)$/i.test(statusMsg)) { throw ... } // recognize benign new statuses
Defensive patterns

Strategy: retry

Try / catch

try {
  const videos = await listCreatorVideos(opts);
} catch (e) {
  const msg = String(e.message);
  if (msg.includes('item_list failed:') && /busy|not ready|try again/i.test(msg)) {
    await sleep(3000);
    return listCreatorVideos(opts);
  }
  throw e;
}

Prevention

When it happens

Trigger: item_list returns statusCode 0 (or missing) with status_msg like 'data not ready', 'server busy', or any text not matching /^(success|ok)$/i and not matching the auth regex.

Common situations: TikTok returning soft-degraded responses under load; new/unusual status messages introduced by TikTok API changes; edge cases like 'success with warnings' phrasing the library treats as failure.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/1115218efaebbe71. Report an issue: GitHub.