{"record":{"id":"214b5ac9be0634e0","repo":"docker/compose","slug":"required-parameter-q-is-missing-from-provider-q","errorCode":null,"errorMessage":"required parameter %q is missing from provider %q definition","messagePattern":"required parameter %q is missing from provider %q definition","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compose/plugins.go","lineNumber":317,"sourceCode":"\tRequired    bool   `json:\"required\"`\n\tType        string `json:\"type\"`\n\tDefault     string `json:\"default,omitempty\"`\n}\n\nfunc (c CommandMetadata) GetParameter(paramName string) (ParameterMetadata, bool) {\n\tfor _, p := range c.Parameters {\n\t\tif p.Name == paramName {\n\t\t\treturn p, true\n\t\t}\n\t}\n\treturn ParameterMetadata{}, false\n}\n\nfunc (c CommandMetadata) CheckRequiredParameters(provider types.ServiceProviderConfig) error {\n\tfor _, p := range c.Parameters {\n\t\tif p.Required {\n\t\t\tif _, ok := provider.Options[p.Name]; !ok {\n\t\t\t\treturn fmt.Errorf(\"required parameter %q is missing from provider %q definition\", p.Name, provider.Type)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// firstLine returns the first line of s, stripping any trailing newlines.\nfunc firstLine(s string) string {\n\ts = strings.TrimRight(s, \"\\n\")\n\tif before, _, ok := strings.Cut(s, \"\\n\"); ok {\n\t\treturn before\n\t}\n\treturn s\n}\n","sourceCodeStart":299,"sourceCodeEnd":332,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/plugins.go#L299-L332","documentation":"Before invoking a service provider plugin, compose validates the provider's options against the command's parameter metadata. Any parameter marked Required must appear in the provider definition's options map; the first missing one aborts with its name and the provider type.","triggerScenarios":"Declaring a service with provider: type X but omitting an option that X's metadata marks required — e.g. a database provider demanding 'password' — then running docker compose up.","commonSituations":"Copy-pasted provider examples with placeholders removed; providers whose required set grew in a new version; assuming defaults exist for required parameters.","solutions":["Read the provider's parameter list (docker compose provider docs or plugin metadata) to find required options","Add the missing option under the provider's options in the compose file","After adding, re-run docker compose config to confirm validation passes"],"exampleFix":"# before\nservices:\n  db:\n    provider:\n      type: nebius-postgres\n\n# after\nservices:\n  db:\n    provider:\n      type: nebius-postgres\n      options:\n        username: admin\n        password: {{ env_required(\"DB_PASSWORD\") }}","handlingStrategy":"validation","validationCode":"// before up: run config validation which exercises CheckRequiredParameters\nif err := project.Validate(os.Getenv); err != nil {\n    return err // names the missing required parameter\n}","typeGuard":null,"tryCatchPattern":"if err := compose.Up(ctx, project, opts); err != nil {\n    if strings.Contains(err.Error(), \"required parameter\") {\n        // parse parameter name from message and add it to provider options\n    }\n}","preventionTips":["Run docker compose config as a CI gate for every compose file using providers","Document required provider options next to each provider type in your repo"],"tags":["plugins","provider","validation","compose-file"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}