{"record":{"id":"1907eb9d4bf12c35","repo":"hasura/graphql-engine","slug":"invalid-result-type-s","errorCode":null,"errorMessage":"invalid result Type %s","messagePattern":"invalid result Type (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/internal/statestore/migrations/hdbtable.go","lineNumber":130,"sourceCode":"\n\treturn nil\n}\n\nfunc (m *MigrationStateStoreHdbTable) PrepareMigrationsStateStore(sourceName string) error {\n\tvar op errors.Op = \"migrations.MigrationStateStoreHdbTable.PrepareMigrationsStateStore\"\n\t// check if migration table exists\n\tquery := hasura.PGRunSQLInput{\n\t\tSource: sourceName,\n\t\tSQL:    `SELECT COUNT(1) FROM information_schema.tables WHERE table_name = '` + m.table + `' AND table_schema = '` + m.schema + `' LIMIT 1`,\n\t}\n\n\trunsqlResp, err := m.client.PGRunSQL(query)\n\tif err != nil {\n\t\treturn errors.E(op, err)\n\t}\n\n\tif runsqlResp.ResultType != hasura.TuplesOK {\n\t\treturn errors.E(op, fmt.Errorf(\"invalid result Type %s\", runsqlResp.ResultType))\n\t}\n\n\tresult := runsqlResp.Result\n\tif result[1][0] != \"0\" {\n\t\treturn nil\n\t}\n\n\t// Now Create the table\n\tquery = hasura.PGRunSQLInput{\n\t\tSource: sourceName,\n\t\tSQL: `CREATE TABLE ` + fmt.Sprintf(\n\t\t\t\"%s.%s\",\n\t\t\tm.schema,\n\t\t\tm.table,\n\t\t) + ` (version bigint not null primary key, dirty boolean not null)`,\n\t}\n\n\trunsqlResp, err = m.client.PGRunSQL(query)","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/internal/statestore/migrations/hdbtable.go#L112-L148","documentation":"MigrationStateStoreHdbTable.PrepareMigrationsStateStore ran its SQL via PGRunSQL and expected a TuplesOK result (rows), but the server returned a different result type — meaning the state-store table inspection query did not return tuples as expected.","triggerScenarios":"Preparing the hdb-table based migration state store when the server's response to the catalog query is not TuplesOK: server version mismatch returning an error payload, unexpected SQL behavior, or a proxy/permission layer altering responses.","commonSituations":"Pointing the CLI at an incompatible Hasura version or a non-Postgres data source, or a restricted role blocking hdb_catalog reads so the query returns a command/error type instead of tuples.","solutions":["Verify the CLI and Hasura server versions are compatible (same major release line)","Check the configured admin secret/role can read hdb_catalog","Look at server logs for the failing SQL and re-run the query manually to see the result type","Reconnect directly to the server (no proxy) and retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := store.PrepareMigrationsStateStore(); err != nil {\n    if strings.Contains(err.Error(), \"invalid result Type\") { /* check server logs, version compat, privileges; retry */ }\n}","preventionTips":["Match CLI and server major versions","Verify the role can read hdb_catalog"],"tags":["database","hasura-server","sql-result","state-store"],"backgroundTag":"unexpected-sql-result-type","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}