{"record":{"id":"0aedfae9d9a59c34","repo":"anomalyco/sst","slug":"failed-to-get-password-for-mysql-name","errorCode":null,"errorMessage":"Failed to get password for MySQL ${name}.","messagePattern":"Failed to get password for MySQL (.+?)\\.","errorType":"exception","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/mysql.ts","lineNumber":547,"sourceCode":"\n      const input = instance.tagsAll.apply((tags) => {\n        return {\n          proxyId: output(ref.proxyId),\n          passwordTag: tags?.[\"sst:ref:password\"],\n        };\n      });\n\n      const proxy = input.proxyId.apply((proxyId) =>\n        proxyId\n          ? rds.Proxy.get(`${name}Proxy`, proxyId, undefined, {\n              parent: self,\n            })\n          : undefined,\n      );\n\n      const password = input.passwordTag.apply((passwordTag) => {\n        if (!passwordTag)\n          throw new VisibleError(`Failed to get password for MySQL ${name}.`);\n\n        const secret = secretsmanager.getSecretVersionOutput(\n          { secretId: passwordTag },\n          { parent: self },\n        );\n        return $jsonParse(secret.secretString).apply(\n          (v) => v.password as string,\n        );\n      });\n\n      return { instance, proxy, password };\n    }\n\n    function normalizeStorage() {\n      return output(args.storage ?? \"20 GB\").apply((v) => {\n        const size = toGBs(v);\n        if (size < 20) {\n          throw new VisibleError(","sourceCodeStart":529,"sourceCodeEnd":565,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/mysql.ts#L529-L565","documentation":"When referencing an existing MySQL database via sst.aws.MySql.get/ref, SST resolves the database password from Secrets Manager using the resource's password tag. If the passwordTag is absent or unresolvable, SST cannot fetch the password and throws this VisibleError instead of failing deep inside Pulumi.","triggerScenarios":"Calling sst.aws.MySql.get(...) or the ref path for a MySQL component whose underlying RDS-managed secret tag is missing, or whose passwordTag output resolves to undefined at reference time.","commonSituations":"Referencing a MySQL database created by an older SST version without password tagging; the resource was modified in the console so the secret tag was dropped; importing a database created outside SST.","solutions":["Ensure the referenced MySQL resource is the SST-managed component with its password secret intact in Secrets Manager","Re-deploy the original MySQL component so the passwordTag is written, then reference it again","If the DB was created outside SST, create a new sst.aws.MySql component and migrate data instead of referencing it"],"exampleFix":"// before\nconst db = sst.aws.MySql.get(\"db\", { id: existingId });\n// after — reference a component deployed by this SST app so passwordTag exists\nconst db = new sst.aws.MySql(\"MyDb\", { ... });","handlingStrategy":"validation","validationCode":"// Before referencing, confirm the component is SST-managed and secret exists\nconst db = sst.aws.MySql.get(\"db\", { id });\nif (!db.passwordTag) throw new Error(\"Referenced MySQL has no password secret\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only reference MySQL components created and deployed by SST","Never remove or modify the password secret tag in the AWS console","Keep Secrets Manager secrets for the database intact","Check sst output/state if referencing across apps"],"tags":["mysql","aws","secrets-manager","referencing"],"backgroundTag":"missing-secret-password","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}