{"record":{"id":"a2f938e77e13dc1c","repo":"hcengineering/platform","slug":"missing-config-for-attributes-missingenv-join-a2f938","errorCode":null,"errorMessage":"Missing config for attributes: ${missingEnv.join(', ')}","messagePattern":"Missing config for attributes: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"services/print/pod-print/src/config.ts","lineNumber":36,"sourceCode":"const parseNumber = (str: string | undefined): number | undefined => (str !== undefined ? Number(str) : undefined)\n\nconst config: Config = (() => {\n  const allowedHostnames = process.env.ALLOWED_HOSTNAMES\n  const puppeteerArgs = process.env.PUPPETEER_ARGS ?? ''\n\n  const params: Partial<Config> = {\n    Port: parseNumber(process.env.PORT) ?? 4005,\n    Secret: process.env.SECRET,\n    AccountsUrl: process.env.ACCOUNTS_URL,\n    FrontUrl: process.env.FRONT_URL,\n    AllowedHostnames: allowedHostnames == null ? [] : allowedHostnames.split(','),\n    PuppeteerArgs: puppeteerArgs.split(',')\n  }\n\n  const missingEnv = (Object.keys(params) as Array<keyof Config>).filter((key) => params[key] === undefined)\n\n  if (missingEnv.length > 0) {\n    throw Error(`Missing config for attributes: ${missingEnv.join(', ')}`)\n  }\n\n  return params as Config\n})()\n\nexport default config\n","sourceCodeStart":18,"sourceCodeEnd":43,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/services/print/pod-print/src/config.ts#L18-L43","documentation":"pod-print's config IIFE iterates every key of the assembled params object and throws if any value is undefined. The params include fields like Port, TemplateUrl/workspace settings, and PuppeteerArgs (built from a comma-separated env value), so any unset variable that leaves a param undefined triggers this error at startup.","triggerScenarios":"Starting pod-print with any config env var unset — most commonly the port, the workspace/template URL, or the puppeteer-args string (note: an empty-string puppeteerArgs becomes an array, not undefined, but a missing source env leaves the param undefined).","commonSituations":"Running pod-print without the full example .env; forgetting the workspace/transactor URL in a minimal deployment; deploying without the puppeteer-args variable after a config template changed.","solutions":["Read the error message — it lists the exact missing Config keys; map them to env var names via envMap in pod-print/src/config.ts and set them.","Ensure Port is set to a numeric value and the template/workspace URL is provided.","Provide the puppeteer-args env var (comma-separated, e.g. --no-sandbox,--disable-dev-shm-usage) if it is among the listed keys.","Compare your environment against the pod-print example env file before deploying."],"exampleFix":"// before\n# only port provided\nPORT=4010\n// after\nPORT=4010\nWORKSPACE_URL=https://transactor.example.com\nPUPPETEER_ARGS=--no-sandbox,--disable-dev-shm-usage","handlingStrategy":"validation","validationCode":"// Check the keys pod-print assembles into params before startup\nconst required = ['PORT', 'WORKSPACE_URL', 'PUPPETEER_ARGS']; // per envMap in pod-print/src/config.ts\nconst missing = required.filter((k) => process.env[k] === undefined || process.env[k] === '');\nif (missing.length) {\n  throw new Error(`pod-print missing env vars: ${missing.join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await import('./config');\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Missing config for attributes:')) {\n    console.error(`pod-print config incomplete: ${err.message}`);\n    process.exit(1);\n  }\n  throw err;\n}","preventionTips":["Diff your env against pod-print's example env file; the error lists missing Config keys — map them via envMap.","Provide a comma-separated PUPPETEER_ARGS value (e.g. --no-sandbox,--disable-dev-shm-usage).","Set numeric PORT and the template/workspace URL together.","Fail fast in CI by importing the config module with a test env template."],"tags":["env","configuration","startup","print","puppeteer"],"backgroundTag":"missing-env-var","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}