jackwener/OpenCLI · error · CommandExecutionError
${label} did not include a stable numeric id.
Error message
${label} did not include a stable numeric id. What it means
A CommandExecutionError thrown by requireStableId (clis/dongchedi/utils.js:125), called by parseModels and other parsers (gid/seriesId paths). It fires when an entity that must carry a stable numeric id (a non-zero digit-only string) yields an empty, non-numeric, or '0' value. The library requires stable ids so output rows can be re-fed into later commands (specs/models/score).
Source
Thrown at clis/dongchedi/utils.js:125
export function assertPlainObject(value, label) {
if (!value || typeof value !== 'object' || Array.isArray(value)) {
throw new CommandExecutionError(`${label} returned an unexpected payload shape; expected an object.`);
}
return value;
}
export function requireArray(value, label) {
if (!Array.isArray(value)) {
throw new CommandExecutionError(`${label} returned an unexpected payload shape; expected an array.`);
}
return value;
}
export function requireStableId(value, label) {
const id = String(value ?? '').trim();
if (!/^\d+$/.test(id) || id === '0') {
throw new CommandExecutionError(`${label} did not include a stable numeric id.`);
}
return id;
}
export function requireText(value, label) {
const text = clean(value);
if (!text) {
throw new CommandExecutionError(`${label} did not include a stable text value.`);
}
return text;
}
/** Rescale a Dongchedi x100 score int (422) to a /5 float (4.22). */
export function parseScore(raw) {
const n = Number(raw);
if (!Number.isFinite(n) || n <= 0) return null;
return Number((n / 100).toFixed(2));
}View on GitHub (pinned to 49907e53dc)
Solutions
- Inspect the live pageProps entry to find where the numeric id now lives and update the parser's key path.
- Filter out list entries without a real id (ads, placeholders, pre-release items) before parsing instead of letting the guard throw.
- Verify the item exists on dongchedi.com in a browser — placeholder '0' ids indicate the entry is not a real entity.
- Catch CommandExecutionError and skip the offending row, logging which label lacked the id.
Example fix
// before const id = requireStableId(model.car_id, 'model'); // throws on placeholder 0 // after if (!model.car_id || String(model.car_id) === '0') continue; // skip non-real entries const id = requireStableId(model.car_id, 'model');
Defensive patterns
Strategy: validation
Validate before calling
function hasStableId(entry) {
const id = String(entry?.car_id ?? '').trim();
return /^\d+$/.test(id) && id !== '0';
} Try / catch
try {
const id = requireStableId(model.car_id, 'model');
} catch (err) {
if (err instanceof CommandExecutionError && /stable numeric id/.test(err.message)) {
skipRow(model, 'no stable id'); // filter placeholders instead of crashing
} else throw err;
} Prevention
- Filter list entries lacking a real id (ads, pre-release items) before parsing.
- Re-check parser key paths when ids come back undefined after a site update.
- Confirm '0' ids are placeholders, not real entities, and skip them.
- Cross-verify unfamiliar ids against the live site before reuse.
When it happens
Trigger: Parsing models or series entries whose `car_id`/`series_id` field is missing, null, a temporary/internal placeholder like 0, or a string with non-digit characters after a Dongchedi schema change.
Common situations: Newly published or pre-release car entries that have no assigned id yet; scraping after a schema rename (e.g. id moved to a different key so the old key reads undefined); list items rendered as ad/promo cards without real ids.
Related errors
- ${label} returned an unexpected payload shape; expected an o
- ${label} returned an unexpected payload shape; expected an a
- ${label} did not include a stable text value.
- dongchedi specs ${seriesId}: No spec overview found for this
- Sales Navigator lead search API returned malformed lead row
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/0056af6e86231619.
Report an issue: GitHub.