commaai/openpilot · error · Exception
-32000
-32000
Error message
invalid service
What it means
athenad's JSON-RPC method getMessage rejects the request (code -32000) when the service argument is not a string in SERVICE_LIST, the list of cereal messaging services. It exists so remote clients cannot subscribe to arbitrary/nonexistent sockets.
Source
Thrown at openpilot/system/athena/athenad.py:357
stream = None
try:
stream, content_length = get_upload_stream(path, compress)
response = UPLOAD_SESS.put(upload_item.url,
data=CallbackReader(stream, callback, content_length) if callback else stream,
headers={**upload_item.headers, 'Content-Length': str(content_length)},
timeout=30)
return response
finally:
if stream:
stream.close()
# security: user should be able to request any message from their car
@dispatcher.add_method
def getMessage(service: str, timeout: int = 1000) -> dict:
if service is None or service not in SERVICE_LIST:
raise Exception("invalid service")
socket = messaging.sub_sock(service, timeout=timeout)
try:
ret = messaging.recv_one(socket)
if ret is None:
raise TimeoutError
# this is because capnp._DynamicStructReader doesn't have typing information
return cast(dict, ret.to_dict())
finally:
del socket
@dispatcher.add_method
def getVersion() -> dict[str, str]:
build_metadata = get_build_metadata()
return {View on GitHub (pinned to 516ec1e682)
Solutions
- Use the exact cereal service name with correct casing, e.g. 'carState', 'deviceState'
- Enumerate valid names from cereal services (cereal.SERVICE_LIST) before sending the request
- If the name looks right but is rejected, your device build may be older: check the cereal version it was built from
Example fix
// before
msg = {"jsonrpc": "2.0", "method": "getMessage", "params": {"service": "carstate"}, "id": 1}
// after
from cereal import SERVICE_LIST
service = 'carState'
assert service in SERVICE_LIST
msg = {"jsonrpc": "2.0", "method": "getMessage", "params": {"service": service}, "id": 1} Defensive patterns
Strategy: validation
Validate before calling
from cereal import SERVICE_LIST
def valid_service(service) -> bool:
return isinstance(service, str) and service in SERVICE_LIST Type guard
def is_valid_service(service: object) -> bool:
return isinstance(service, str) and service in SERVICE_LIST Prevention
- Copy service names verbatim from cereal's service list (mind the camelCase)
- Fail fast client-side on unknown services instead of relying on the device error
When it happens
Trigger: Calling startLocalProxy-style athena API getMessage with service=None, a misspelled name ('carstate' vs 'carState'), or a service that exists in some builds but not the one on the device.
Common situations: Typos or wrong casing in companion-app/cabana requests, service renamed between openpilot versions (e.g. a renamed log), client code built against a different cereal revision.
Related errors
- not a valid request or response
- message must be a JSON object
- -32602
- Profile nickname must be 64 bytes or less
- Confirmation code required but not provided
AI-assisted analysis of commaai/openpilot@516ec1e682 (2026-08-15).
Data as JSON: /api/errors/aea1dce8e3ed54c1.
Report an issue: GitHub.