{"record":{"id":"d00459fd762cdf2a","repo":"remotion-dev/remotion","slug":"json-error-d00459","errorCode":null,"errorMessage":"{json.error}","messagePattern":"\\{json\\.error\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/licensing/src/register-usage-event.ts","lineNumber":122,"sourceCode":"\t\t\t\t}),\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t},\n\t\t\t\tsignal: abortController.signal,\n\t\t\t});\n\t\t\tclearTimeout(timeout);\n\n\t\t\tconst json = (await res.json()) as ApiResponse;\n\n\t\t\tif (json.success) {\n\t\t\t\treturn {\n\t\t\t\t\tbillable: json.billable,\n\t\t\t\t\tclassification: json.classification,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (!res.ok) {\n\t\t\t\tthrow new Error(json.error);\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t`Unexpected response from server: ${JSON.stringify(json)}`,\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tclearTimeout(timeout);\n\n\t\t\tconst error = err as Error;\n\t\t\tconst isTimeout = error.name === 'AbortError';\n\t\t\tconst isRetryable = isNetworkError(error) || isTimeout;\n\n\t\t\tif (!isRetryable) {\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\tlastError = isTimeout\n\t\t\t\t? new Error('Request timed out after 10 seconds')","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/licensing/src/register-usage-event.ts#L104-L140","documentation":"internalRegisterUsageEvent throws this when the licensing server returns success:false AND res.ok is false. Such errors are not retried (only network/timeout errors are), so this surfaces a definitive server rejection: usually an invalid license key, a request that failed server-side validation, or a usage event the server refused.","triggerScenarios":"Calling register-usage-event machinery (cloud-render/web-render tracking) with an invalid or expired license key; sending an event type the server does not accept; account suspended.","commonSituations":"Running renders with REMOTION_LICENSE_KEY unset/invalid in production; the license key being revoked between deploys; license tier exceeded and the server refusing to record further usage.","solutions":["Inspect json.error for the exact server reason.","Set a valid REMOTION_LICENSE_KEY in the render environment.","If the license is correct, contact Remotion support with the server error text.","Confirm the event payload (host, succeeded, event, isStill, isProduction) matches expected values."],"exampleFix":"// before\n// env: REMOTION_LICENSE_KEY=\n// after\n// env: REMOTION_LICENSE_KEY=<valid key from remotion.pro dashboard>","handlingStrategy":"try-catch","validationCode":"const key = process.env.REMOTION_LICENSE_KEY;\nif (typeof key !== 'string' || key.length < 10) {\n  throw new Error('REMOTION_LICENSE_KEY is missing or invalid before registering usage');\n}","typeGuard":"const isNonEmptyKey = (k: unknown): k is string => typeof k === 'string' && k.length > 0;","tryCatchPattern":"try {\n  await internalRegisterUsageEvent({...});\n} catch (e) {\n  // Server-rejected usage events are non-retriable; log and continue rendering.\n  console.warn('Usage event rejected:', (e as Error).message);\n}","preventionTips":["Validate the license key is set and well-formed before any render.","Treat usage-event failures as telemetry-only, never block the render.","Keep @remotion/licensing version aligned with the rest of the Remotion packages.","Surface server error text to operators so they can fix the license."],"tags":["typescript","licensing","network","license-key","telemetry"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}