{"record":{"id":"24857e54f4c39a7e","repo":"hashicorp/terraform","slug":"destroy-discarded","errorCode":null,"errorMessage":"Destroy discarded.","messagePattern":"Destroy discarded\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote/backend_common.go","lineNumber":27,"sourceCode":"\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\ttfe \"github.com/hashicorp/go-tfe\"\n\n\t\"github.com/hashicorp/terraform/internal/backend/backendrun\"\n\t\"github.com/hashicorp/terraform/internal/logging\"\n\t\"github.com/hashicorp/terraform/internal/plans\"\n\t\"github.com/hashicorp/terraform/internal/terraform\"\n)\n\nvar (\n\terrApplyDiscarded   = errors.New(\"Apply discarded.\")\n\terrDestroyDiscarded = errors.New(\"Destroy discarded.\")\n\terrRunApproved      = errors.New(\"approved using the UI or API\")\n\terrRunDiscarded     = errors.New(\"discarded using the UI or API\")\n\terrRunOverridden    = errors.New(\"overridden using the UI or API\")\n)\n\nvar (\n\tbackoffMin = 1000.0\n\tbackoffMax = 3000.0\n\n\trunPollInterval = 3 * time.Second\n)\n\n// backoff will perform exponential backoff based on the iteration and\n// limited by the provided min and max (in milliseconds) durations.\nfunc backoff(min, max float64, iter int) time.Duration {\n\tbackoff := math.Pow(2, float64(iter)/5) * min\n\tif backoff > max {\n\t\tbackoff = max","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/backend/remote/backend_common.go#L9-L45","documentation":"An Attribute must define exactly one shape for its value: either a primitive/collection Type, or a NestedType (structural object). When both Type is cty.NilType and NestedType is nil, the attribute has no type at all and cannot hold a value, so validation fails.","triggerScenarios":"An Attribute literal omitting both Type and NestedType. Guard at internal_validate.go:159 is `a.Type == cty.NilType && a.NestedType == nil`.","commonSituations":"Authoring an attribute and forgetting the type; refactoring that clears Type while a NestedType branch is also not set; copy-paste of a stub attribute.","solutions":["Set Type to a concrete cty type (e.g. cty.String, cty.List(cty.Number)).","Alternatively set NestedType to a *configschema.Object for a structural attribute.","Ensure not both are set simultaneously (that triggers a separate Type-and-NestedType conflict)."],"exampleFix":"// before\n\"name\": { Optional: true },\n// after\n\"name\": { Type: cty.String, Optional: true },","handlingStrategy":"validation","validationCode":"// Require exactly one of Type or NestedType.\nfunc hasTypeOrNestedType(a *configschema.Attribute) bool {\n    return a != nil && (a.Type != cty.NilType || a.NestedType != nil)\n}","typeGuard":"func exactlyOneShape(t cty.Type, nt *configschema.Object) bool {\n    return (t != cty.NilType) != (nt != nil)\n}","tryCatchPattern":null,"preventionTips":["Always set either Type or NestedType on every attribute.","Never set both simultaneously (it triggers the Type/NestedType conflict error).","Validate schemas with InternalValidate in CI to catch missing types."],"tags":["schema-validation","configschema","attribute","cty","type","nestedtype","provider-schema"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}