{"record":{"id":"e55f73c0225c9330","repo":"commaai/openpilot","slug":"s","errorCode":null,"errorMessage":"%s\n","messagePattern":"%s\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"openpilot/tools/cabana/cabana.cc","lineNumber":156,"sourceCode":"  utils::setTheme(settings.theme);\n\n  CabanaArgs args;\n  bool args_ok = false;\n  if (const int code = parseArgs(argc, argv, args, args_ok); !args_ok) {\n    return code;\n  }\n\n  AbstractStream *stream = nullptr;\n\n  if (args.msgq) {\n    stream = new DeviceStream(&app);\n  } else if (!args.zmq.empty()) {\n    stream = new DeviceStream(&app, QString::fromStdString(args.zmq));\n  } else if (args.panda || !args.panda_serial.empty()) {\n    try {\n      stream = new PandaStream(&app, {.serial = args.panda_serial});\n    } catch (std::exception &e) {\n      fprintf(stderr, \"%s\\n\", e.what());\n      return 0;\n    }\n#ifdef __linux__\n  } else if (SocketCanStream::available() && !args.socketcan.empty()) {\n    stream = new SocketCanStream(&app, {.device = args.socketcan});\n#endif\n  } else {\n    uint32_t replay_flags = REPLAY_FLAG_NONE;\n    if (args.wide_road) replay_flags |= REPLAY_FLAG_WIDE_ROAD;\n    if (args.qcam) replay_flags |= REPLAY_FLAG_QCAMERA;\n    if (args.cabin) replay_flags |= REPLAY_FLAG_CABIN_CAMERA;\n    if (args.no_vipc) replay_flags |= REPLAY_FLAG_NO_VIPC;\n\n    QString route;\n    if (!args.route.empty()) {\n      route = QString::fromStdString(args.route);\n    } else if (args.demo) {\n      route = DEMO_ROUTE;","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/commaai/openpilot/blob/516ec1e68203439a73f340f1d0b3b91eabc626ee/openpilot/tools/cabana/cabana.cc#L138-L174","documentation":"Printed in cabana's main() when constructing PandaStream(&app, {.serial = args.panda_serial}) throws — the exception's what() is printed verbatim on its own line (the '%s\\n' wrapper) and main returns 0. Typical PandaStream failures: no panda found on USB, USB claim/open errors, wrong serial specified, or the device being busy (claimed by another process).","triggerScenarios":"Running `cabana --panda` with no panda plugged in, `--panda-serial <wrong-id>` when multiple pandas are attached, the panda already claimed by boardd/panda_flash, or a permissions problem opening the USB device (udev rules) which surfaces as an exception message.","commonSituations":"First-run on Linux without udev rules for the comma panda serial device, forgetting boardd is running and holding the interface, or specifying a serial from a different device.","solutions":["List connected pandas (e.g. `lsusb` / pandas are bbddaa... serials; use the tools in panda repo) and confirm yours appears.","Stop other processes holding the device (boardd, flashing tools) before starting cabana --panda.","Pass the exact serial via --panda-serial when more than one panda is connected.","Install/refresh udev rules or run with sufficient permissions so USB open succeeds."],"exampleFix":"# before\npkill -f boardd; cabana --panda            # or nothing claims/plugs\n\n# after\n# ensure device free and addressable\ncabana --panda-serial 4d0000000052513032363438","handlingStrategy":"try-catch","validationCode":"import subprocess\ndevices = subprocess.run(['lsusb'], capture_output=True, text=True).stdout\nif 'comma' not in devices.lower() and 'bbddaa' not in devices.lower():\n    raise SystemExit('no panda detected on USB')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the panda is plugged in and not claimed by boardd/flash tools.","Pass --panda-serial when multiple devices are present.","Install udev rules so the USB device is openable by your user."],"tags":["cabana","panda","usb","hardware","openpilot"],"backgroundTag":null,"analyzedSha":"516ec1e68203439a73f340f1d0b3b91eabc626ee","analyzedAt":"2026-08-15T00:17:37.461Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}