Roku SDK Error Reference

Error and warning messages emitted by the StreamLayer Roku SDK, what causes each one, and how to fix it.

The StreamLayer Roku SDK does not use numeric error codes. Instead, it surfaces problems as structured log messages through its logging interface. This page maps each message to its cause and fix.

For setup steps, see the Integration Guide. For the methods referenced below, see the API Reference.

Enable logging first

Error and warning messages are only emitted when logging is enabled. Pass
isLoggingEnabled: true to initSdk, then read the SDK's log field (or your
Roku debug console) to see them.

m.streamLayer.callFunc("initSdk", { apiKey: "your-sdk-api-key", isLoggingEnabled: true })

Severity levels

LevelMeaning
errorA required step failed; the SDK could not complete the operation.
warnThe SDK recovered or skipped an optional step; integration may be misconfigured.

Initialization

MessageLevelCauseFix
❌ initSdk: params missingerrorinitSdk was called with no params object. initSdk returns false.Pass a params object with at least apiKey. See API Reference → initSdk.
initSdk: Missing API keyerrorparams.apiKey is empty or invalid.Provide a valid SDK API Key from StreamLayer Studio.
SDK initialization failederrorThe underlying SceneGraph SDK runtime failed to initialize after config load.Verify network access and that the API URL/key are correct; check earlier log lines for the root cause.
[SDKFactory] Failed to initialize ApiServiceerrorThe network/API service could not be created.Confirm the device has network access and apiUrl is reachable.
[SDKFactory] Failed to initialize AnalyticsServiceerrorThe analytics service could not be created while isAnalyticsEnabled is true.Check network access; disable analytics (isAnalyticsEnabled: false) to isolate the issue.

Player attachment

MessageLevelCauseFix
Provided playerRef is not an roSGNode (type = ...)warnThe playerRef passed to initSdk / attachPlayer is not a SceneGraph node.Pass the host Video node, not a plain object or invalid.
Provided playerRef is not Video-like (subtype = ...)warnThe node is an roSGNode but lacks the control and state fields.Pass an actual Video node (or a node that exposes control and state).
setEvent: Player not attachederrorsetEvent was called before a valid player was attached.Call attachPlayer (or pass playerRef to initSdk) before setEvent.

Event & subscriptions

MessageLevelCauseFix
[SDKFactory] AuthManager or EventManager not initialized — cannot set eventerrorsetEvent ran before authentication/SDK setup completed.Wait for successful initialization before calling setEvent; ensure initSdk returned true.
[SDKFactory] Gamification disabled — skipping event setupwarnThe organization has gamification disabled in StreamLayer Studio.Expected when gamification is off. Enable it in Studio if interactive units are needed.
[SDKFactory] Cannot fetch question subscriptions – invalid organizationIderrorOrganization data was missing when polling started.Ensure authentication succeeded (see Authentication errors below).
[SDKFactory] Cannot fetch question subscriptions – invalid eventIderrorsetEvent was called with an empty event id.Pass a non-empty hostEventId to setEvent.

Pause ad units

MessageLevelCauseFix
showPauseAd ignored: currentEventId invaliderrorshowPauseAd was called before an event was set.Call setEvent first so the SDK knows which event to load pause ad units for.
showPauseAd ignored: vastUrl missingerrorIn VAST mode, showPauseAd was called without a vastUrl.Pass { vastUrl: "..." } to showPauseAd, or switch off VAST mode.
[SDKFactory] PauseAdManager not initializedwarnA pause ad action ran before the pause ad subsystem was ready.Ensure isPauseAdsEnabled is true and initialization completed.
[SDKFactory] Invalid eventId for pause adswarnA pause ad was requested with no active event.Call setEvent before requesting pause ad units.
[SDKFactory] VASTManager not initializederrorA VAST operation ran while VAST mode was not properly initialized.Enable VAST mode via initSdk (isVastModeEnabled: true) or setVastModeEnabled before showing VAST pause ad units.

Authentication

These come from AuthManager during the anonymous login / token exchange that runs after initSdk.

MessageLevelCauseFix
[AuthManager] Invalid organization responseerrorThe organization settings request returned an unparseable response.Verify the SDK API Key and API URL; confirm the key is active in StreamLayer Studio.
[AuthManager] Cannot start anonymous login — org data missingerrorLogin started before organization data was available.Usually follows an invalid organization response — fix that first.
[AuthManager] Failed to parse BypassAuthResponseerrorThe authentication endpoint returned an unexpected payload.Check API connectivity and that the key is valid; retry.
[AuthManager] Cannot get JWE — missing dataerrorRequired data for the JWE exchange was absent.Ensure authentication completed; check earlier auth log lines.
[AuthManager] JWE token invaliderrorThe JWE token returned by the server failed validation.Verify the SDK API Key and that server clocks/credentials are valid; retry.
[AuthManager] JWT token invaliderrorThe exchanged JWT failed validation.Same as above — confirm credentials and retry; contact support if it persists.
[AuthManager] Failed to parse UserSettingsResponseerrorThe user settings response was unparseable.Check API connectivity; report to support with logs if it recurs.

"Method not available" warnings

MessageLevelCauseFix
safeSdkCall: SDK not initialized (method=...)errorA method was invoked before initSdk completed.Call initSdk and wait for success before other calls.
safeSdkCall: method '...' not available in current SDK modewarnA method was called that does not exist in the active mode (for example, a VAST-only call in full mode).Use the method that matches your mode, or switch modes with setVastModeEnabled. This is a safe no-op.

Still stuck?

If an error persists after applying the fix, capture the SDK log (isLoggingEnabled: true) and contact [email protected]. Include the SDK version from getVersion() and the surrounding log lines.