{"record":{"id":"4534cba397335b14","repo":"jackwener/OpenCLI","slug":"no-fund-accounts-found-hint-not-logged-in-to-da","errorCode":null,"errorMessage":"No fund accounts found — Hint: not logged in to danjuanfunds.com?","messagePattern":"No fund accounts found — Hint: not logged in to danjuanfunds\\.com\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clis/xueqiu/fund-holdings.js","lineNumber":18,"sourceCode":"import { cli, Strategy } from '@jackwener/opencli/registry';\nimport { fetchDanjuanAll } from './danjuan-utils.js';\ncli({\n    site: 'xueqiu',\n    name: 'fund-holdings',\n    access: 'read',\n    description: '获取蛋卷基金持仓明细（可用 --account 按子账户过滤）',\n    domain: 'danjuanfunds.com',\n    strategy: Strategy.COOKIE,\n    navigateBefore: 'https://danjuanfunds.com/my-money',\n    args: [\n        { name: 'account', type: 'str', default: '', help: '按子账户名称或 ID 过滤' },\n    ],\n    columns: ['accountName', 'fdCode', 'fdName', 'marketValue', 'volume', 'dailyGain', 'holdGain', 'holdGainRate', 'marketPercent'],\n    func: async (page, args) => {\n        const snapshot = await fetchDanjuanAll(page);\n        if (!snapshot.accounts.length) {\n            throw new Error('No fund accounts found — Hint: not logged in to danjuanfunds.com?');\n        }\n        const filter = String(args.account ?? '').trim();\n        const rows = filter\n            ? snapshot.holdings.filter(h => h.accountId === filter || h.accountName.includes(filter))\n            : snapshot.holdings;\n        if (!rows.length) {\n            throw new Error(filter ? `No holdings matched account filter: ${filter}` : 'No holdings found.');\n        }\n        return rows;\n    },\n});\n","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/xueqiu/fund-holdings.js#L1-L30","documentation":"The fund-holdings command calls fetchDanjuanAll and throws this Error when snapshot.accounts is empty. Like the danjuan-utils variant, it indicates the Danjuan session yielded no fund accounts — almost always because the browser session is not logged in to danjuanfunds.com, though a fund-account-free account produces the same result.","triggerScenarios":"Running the fund-holdings command with expired/absent danjuanfunds.com cookies so the accounts list comes back empty, or an account that has no fund accounts.","commonSituations":"Cookie expiration between runs, headless runs without cookie import, wrong cookies (anonymous session), or genuinely empty Danjuan fund account.","solutions":["Log in to danjuanfunds.com in the tool's browser session (refresh cookies) and rerun.","Re-export fresh cookies from a logged-in browser if cookies are provided manually.","Verify the Danjuan account actually has fund accounts in the web UI.","Use the danjuan-funds command to sanity-check the session state before fund-holdings."],"exampleFix":"// before\nclis/xueqiu fund-holdings   # No fund accounts found — Hint: not logged in to danjuanfunds.com?\n// after (login first)\nclis/xueqiu fund-holdings --account 账户A","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const rows = await getFundHoldings(page);\n} catch (err) {\n  if (err.message.startsWith('No fund accounts found')) {\n    // refresh danjuanfunds.com login cookies, then retry once\n  } else throw err;\n}","preventionTips":["Login to danjuanfunds.com in the tool's browser session before running.","Re-export fresh cookies on a schedule for automated jobs.","Confirm the account has fund accounts and note the --account filter only narrows existing rows."],"tags":["authentication","cookies","empty-result","danjuan"],"backgroundTag":"not-logged-in-session-expired","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}