{"record":{"id":"ace4c632cb970b14","repo":"hashicorp/terraform","slug":"s-s","errorCode":null,"errorMessage":"%s: %s","messagePattern":"%s: %s","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/meta_config.go","lineNumber":403,"sourceCode":"\tfor name, attrS := range schema.Attributes {\n\t\tif attrS.Required && retVals[name].IsNull() && attrS.Type.IsPrimitiveType() {\n\t\t\tnames = append(names, name)\n\t\t}\n\t}\n\tsort.Strings(names)\n\n\tinput := m.UIInput()\n\tfor _, name := range names {\n\t\tattrS := schema.Attributes[name]\n\n\t\tfor {\n\t\t\tstrVal, err := input.Input(context.Background(), &terraform.InputOpts{\n\t\t\t\tId:          name,\n\t\t\t\tQuery:       name,\n\t\t\t\tDescription: attrS.Description,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn cty.UnknownVal(schema.ImpliedType()), fmt.Errorf(\"%s: %s\", name, err)\n\t\t\t}\n\n\t\t\tval := cty.StringVal(strVal)\n\t\t\tval, err = convert.Convert(val, attrS.Type)\n\t\t\tif err != nil {\n\t\t\t\tm.showDiagnostics(fmt.Errorf(\"Invalid value: %s\", err))\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tretVals[name] = val\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn cty.ObjectVal(retVals), nil\n}\n\n// configSources returns the source cache from the receiver's config loader,","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/command/meta_config.go#L385-L421","documentation":"Raised in inputForSchema when an interactive prompt for a required provider/backend attribute fails to read a value. The message is formatted as 'attrName: underlyingError'. inputForSchema walks schema.Attributes for Required+null+primitive attributes and prompts for each; an I/O failure reading the answer produces this.","triggerScenarios":"inputForSchema: input.Input(...) returns err!=nil for some required attribute name. Reached during backend/provider config init when required attributes are unset and interactive input is attempted but the reader fails (closed stdin, no TTY).","commonSituations":"CI/automation running init without -input=false where a required backend attribute is missing; closed stdin during an interactive backend config; terminal disconnect mid-prompt.","solutions":["Supply all required attributes explicitly in the config so no prompt is needed.","Run with -input=false to fail fast with a clear 'missing required attribute' diagnostic instead of an I/O error.","Keep stdin open / allocate a TTY for interactive runs.","Validate the backend block has all required keys before running init."],"exampleFix":"// before\n// backend \"s3\" block missing 'bucket', init prompts with closed stdin\n\n// after\n// fill required attrs in config:\nbackend \"s3\" { bucket = \"my-bucket\" region = \"us-east-1\" key = \"tfstate\" }","handlingStrategy":"validation","validationCode":"// Provide all required backend/provider attributes in config so no prompt\n// is needed. Validate required keys before init.\nrequired := []string{\"bucket\", \"region\", \"key\"}\nfor _, k := range required {\n    if !backendBlock.HasAttribute(k) {\n        return fmt.Errorf(\"missing required backend attribute %s\", k)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fill all required attributes in the backend/provider config blocks.","Run init with -input=false to get clear 'missing attribute' errors instead of I/O errors.","Validate the config (terraform validate) before init.","Keep stdin open if relying on interactive attribute entry."],"tags":["terraform","init","interactive-input","schema","backend-config"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}