Skip to content

E2EEManager::frameCryptors() always throws: its request never selects manager_get_frame_cryptors #299

Closed

Description

@mdepinet

This issue was found, verified, and written up by Claude Opus 5.5 (an AI model by Anthropic), working with @mdepinet while moving godot-livekit, which wraps this SDK in a Godot extension, to v1.12.4.

LiveKit C++ SDK Version

v1.12.4 (also v0.3.1, and main at 550f078)

Platform

Linux x86_64

OS Version

Ubuntu 24.04.5

Compiler & Version

gcc 13.3.0

CMake Version

3.29.5

How are you using the SDK?

Other (describe below)

The pre-built release package, linked directly by godot-livekit's SCons build rather than through find_package.

Issue Description

E2EEManager::frameCryptors() always throws std::runtime_error("failed to send request, received an invalid handle"), so there's no way to get a room's frame cryptors (or to call setEnabled() or setKeyIndex() on one).

It sets the request's room handle, but never says which E2EE request it is, so the FFI gets an E2eeRequest with no message and rejects it (src/e2ee.cpp):

std::vector<E2EEManager::FrameCryptor> E2EEManager::frameCryptors() const {
  proto::FfiRequest req;
  req.mutable_e2ee()->set_room_handle(room_handle_);
  auto resp = FfiClient::instance().sendRequest(req);

The other E2EE requests each select their message (e.g. mutable_manager_set_enabled()). Selecting manager_get_frame_cryptors fixes it: #300

Expected: the room's frame cryptors, including one for the local participant once it has published a track.

Actual: the call throws.

Steps to Reproduce

livekit::RoomOptions options;
options.encryption = livekit::E2EEOptions{};
options.encryption->key_provider_options.shared_key = std::vector<std::uint8_t>{'k', 'e', 'y'};
livekit::Room room;
room.connect(url, token, options);
auto source = std::make_shared<livekit::AudioSource>(48000, 1, 0);
auto track = room.localParticipant().lock()->publishAudioTrack("audio", source, livekit::TrackSource::SOURCE_MICROPHONE);
room.e2eeManager().lock()->frameCryptors(); // throws

Logs

[2026-10-26T07:20:25Z ERROR livekit_ffi::room_apis::cabi] failed to handle request FfiRequest { message: Some(E2ee(E2eeRequest { room_handle: 312, message: None })) }: InvalidRequest("message is empty")
terminate called after throwing an instance of 'std::runtime_error'
  what():  failed to send request, received an invalid handle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions