{"record":{"id":"9efa8ba86fc90e3b","repo":"hcengineering/platform","slug":"missing-config-for-attributes-missingenv-join-9efa8b","errorCode":null,"errorMessage":"Missing config for attributes: ${missingEnv.join(', ')}","messagePattern":"Missing config for attributes: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"services/payment/pod-payment/src/config.ts","lineNumber":63,"sourceCode":"    Secret: process.env.SECRET,\n    AccountsUrl: process.env.ACCOUNTS_URL,\n    FrontUrl: process.env.FRONT_URL,\n    UseSandbox: process.env.USE_SANDBOX === 'true',\n    PolarAccessToken: process.env.POLAR_ACCESS_TOKEN,\n    PolarWebhookSecret: process.env.POLAR_WEBHOOK_SECRET,\n    PolarOrganizationId: process.env.POLAR_ORGANIZATION_ID,\n    PolarSubscriptionPlans: process.env.POLAR_SUBSCRIPTION_PLANS,\n    StripeApiKey: process.env.STRIPE_API_KEY,\n    StripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET,\n    StripeSubscriptionPlans: process.env.STRIPE_SUBSCRIPTION_PLANS,\n    ReconciliationIntervalMinutes: parseNumber(process.env.RECONCILIATION_INTERVAL_MINUTES)\n  }\n\n  const requiredKeys: Array<keyof Config> = ['Port', 'Secret', 'AccountsUrl', 'FrontUrl']\n  const missingEnv = requiredKeys.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":45,"sourceCodeEnd":70,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/services/payment/pod-payment/src/config.ts#L45-L70","documentation":"pod-payment's config IIFE requires Port, Secret, AccountsUrl, and FrontUrl to be defined. It lists the raw Config keys (not env names) in the thrown error when any is undefined.","triggerScenarios":"Starting pod-payment with any of the four required env vars unset: Port, Secret, AccountsUrl, or FrontUrl.","commonSituations":"Forgetting the payment-front URL (FrontUrl) when wiring services; missing the shared Secret used for inter-service auth; new deployments where the accounts service URL changed and AccountsUrl was dropped; partial secret mounts.","solutions":["Set Port, Secret, AccountsUrl, and FrontUrl in the environment (map each key to its env var name via envMap in pod-payment/src/config.ts).","Use the error message — it names exactly which keys are missing.","Verify AccountsUrl points at the running accounts service and FrontUrl at the payment front-end.","Check that any secret providing 'Secret' is mounted and referenced in the deployment."],"exampleFix":"// before\nPORT=4009\nACCOUNTS_URL=http://accounts:3333\n// after\nPORT=4009\nSECRET=shared-service-secret\nACCOUNTS_URL=http://accounts:3333\nFRONT_URL=https://payment.example.com","handlingStrategy":"validation","validationCode":"const required = ['PORT', 'SECRET', 'ACCOUNTS_URL', 'FRONT_URL'];\nconst missing = required.filter((k) => process.env[k] === undefined || process.env[k] === '');\nif (missing.length) {\n  throw new Error(`pod-payment 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-payment config incomplete: ${err.message}`);\n    process.exit(1);\n  }\n  throw err;\n}","preventionTips":["Treat Port, Secret, AccountsUrl, FrontUrl as a single required set in deployment templates.","Keep the inter-service Secret in a dedicated secret, not a shared env file that may be partially applied.","Validate URLs are present and well-formed before startup.","Diff production env against .env.example per release."],"tags":["env","configuration","startup","payment"],"backgroundTag":"missing-env-var","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}