{"record":{"id":"fcd8e8faef62b155","repo":"remotion-dev/remotion","slug":"artifact-registry-env-is-process-env-artifact-re","errorCode":null,"errorMessage":"ARTIFACT_REGISTRY_ENV is ${process.env.ARTIFACT_REGISTRY_ENV}, but it should be either 'development' or 'production'","messagePattern":"ARTIFACT_REGISTRY_ENV is (.+?), but it should be either 'development' or 'production'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/container/submit.mjs","lineNumber":9,"sourceCode":"import {execSync} from 'child_process';\nimport {existsSync, rmSync, writeFileSync} from 'fs';\nimport {VERSION} from 'remotion/version';\nimport {build} from './build.mjs';\n\nif (\n\t!['development', 'production'].includes(process.env.ARTIFACT_REGISTRY_ENV)\n) {\n\tthrow new Error(\n\t\t`ARTIFACT_REGISTRY_ENV is ${process.env.ARTIFACT_REGISTRY_ENV}, but it should be either 'development' or 'production'`,\n\t);\n}\n\nif (existsSync('./ensure-browser.mjs')) {\n\trmSync('./ensure-browser.mjs', {\n\t\tforce: true,\n\t});\n}\n\nbuild();\n\nconst isCached = process.argv.includes('--cached');\nif (isCached) {\n\t// eslint-disable-next-line no-console\n\tconsole.log('Creating cacheed image');\n}\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/container/submit.mjs#L1-L27","documentation":"Thrown by the @remotion/cloudrun container submission script (submit.mjs) at startup if process.env.ARTIFACT_REGISTRY_ENV is not exactly 'development' or 'production'. This env selects which Google Artifact Registry the Cloud Run image is pushed to, so an unset or mistyped value aborts the build before any push.","triggerScenarios":"Running the Cloud Run container build/submit script without exporting ARTIFACT_REGISTRY_ENV, or with a typo such as 'prod', 'dev', 'staging', or trailing whitespace.","commonSituations":"Local maintainer building the Cloud Run image without copying the env from CI; a CI secret misnamed; shell that did not reload .env; copy-paste of a value like 'prod' instead of the full word.","solutions":["Export the variable with one of the two exact values: `export ARTIFACT_REGISTRY_ENV=production` (or `development`).","Add the export to your shell profile or CI environment so it is always set.","Double-check for trailing whitespace or quotes when reading from a .env file."],"exampleFix":"// before\n$ node packages/cloudrun/container/submit.mjs\nARTIFACT_REGISTRY_ENV is undefined, but it should be either 'development' or 'production'\n// after\n$ export ARTIFACT_REGISTRY_ENV=production\n$ node packages/cloudrun/container/submit.mjs","handlingStrategy":"validation","validationCode":"const VALID = new Set(['development', 'production']);\n\nconst assertRegistryEnv = (env: string | undefined) => {\n  if (!env || !VALID.has(env)) {\n    throw new Error(`ARTIFACT_REGISTRY_ENV must be 'development' or 'production' (got '${env}')`);\n  }\n};\n\nassertRegistryEnv(process.env.ARTIFACT_REGISTRY_ENV);","typeGuard":"const isRegistryEnv = (env: unknown): env is 'development' | 'production' =>\n  typeof env === 'string' && ['development', 'production'].includes(env);","tryCatchPattern":null,"preventionTips":["Set ARTIFACT_REGISTRY_ENV in your shell profile and CI secret store.","Validate env values at process start with a strict allowlist.","Trim whitespace when loading env from a .env file."],"tags":["cloudrun","container","environment","deployment"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}