jackwener/OpenCLI · error · CommandExecutionError
Pin update did not return the updated pin
Error message
Pin update did not return the updated pin
What it means
Thrown in clis/pinterest/pin-update.js:64 when pinterestResourceUpdate on PinResource returns nothing usable (no object or no id). The library treats this as an unsuccessful update since it cannot confirm the change or report the pin's new state.
Source
Thrown at clis/pinterest/pin-update.js:64
if (boardRef) {
const { username, slug, path, board: preloadedBoard } = await resolveBoardTarget(page, boardRef);
await page.goto(`${PINTEREST_BASE}${path}`);
const { boardId } = await resolveBoardId(page, username, slug, path, preloadedBoard);
options.board_id = boardId;
// PinResource/update is the only endpoint that honours a section, and only under this key.
if (section) options.board_section_id = (await resolveSection(page, boardId, section, path)).sectionId;
sourceUrl = path;
} else {
await page.goto(`${PINTEREST_BASE}${sourceUrl}`);
}
if (title) options.title = title;
if (description !== undefined) options.description = description;
if (link !== undefined) options.link = link;
const updated = await pinterestResourceUpdate(page, 'PinResource', options, sourceUrl);
if (!updated || !updated.id) {
throw new CommandExecutionError('Pin update did not return the updated pin');
}
return [{
pinId: String(updated.id),
title: (updated.title || updated.grid_title || title || '').trim(),
board: (updated.board && updated.board.name) || boardRef,
url: `${PINTEREST_BASE}/pin/${updated.id}/`,
}];
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Re-authenticate / refresh session cookies, then retry — empty resource responses usually mean an unauthenticated request
- Verify you still have write access to the pin's board in the browser
- Retry later if Pinterest is rate-limiting; test a trivial edit (title tweak) in the browser to confirm updates work at all
- If it persists, capture the PinResource/update network response and update the library's parsing of the reply
Defensive patterns
Strategy: try-catch
Validate before calling
const probe = await run(['pin', pinId]);
if (!probe) throw new Error('Pin not accessible; aborting update'); Type guard
function hasPinId(res) {
return res !== null && typeof res === 'object' && res.id !== undefined;
} Try / catch
try {
await run(['pin-update', pinId, ...fieldArgs]);
} catch (e) {
if (/did not return the updated pin/.test(e.message)) {
await refreshSession();
return retry(() => run(['pin-update', pinId, ...fieldArgs]), 1);
}
throw e;
} Prevention
- Keep sessions fresh; empty update responses usually mean expired cookies
- Verify write access to the pin's board before scripted edits
- Space out bulk edits to avoid rate-limited empty responses
- After updates, read the pin back to confirm the change stuck
When it happens
Trigger: The PinResource/update call completes but yields an empty/malformed payload — expired session cookies, Pinterest silently rejecting the edit (permissions, moderation), wrong pin/board state, or a Pinterest API/DOM change breaking response extraction.
Common situations: Editing a pin on a board you no longer have write access to; session expiry mid-automation; Pinterest A/B API changes; rate limiting returning empty bodies; passing a --board reference that resolved incorrectly so the update path errors server-side.
Related errors
- Pin creation did not return a pin id
- Repin did not return a pin id
- Bilibili ${label} API returned a malformed payload
- Bilibili ${label} API failed: ${message} (${payload.code})
- coingecko global returned malformed JSON: ${err?.message ??
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/0e98ab7c88630018.
Report an issue: GitHub.