{"record":{"id":"3329deff1de5df34","repo":"hashicorp/terraform","slug":"invalid-md5","errorCode":null,"errorMessage":"invalid md5","messagePattern":"invalid md5","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote-state/oss/client.go","lineNumber":247,"sourceCode":"\n\tlog.Printf(\"[DEBUG] Retrieving state serial in tablestore: %#v\", getParams)\n\n\tobject, err := c.otsClient.GetRow(&tablestore.GetRowRequest{\n\t\tSingleRowQueryCriteria: getParams,\n\t})\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar val string\n\tif v, ok := object.GetColumnMap().Columns[\"Digest\"]; ok && len(v) > 0 {\n\t\tval = v[0].Value.(string)\n\t}\n\n\tsum, err := hex.DecodeString(val)\n\tif err != nil || len(sum) != md5.Size {\n\t\treturn nil, errors.New(\"invalid md5\")\n\t}\n\n\treturn sum, nil\n}\n\n// store the hash of the state to that clients can check for stale state files.\nfunc (c *RemoteClient) putMD5(sum []byte) error {\n\tif c.otsTable == \"\" {\n\t\treturn nil\n\t}\n\n\tif len(sum) != md5.Size {\n\t\treturn errors.New(\"invalid payload md5\")\n\t}\n\n\tputParams := &tablestore.PutRowChange{\n\t\tTableName: c.otsTable,\n\t\tPrimaryKey: &tablestore.PrimaryKey{","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/backend/remote-state/oss/client.go#L229-L265","documentation":"An Attribute must declare at least one of Optional, Required, or Computed — otherwise Terraform cannot decide whether the value comes from config, the provider, or both. The validator treats an attribute with all three false as ill-defined.","triggerScenarios":"An Attribute literal that sets Type but omits Optional/Required/Computed. Guard at internal_validate.go:146 is `!a.Optional && !a.Required && !a.Computed`.","commonSituations":"Forgetting the behavior flags when focusing on the type; schema codegen that emits the type only; copy-paste that drops the flags.","solutions":["Mark the attribute Optional if the user may set it (optionally overridden by the provider).","Mark it Required if the user must set it.","Mark it Computed if only the provider supplies it (typically also Optional to allow overrides)."],"exampleFix":"// before\n\"name\": { Type: cty.String },\n// after\n\"name\": { Type: cty.String, Optional: true, Computed: true },","handlingStrategy":"validation","validationCode":"// Require at least one of Optional, Required, Computed.\nfunc hasBehaviorFlag(a *configschema.Attribute) bool {\n    return a != nil && (a.Optional || a.Required || a.Computed)\n}","typeGuard":"func hasAtLeastOneBehavior(optional, required, computed bool) bool {\n    return optional || required || computed\n}","tryCatchPattern":null,"preventionTips":["Always set at least one behavior flag when authoring an attribute.","Use Optional+Computed for provider-overridable defaults.","Lint schemas to reject behavior-less attributes."],"tags":["schema-validation","configschema","attribute","optional","required","computed","provider-schema"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}