{"record":{"id":"09666fa8fba7bd54","repo":"HKUDS/Vibe-Trading","slug":"configured-acc-id-cfg-acc-id-was-not-found-in-th","errorCode":null,"errorMessage":"Configured acc_id {cfg.acc_id} was not found in the OpenD account list.","messagePattern":"Configured acc_id (.+?) was not found in the OpenD account list\\.","errorType":"exception","errorClass":"FutuProfileMismatchError","httpStatus":null,"severity":"error","filePath":"agent/src/trading/connectors/futu/sdk.py","lineNumber":1054,"sourceCode":"    Args:\n        cfg: Effective connector config.\n        trade_ctx: An open ``OpenSecTradeContext``.\n\n    Returns:\n        The resolved Futu account id.\n\n    Raises:\n        FutuProfileMismatchError: If the configured account's ``trd_env`` does\n            not match the profile, or no account matches the profile env.\n    \"\"\"\n    rows = _records(_unwrap(trade_ctx.get_acc_list()))\n    want = cfg.trd_env_name\n    matching = [row for row in rows if _trd_env_of(row) == want]\n\n    if cfg.acc_id:\n        target = next((row for row in rows if _acc_id_of(row) == cfg.acc_id), None)\n        if target is None:\n            raise FutuProfileMismatchError(\n                f\"Configured acc_id {cfg.acc_id} was not found in the OpenD account list.\"\n            )\n        if _trd_env_of(target) != want:\n            raise FutuProfileMismatchError(\n                f\"Configured acc_id {cfg.acc_id} has trd_env {_trd_env_of(target)!r}, \"\n                f\"but profile {cfg.profile!r} requires {want!r}. \"\n                \"Select a profile that matches this account's environment.\"\n            )\n        return cfg.acc_id\n\n    if not matching:\n        raise FutuProfileMismatchError(\n            f\"No Futu account with trd_env {want!r} was found for profile {cfg.profile!r}. \"\n            \"Confirm OpenD is logged into the expected account.\"\n        )\n    return _acc_id_of(matching[0])\n\n","sourceCodeStart":1036,"sourceCodeEnd":1072,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/trading/connectors/futu/sdk.py#L1036-L1072","documentation":"Raised by _resolve_acc_id when the acc_id set in FutuConfig does not appear in the account list returned by OpenD, meaning the SDK cannot select the trading account.","triggerScenarios":"Config carries a stale/wrong acc_id after switching Futu accounts, account closed, or config copied between environments (paper account id used against live profile).","commonSituations":"Rotating Futu accounts, re-logging OpenD into a different account, copying config files between machines, acc_id typo.","solutions":["Remove or update acc_id in the config so the SDK auto-resolves from the account list","Fetch the current account list from OpenD and set the correct acc_id","Confirm OpenD is logged into the intended Futu account"],"exampleFix":"// before\n{ \"profile\": \"paper\", \"acc_id\": 123456 }  // old account\n// after\n{ \"profile\": \"paper\" }  // let SDK resolve, or set current acc_id","handlingStrategy":"validation","validationCode":"rows = list_opend_accounts()  # via OpenD GetFunds|acct list\nknown = {_acc_id_of(r) for r in rows}\nif cfg.acc_id and cfg.acc_id not in known:\n    clear_or_update_acc_id()","typeGuard":null,"tryCatchPattern":"try:\n    snap = get_account_snapshot()\nexcept FutuProfileMismatchError as exc:\n    if 'not found in the OpenD account list' in str(exc):\n        reconfigure_acc_id()  # prompt user / auto-resolve\n    raise","preventionTips":["Omit acc_id to let the SDK auto-resolve by profile","Re-verify acc_id after switching Futu accounts or environments","Don't copy config files with embedded acc_id between accounts"],"tags":["futu","account","config","mismatch"],"backgroundTag":"account-id-mismatch","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}