{"record":{"id":"c0bb69af3b490ba4","repo":"jackwener/OpenCLI","slug":"data-error-are-you-logged-into-creator-xiaohon","errorCode":null,"errorMessage":"${data.error}. Are you logged into creator.xiaohongshu.com?","messagePattern":"(.+?)\\. Are you logged into creator\\.xiaohongshu\\.com\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clis/xiaohongshu/creator-profile.js","lineNumber":38,"sourceCode":"    args: [],\n    columns: ['field', 'value'],\n    func: async (page, _kwargs) => {\n        await page.goto('https://creator.xiaohongshu.com/new/home');\n        const data = await page.evaluate(`\n      async () => {\n        try {\n          const resp = await fetch('/api/galaxy/creator/home/personal_info', {\n            credentials: 'include',\n          });\n          if (!resp.ok) return { error: 'HTTP ' + resp.status };\n          return await resp.json();\n        } catch (e) {\n          return { error: e.message };\n        }\n      }\n    `);\n        if (data?.error) {\n            throw new Error(data.error + '. Are you logged into creator.xiaohongshu.com?');\n        }\n        if (!data?.data) {\n            throw new Error('Unexpected response structure');\n        }\n        const d = data.data;\n        const grow = d.grow_info || {};\n        return [\n            { field: 'Name', value: d.name ?? '' },\n            { field: 'Followers', value: d.fans_count ?? 0 },\n            { field: 'Following', value: d.follow_count ?? 0 },\n            { field: 'Likes & Collects', value: d.faved_count ?? 0 },\n            { field: 'Creator Level', value: grow.level ?? 0 },\n            { field: 'Level Progress', value: `${grow.fans_count ?? 0}/${grow.max_fans_count ?? 0} fans` },\n            { field: 'Bio', value: (d.personal_desc ?? '').replace(/\\\\n/g, ' | ') },\n        ];\n    },\n});\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/xiaohongshu/creator-profile.js#L20-L56","documentation":"The creator-profile command throws this generic Error when the in-page fetch of /api/galaxy/creator/home/personal_info returns an { error } object — either an HTTP status ('HTTP 401', 'HTTP 403', ...) serialized from !resp.ok, or a caught JS exception message from inside page.evaluate. The message is suffixed with a login hint because the internal cookie-auth API fails primarily when the session is missing or expired.","triggerScenarios":"Not logged into creator.xiaohongshu.com (401/302-to-login), cookies rejected/expired (403), risk control blocking the direct fetch, network failure inside evaluate, or the /new/home page didn't finish loading so the request failed.","commonSituations":"Chrome profile never logged in or session expired; using a personal (non-creator) account; captcha/verification wall intercepting the API; DNS/proxy issues in the browser; cookie auth strategy run without navigateBefore completing.","solutions":["Open creator.xiaohongshu.com/new/home in the connected Chrome and complete login (and any verification/captcha), then retry.","Confirm the logged-in account is a creator account with access to the creator dashboard.","If the message starts with 'HTTP', decode it: 401 → login, 403 → permissions/verification, 5xx → retry later.","Check browser network/proxy settings if the error is a fetch exception (e.g. 'Failed to fetch').","Retry after a pause if risk control is intercepting; reduce run frequency."],"exampleFix":"// before\nconst rows = await run('xiaohongshu creator-profile', {});\n// after\ntry {\n  return await run('xiaohongshu creator-profile', {});\n} catch (e) {\n  if (/HTTP 40[13]/.test(e.message) || /logged into/.test(e.message)) {\n    await loginCreatorXhs(page); // interactive login + captcha\n    return await run('xiaohongshu creator-profile', {});\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"// probe the session before running the command\nconst res = await fetch('https://creator.xiaohongshu.com/api/galaxy/creator/home/personal_info', { credentials: 'include' });\nif (res.status === 401 || res.status === 403) await loginCreatorXhs();","typeGuard":"function hasNoError(d) {\n  return typeof d === 'object' && d !== null && !('error' in d);\n}","tryCatchPattern":"try {\n  return await run('xiaohongshu creator-profile', {});\n} catch (e) {\n  if (/HTTP 40[13]/.test(e.message) || /logged into creator\\.xiaohongshu\\.com/.test(e.message)) {\n    await loginCreatorXhs(); // interactive: complete captcha/verification\n    return await run('xiaohongshu creator-profile', {});\n  }\n  throw e;\n}","preventionTips":["Log in to creator.xiaohongshu.com (including any captcha/verification) before running the command.","Use a creator account, not a plain personal account.","Decode the 'HTTP <status>' prefix in the message to pick the right fix.","Probe personal_info with a lightweight fetch before automating.","If the error is a fetch exception, check browser network/proxy health."],"tags":["authentication","cookie-auth","xiaohongshu","http-status"],"backgroundTag":"creator-session-not-logged-in","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}