{"record":{"id":"5bbb4d3d938eaf00","repo":"anomalyco/sst","slug":"you-must-provide-the-password-to-connect-to-your-l-5bbb4d","errorCode":null,"errorMessage":"You must provide the password to connect to your locally running Postgres database either by setting the \"dev.password\" or by setting the top-level \"password\" property.","messagePattern":"You must provide the password to connect to your locally running Postgres database either by setting the \"dev\\.password\" or by setting the top-level \"password\" property\\.","errorType":"exception","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/postgres.ts","lineNumber":634,"sourceCode":"      if (args.vpc instanceof Vpc) {\n        return {\n          subnets: args.vpc.privateSubnets,\n        };\n      }\n\n      // \"vpc\" is object\n      return output(args.vpc);\n    }\n\n    function registerDev() {\n      if (!args.dev) return undefined;\n\n      if (\n        $dev &&\n        args.dev.password === undefined &&\n        args.password === undefined\n      ) {\n        throw new VisibleError(\n          `You must provide the password to connect to your locally running Postgres database either by setting the \"dev.password\" or by setting the top-level \"password\" property.`,\n        );\n      }\n\n      const dev = {\n        enabled: $dev,\n        host: output(args.dev.host ?? \"localhost\"),\n        port: output(args.dev.port ?? 5432),\n        username: args.dev.username ? output(args.dev.username) : username,\n        password: output(args.dev.password ?? args.password ?? \"\"),\n        database: args.dev.database ? output(args.dev.database) : dbName,\n      };\n\n      new DevCommand(`${name}Dev`, {\n        dev: {\n          title: name,\n          autostart: true,\n          command: `sst print-and-not-quit`,","sourceCodeStart":616,"sourceCodeEnd":652,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/postgres.ts#L616-L652","documentation":"When a Postgres component runs in dev mode ($dev is true), SST connects to a locally running Postgres via RDS Proxy, which requires the database password. The password must be supplied either as args.dev.password or as the top-level args.password; if neither is set, the component throws this VisibleError during registerDev.","triggerScenarios":"Declaring a Postgres component with dev: true (or running `sst dev --mode=basic` with dev enabled) while both args.dev.password and args.password are undefined.","commonSituations":"Developers enabling dev mode on an existing Postgres component that only relied on RDS-managed master credentials; migrating from prod-only config to `sst dev`; forgetting to pass password in the dev block.","solutions":["Set the password in the dev block: dev: { password: \"...\" }","Or set the top-level password property on the Postgres component args","Move the existing prod password into shared args so both paths use it"],"exampleFix":"// before\nnew sst.aws.Postgres(\"MyDb\", { dev: true });\n// after\nnew sst.aws.Postgres(\"MyDb\", {\n  dev: { password: \"local-password\" },\n  password: \"prod-password\",\n});","handlingStrategy":"validation","validationCode":"const devEnabled = args.dev !== undefined;\nif (devEnabled && args.dev?.password === undefined && args.password === undefined) {\n  throw new Error(\"Provide dev.password or password for Postgres dev mode\");\n}","typeGuard":"function hasDevPassword(args: sst.aws.PostgresArgs): boolean {\n  return args.password !== undefined || args.dev?.password !== undefined;\n}","tryCatchPattern":"try {\n  const db = new sst.aws.Postgres(\"Db\", args);\n} catch (e) {\n  if (String(e).includes(\"password\")) console.error(\"Set dev.password or password for dev mode\");\n  throw e;\n}","preventionTips":["Always include a password when enabling dev: true","Define password once in shared args and reuse for dev","Run sst diff/deploy locally to catch config errors before CI"],"tags":["postgres","dev-mode","configuration","missing-password"],"backgroundTag":"missing-required-config","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}