commaai/openpilot · error · Exception
Unable to parse: {url}
Error message
Unable to parse: {url} What it means
Bootlog.__init__ parses a bootlog URL/name with the RE.BOOTLOG_NAME regex (which equals ROUTE_NAME: {dongle_id}[|_/]{log_id}). If the string does not match that pattern, the URL cannot be split into dongle_id and log_id and the Bootlog cannot be constructed. It is strict input validation on bootlog identifiers.
Source
Thrown at openpilot/tools/lib/bootlog.py:16
import functools
import re
from openpilot.tools.lib.auth_config import get_token
from openpilot.tools.lib.api import CommaApi
from openpilot.tools.lib.helpers import RE
@functools.total_ordering
class Bootlog:
def __init__(self, url: str):
self._url = url
r = re.search(RE.BOOTLOG_NAME, url)
if not r:
raise Exception(f"Unable to parse: {url}")
self._id = r.group('log_id')
self._dongle_id = r.group('dongle_id')
@property
def url(self) -> str:
return self._url
@property
def dongle_id(self) -> str:
return self._dongle_id
@property
def id(self) -> str:
return self._id
def __str__(self):
return f"{self._dongle_id}/{self._id}"View on GitHub (pinned to 516ec1e682)
Solutions
- Pass the canonical name, e.g. '0000000000000000|2024-01-15--10-30-00' or a URL containing that substring
- When scanning directories, filter candidates through the same regex (re.search(RE.BOOTLOG_NAME, name)) before constructing Bootlog
- Verify the dongle id is the full hex id and the timestamp keeps the YYYY-MM-DD--HH-MM-SS shape
Example fix
# before
Bootlog('bootlog_2024.zip')
# after
from openpilot.tools.lib.helpers import RE
name = 'b0c9d232tripid|2024-01-15--10-30-00'
if re.search(RE.BOOTLOG_NAME, name):
bootlog = Bootlog(name) Defensive patterns
Strategy: type-guard
Validate before calling
import re
from openpilot.tools.lib.helpers import RE
if not re.search(RE.BOOTLOG_NAME, candidate):
raise SystemExit(f"{candidate!r} is not a parseable bootlog name (need dongleid|YYYY-MM-DD--HH-MM-SS)") Type guard
import re
from openpilot.tools.lib.helpers import RE
def is_bootlog_name(url: str) -> bool:
"""True when the string contains a route/bootlog-shaped identifier."""
return isinstance(url, str) and re.search(RE.BOOTLOG_NAME, url) is not None Try / catch
try:
bl = Bootlog(url)
except Exception as e:
if 'Unable to parse' in str(e):
continue # skip non-bootlog files when scanning a directory
raise Prevention
- Filter directory listings with the same RE.BOOTLOG_NAME regex before constructing Bootlog objects
- Keep bootlog names canonical (dongle_id + '|' + timestamp); avoid renaming archives away from that shape
When it happens
Trigger: Constructing Bootlog(url) with a full https URL whose path does not contain a parseable name, a filename like 'boot-xxxx.zip', or a raw segment name 'dongle|--00-00-00--0'; passing a dongle id alone or garbage text.
Common situations: Iterating a directory of bootlogs that includes non-bootlog files; renaming bootlog files; copy-pasting a truncated name; separators not in the accepted set ('|', '_', '/').
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- No camera file for segment {seg_idx}
- No valid camera paths
- invalid config backup: {backup}
- error getting route metadata: cannot find any uploaded logs
- Function body is empty
AI-assisted analysis of commaai/openpilot@516ec1e682 (2026-08-15).
Data as JSON: /api/errors/3730cb56911f752f.
Report an issue: GitHub.