{"record":{"id":"a9f44644417eed78","repo":"remotion-dev/remotion","slug":"privacy-must-be-a-string","errorCode":null,"errorMessage":"Privacy must be a string","messagePattern":"Privacy must be a string","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/shared/validate-privacy.ts","lineNumber":5,"sourceCode":"import type {Privacy} from './constants';\n\nexport function validatePrivacy(privacy: unknown): asserts privacy is Privacy {\n\tif (typeof privacy !== 'string') {\n\t\tthrow new TypeError('Privacy must be a string');\n\t}\n\n\tif (privacy !== 'private' && privacy !== 'public' && privacy !== 'no-acl') {\n\t\tthrow new TypeError(\n\t\t\t'Privacy must be either \"private\" or \"public\" or \"no-acl\"',\n\t\t);\n\t}\n}\n","sourceCodeStart":1,"sourceCodeEnd":14,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/shared/validate-privacy.ts#L1-L14","documentation":"Thrown by validatePrivacy() (an asserts-narrowing function) when the privacy argument is not a string. This is the type guard before the value allow-list check. Privacy controls the ACL applied to rendered outputs in GCS.","triggerScenarios":"Passing a non-string privacy value (undefined, null, number, object) to renderMediaOnCloudRun()/renderStillOnCloudRun() or bucket upload APIs.","commonSituations":"Reading privacy from env/config where it is unset; passing the wrong field from a typed object; defaulting to undefined instead of a known privacy string.","solutions":["Pass one of the allowed privacy strings: 'public', 'private', or 'no-acl'.","Default privacy when it is unset: const privacy = config.privacy ?? 'public'.","Validate config at startup before invoking the render API."],"exampleFix":"// before\nconst { PRIVACY } = process.env; // undefined\nawait renderMediaOnCloudRun({ privacy: PRIVACY, ... });\n// after\nconst privacy = process.env.PRIVACY ?? 'public';\nawait renderMediaOnCloudRun({ privacy, ... });","handlingStrategy":"type-guard","validationCode":"import { validatePrivacy } from '@remotion/cloudrun/shared';\nvalidatePrivacy(privacy);","typeGuard":"function isPrivacyString(v: unknown): v is string {\n  return typeof v === 'string';\n}","tryCatchPattern":"const privacy = typeof inputPrivacy === 'string' ? inputPrivacy : 'public';","preventionTips":["Default privacy to 'public' (the package default) when unset.","Type your config so privacy is a string literal union.","Validate config at startup."],"tags":["cloudrun","validation","typescript","privacy"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}