jackwener/OpenCLI · warning · AuthRequiredError

Waiting for Xianyu unb/tracknick cookie

Error message

Waiting for Xianyu unb/tracknick cookie

What it means

During login polling, the poll callback checks for the unb/tracknick identity cookies before verifying; if hasXianyuIdentityCookie(page) is false, it throws AuthRequiredError to signal the login is not yet complete and polling should continue.

Source

Thrown at clis/xianyu/auth.js:64

    }
  }
  const nickname = probe.domNick || decodedTracknick;
  if (!userId && !nickname) {
    throw new CommandExecutionError('Xianyu /personal rendered but no user identity extractable — stale unb or layout drift');
  }
  return { user_id: String(userId), nickname: String(nickname) };
}

registerSiteAuthCommands({
  site: 'xianyu',
  domain: 'goofish.com',
  loginUrl: 'https://www.goofish.com/login',
  columns: ['user_id', 'nickname'],
  quickCheck: hasXianyuIdentityCookie,
  verify: verifyXianyuIdentity,
  poll: async (page) => {
    if (!await hasXianyuIdentityCookie(page)) {
      throw new AuthRequiredError('goofish.com', 'Waiting for Xianyu unb/tracknick cookie');
    }
    return verifyXianyuIdentity(page);
  },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Wait and keep polling — this is expected until login completes
  2. Complete the login in the automated browser (scan QR / enter credentials)
  3. Verify cookies are not blocked and the profile persists them
  4. If it never appears, confirm the login URL and flow actually set unb/tracknick

Example fix

// before
const identity = await poll(page); // throws until cookies set
// after
try {
  const identity = await poll(page);
} catch (e) {
  if (e instanceof AuthRequiredError) {
    await waitForLoginCompletion(page); // keep polling with backoff
  } else throw e;
}
Defensive patterns

Strategy: retry

Validate before calling

const hasCookies = await hasXianyuIdentityCookie(page);
if (!hasCookies) await waitFor(() => hasXianyuIdentityCookie(page), { timeoutMs: 120000 });

Try / catch

try {
  return await poll(page);
} catch (e) {
  if (e?.name === 'AuthRequiredError') {
    await sleep(2000);
    return poll(page); // expected until login completes
  }
  throw e;
}

Prevention

When it happens

Trigger: Polling after the user opens the goofish.com login URL; the browser has not yet received the unb and tracknick cookies because login is still in progress.

Common situations: User has not finished logging in yet (QR scan or password step pending); cookies blocked by browser settings; wrong login flow used that never sets these cookies.

Related errors


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