{"record":{"id":"8d2662602ee6cb15","repo":"hcengineering/platform","slug":"missing-config-for-attributes-missingenv-join-8d2662","errorCode":null,"errorMessage":"Missing config for attributes: ${missingEnv.join(', ')}","messagePattern":"Missing config for attributes: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"services/sign/pod-sign/src/config.ts","lineNumber":33,"sourceCode":"}\n\nconst parseNumber = (str: string | undefined): number | undefined => (str !== undefined ? Number(str) : undefined)\n\nconst config: Config = (() => {\n  const params: Partial<Config> = {\n    AccountsUrl: process.env.ACCOUNTS_URL,\n    Cert: process.env.CERTIFICATE_PATH !== undefined ? fs.readFileSync(process.env.CERTIFICATE_PATH) : undefined,\n    CertPwd: process.env.CERTIFICATE_PASSWORD ?? '',\n    Port: parseNumber(process.env.PORT) ?? 4006,\n    Secret: process.env.SECRET,\n    ServiceID: process.env.SERVICE_ID,\n    BrandingPath: process.env.BRANDING_PATH ?? ''\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":15,"sourceCodeEnd":40,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/services/sign/pod-sign/src/config.ts#L15-L40","documentation":"The pod-sign service config is built inside a module IIFE and throws when any Config field is undefined after reading env variables. The message lists the missing attribute names (Config keys), failing fast at first import.","triggerScenarios":"Launching pod-sign without all signing env variables set. Note BrandingPath has a '' default so it never triggers; only keys without a ?? fallback produce undefined.","commonSituations":"Missing entries in pod manifests or docker env, .env not loaded locally, typo'd env names, or new required config added by an upgrade.","solutions":["Set the listed env variables in the service deployment and restart.","Cross-check keys in services/sign/pod-sign/src/config.ts against your environment.","Provide safe defaults via ?? for genuinely optional settings.","Remember config runs at import — a missing var crashes the pod immediately; check pod logs for which attribute is missing."],"exampleFix":"// before\n# SIGN_KEY unset -> throws\n// after\nSIGN_KEY=MIIE...\nSERVICE_ENDPOINT=https://sign.example.com","handlingStrategy":"validation","validationCode":"const keys = ['SIGN_KEY', 'SERVICE_ENDPOINT'] // all Config keys without ?? fallback in config.ts\nconst missing = keys.filter((k) => process.env[k] === undefined)\nif (missing.length > 0) throw new Error(`pod-sign missing env: ${missing.join(', ')}`)","typeGuard":null,"tryCatchPattern":"try {\n  await import('./config.js')\n} catch (err) {\n  if (err.message.startsWith('Missing config for attributes:')) {\n    console.error('pod-sign startup config incomplete:', err.message)\n    process.exit(1)\n  }\n  throw err\n}","preventionTips":["Keep a pod-sign .env.example in sync with Config keys.","Set signing credentials via k8s secrets, not shell env only.","Give optional keys (like BRANDING_PATH) explicit ?? defaults.","Fail fast in CI by importing config in a smoke test."],"tags":["config","environment","startup","e-signature"],"backgroundTag":"missing-env-var","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}