anomalyco/sst · error · VisibleError
You must provide the password to connect to your locally run
Error message
You must provide the password to connect to your locally running OpenSearch domain either by setting the "dev.password" or by setting the top-level "password" property.
What it means
In `$dev` mode SST runs OpenSearch locally and the local instance requires a password. When neither `dev.password` nor the top-level `password` is provided, SST cannot configure the local connection and throws this VisibleError at component registration time.
Source
Thrown at platform/src/components/aws/open-search.ts:367
const size = toGBs(v);
if (size < 10) {
throw new VisibleError(
`Storage must be at least 10 GB for the ${name} OpenSearch domain.`,
);
}
return size;
});
}
function registerDev() {
if (!args.dev) return undefined;
if (
$dev &&
args.dev.password === undefined &&
args.password === undefined
) {
throw new VisibleError(
`You must provide the password to connect to your locally running OpenSearch domain either by setting the "dev.password" or by setting the top-level "password" property.`,
);
}
const dev = {
enabled: $dev,
url: output(args.dev.url ?? "http://localhost:9200"),
username: args.dev.username ? output(args.dev.username) : username,
password: output(args.dev.password ?? args.password ?? ""),
};
new DevCommand(`${name}Dev`, {
dev: {
title: name,
autostart: true,
command: `sst print-and-not-quit`,
},
environment: {View on GitHub (pinned to a0bd20f762)
Solutions
- Add `dev: { password: "password" }` to the OpenSearch args
- Or set the top-level `password` property, which is used for both dev and production
- Or load it from config/env so it isn't hardcoded
Example fix
// before
new sst.aws.OpenSearch("MySearch", {});
// after
new sst.aws.OpenSearch("MySearch", {
dev: { password: "password" }
}); Defensive patterns
Strategy: validation
Validate before calling
if ($dev && args.dev?.password === undefined && args.password === undefined) {
throw new Error("Provide dev.password or password for local OpenSearch");
} Type guard
function hasDevPassword(args: { dev?: { password?: string }, password?: string }): boolean {
return args.dev?.password !== undefined || args.password !== undefined;
} Try / catch
try {
new sst.aws.OpenSearch("MySearch", openSearchArgs);
} catch (e) {
if (String(e).includes("dev.password")) {
console.error("Add dev.password (or top-level password) to your OpenSearch args for `sst dev`");
}
throw e;
} Prevention
- Always set `dev: { password }` when a component supports $dev mode
- Set the top-level password once and reuse it for dev and prod
- Store the dev password in .env (loaded into sst.config.ts) rather than hardcoding
When it happens
Trigger: Declaring an sst.aws.OpenSearch component inside `if ($dev)` (or with dev enabled) while passing neither args.dev.password nor args.password during `sst dev`.
Common situations: Running `sst dev` for the first time after copying a production config that omits dev settings; team members lacking a local .env with the dev password.
Understand the failure class
Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.
Related errors
- You must provide the password to connect to your locally run
- You must provide the password to connect to your locally run
- You must provide the password to connect to your locally run
- Invalid function definition for the "${name}" Function
- The provided ARN "${arn}" is not a OpenSearch domain ARN.
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/c8c137d35f4d84d9.
Report an issue: GitHub.