{"record":{"id":"0b69857801f002f0","repo":"hashicorp/terraform","slug":"error-describing-table-store-s-v","errorCode":null,"errorMessage":"error describing table store %s: %#v","messagePattern":"error describing table store (.+?): %#v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote-state/oss/backend_state.go","lineNumber":49,"sourceCode":"\t\treturn nil, errors.New(\"missing state name\")\n\t}\n\n\tclient := &RemoteClient{\n\t\tossClient:            b.ossClient,\n\t\tbucketName:           b.bucketName,\n\t\tstateFile:            b.stateFile(name),\n\t\tlockFile:             b.lockFile(name),\n\t\tserverSideEncryption: b.serverSideEncryption,\n\t\tacl:                  b.acl,\n\t\totsTable:             b.otsTable,\n\t\totsClient:            b.otsClient,\n\t}\n\tif b.otsEndpoint != \"\" && b.otsTable != \"\" {\n\t\t_, err := b.otsClient.DescribeTable(&tablestore.DescribeTableRequest{\n\t\t\tTableName: b.otsTable,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn client, fmt.Errorf(\"error describing table store %s: %#v\", b.otsTable, err)\n\t\t}\n\t}\n\n\treturn client, nil\n}\n\nfunc (b *Backend) Workspaces() ([]string, tfdiags.Diagnostics) {\n\tvar diags tfdiags.Diagnostics\n\n\tbucket, err := b.ossClient.Bucket(b.bucketName)\n\tif err != nil {\n\t\treturn []string{\"\"}, diags.Append(fmt.Errorf(\"error getting bucket: %#v\", err))\n\t}\n\n\tvar options []oss.Option\n\toptions = append(options, oss.Prefix(b.statePrefix+\"/\"), oss.MaxKeys(1000))\n\tresp, err := bucket.ListObjects(options...)\n\tif err != nil {","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/backend/remote-state/oss/backend_state.go#L31-L67","documentation":"Returned by remoteClient() (backend_state.go:45-49) when both ots_endpoint and tablestore_table are configured and the TableStore DescribeTable call fails. The backend uses OTS for state locking and MD5 digests, so it sanity-checks the table on every workspace/client creation. The %#v dumps the underlying OTS SDK error verbatim.","triggerScenarios":"Calling remoteClient (via StateMgr, Workspaces, DeleteWorkspace) with an ots_table that does not exist on the configured ots_endpoint, or where the caller's credentials lack tablestore:DescribeTable permission. The DescribeTableRequest at line 45 returns a non-nil error.","commonSituations":"tablestore_table typo; table created in a different region/instance than ots_endpoint; OTS instance not yet provisioned; RAM policy missing ReadTableRow/DescribeTable; pointing ots_endpoint at the wrong OTS instance URL.","solutions":["In the OTS console, confirm a table named exactly tablestore_table exists under the ots_endpoint instance.","Verify ots_endpoint region matches the bucket region (e.g. both cn-hangzhou).","Grant the credentials/RAM role tablestore:DescribeTable and tablestore:GetRow/PutRow/DeleteRow on the table.","If you do not need locking, omit ots_endpoint and tablestore_table so the DescribeTable check is skipped."],"exampleFix":"// before\nbackend \"oss\" {\n  bucket = \"tf-state\"\n  ots_endpoint = \"https://tf-state.cn-hangzhou.ots.aliyuncs.com\"\n  tablestore_table = \"terafom_lock\"  // typo\n}\n\n// after\nbackend \"oss\" {\n  bucket = \"tf-state\"\n  ots_endpoint = \"https://tf-state.cn-hangzhou.ots.aliyuncs.com\"\n  tablestore_table = \"terraform_lock\"\n}","handlingStrategy":"validation","validationCode":"// Describe the OTS table yourself before running terraform, to fail fast.\nfunc tableExists(c *tablestore.TableStoreClient, name string) error {\n    _, err := c.DescribeTable(&tablestore.DescribeTableRequest{TableName: name})\n    if err != nil {\n        return fmt.Errorf(\"table %s not describable: %w\", name, err)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"// Catch during init; the error is returned from remoteClient. Re-run only after\n// the table exists - retrying blindly won't help.\nif err := tableExists(otsClient, otsTable); err != nil {\n    return fmt.Errorf(\"pre-flight OTS check failed; create the table first: %w\", err)\n}","preventionTips":["Create the OTS table (single primary key column 'LockID' of string type) in the same region as the bucket.","Keep ots_endpoint region aligned with the OSS bucket region.","Omit ots_endpoint/tablestore_table if you do not need locking."],"tags":["alibaba-cloud","tablestore","ots","remote-state","locking","go"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}