hcengineering/platform · error · Error
Missing config for attributes: ${missingEnv.join(', ')}
Error message
Missing config for attributes: ${missingEnv.join(', ')} What it means
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.
Source
Thrown at services/print/pod-print/src/config.ts:36
const parseNumber = (str: string | undefined): number | undefined => (str !== undefined ? Number(str) : undefined)
const config: Config = (() => {
const allowedHostnames = process.env.ALLOWED_HOSTNAMES
const puppeteerArgs = process.env.PUPPETEER_ARGS ?? ''
const params: Partial<Config> = {
Port: parseNumber(process.env.PORT) ?? 4005,
Secret: process.env.SECRET,
AccountsUrl: process.env.ACCOUNTS_URL,
FrontUrl: process.env.FRONT_URL,
AllowedHostnames: allowedHostnames == null ? [] : allowedHostnames.split(','),
PuppeteerArgs: puppeteerArgs.split(',')
}
const missingEnv = (Object.keys(params) as Array<keyof Config>).filter((key) => params[key] === undefined)
if (missingEnv.length > 0) {
throw Error(`Missing config for attributes: ${missingEnv.join(', ')}`)
}
return params as Config
})()
export default config
View on GitHub (pinned to 63e28dc964)
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.
Example fix
// before # only port provided PORT=4010 // after PORT=4010 WORKSPACE_URL=https://transactor.example.com PUPPETEER_ARGS=--no-sandbox,--disable-dev-shm-usage
Defensive patterns
Strategy: validation
Validate before calling
// Check the keys pod-print assembles into params before startup
const required = ['PORT', 'WORKSPACE_URL', 'PUPPETEER_ARGS']; // per envMap in pod-print/src/config.ts
const missing = required.filter((k) => process.env[k] === undefined || process.env[k] === '');
if (missing.length) {
throw new Error(`pod-print missing env vars: ${missing.join(', ')}`);
} Try / catch
try {
await import('./config');
} catch (err) {
if (err instanceof Error && err.message.startsWith('Missing config for attributes:')) {
console.error(`pod-print config incomplete: ${err.message}`);
process.exit(1);
}
throw err;
} Prevention
- 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.
When it happens
Trigger: 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).
Common situations: 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.
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
- MAIL_URL env var is not set
- Missing env variables for SES configuration: ${missingKeys.j
- Missing env variables for SMTP configuration: ${missingKeys.
- Missing env variable: Port
- Please specify SES or SMTP configuration
AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29).
Data as JSON: /api/errors/a2f938e77e13dc1c.
Report an issue: GitHub.