jackwener/OpenCLI · error

Instagram unfollow returned no success evidence

Error message

Instagram unfollow returned no success evidence

What it means

The Instagram unfollow API responded 200 but its JSON body did not contain status:'ok', so the CLI cannot verify the unfollow actually happened. Instagram's web endpoints signal success only via status:'ok'; anything else (fail_status, empty body, HTML) is treated as failure. The CLI refuses to report 'Unfollowed' without that evidence.

Source

Thrown at clis/instagram/unfollow.js:41

  const opts = { credentials: 'include', headers };

  ${buildResolveInstagramUserIdJs()}

  const csrf = document.cookie.match(/csrftoken=([^;]+)/)?.[1] || '';
  const r2 = await fetch('https://www.instagram.com/api/v1/friendships/destroy/' + userId + '/', {
    method: 'POST',
    credentials: 'include',
    headers: { ...headers, 'X-CSRFToken': csrf, 'Content-Type': 'application/x-www-form-urlencoded' },
  });
  if (!r2.ok) throw new Error('Failed to unfollow: HTTP ' + r2.status);
  let d2;
  try {
    d2 = await r2.json();
  } catch {
    throw new Error('Instagram unfollow returned invalid JSON');
  }
  if (!d2 || typeof d2 !== 'object' || d2.status !== 'ok') {
    throw new Error('Instagram unfollow returned no success evidence');
  }
  return [{ status: 'Unfollowed', username }];
})()
` },
    ],
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Re-authenticate: log into Instagram in the browser session the CLI uses and refresh cookies (especially sessionid and csrftoken).
  2. Verify the username exists and you actually follow it before unfollowing.
  3. Wait and retry later — Instagram rate-limits bulk unfollow actions.
  4. Run with fewer actions per session to avoid automation throttling.

Example fix

// before
await api.unfollow('someuser');
// after
try {
  await api.unfollow('someuser');
} catch (e) {
  if (e.message.includes('no success evidence')) {
    await refreshInstagramSession(); // re-login, then retry once
    await api.unfollow('someuser');
  } else throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

const followed = await checkFriendship(username);
if (!followed) return skip('already unfollowed');

Type guard

const unfollowOk = (d) => !!d && typeof d === 'object' && d.status === 'ok';

Try / catch

try {
  await cli.unfollow(username);
} catch (e) {
  if (e.message.includes('no success evidence')) {
    await refreshSession();
    await cli.unfollow(username);
  } else throw e;
}

Prevention

When it happens

Trigger: POST to /api/v1/friendships/destroy/{userId} returns JSON lacking status:'ok' — e.g. rate limiting, login cookie expired, or the target user was already unfollowed/blocked.

Common situations: Stale session cookies after Instagram logs the user out elsewhere; unfollowing a user already unfollowed; Instagram soft-banning automated unfollow bursts; privacy changes where the friendship row never existed.

Related errors


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