{"record":{"id":"b7bd3b393669e4a8","repo":"jackc/pgx","slug":"expected-sync-got-t","errorCode":null,"errorMessage":"expected sync, got %T","messagePattern":"expected sync, got %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"conn.go","lineNumber":1222,"sourceCode":"\n\t\t\t\tresultSD, ok := results.(*pgconn.StatementDescription)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"expected statement description, got %T\", results)\n\t\t\t\t}\n\n\t\t\t\t// Fill in the previously empty / pending statement descriptions.\n\t\t\t\tsd.ParamOIDs = resultSD.ParamOIDs\n\t\t\t\tsd.Fields = resultSD.Fields\n\t\t\t}\n\n\t\t\tresults, err := pipeline.GetResults()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t_, ok := results.(*pgconn.PipelineSync)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"expected sync, got %T\", results)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t}()\n\t\tif err != nil {\n\t\t\treturn &pipelineBatchResults{ctx: ctx, conn: c, err: err, closed: true}\n\t\t}\n\t}\n\n\t// Queue the queries.\n\tfor _, bi := range b.QueuedQueries {\n\t\terr := c.eqb.Build(c.typeMap, bi.sd, bi.Arguments)\n\t\tif err != nil {\n\t\t\terr = newErrPreprocessingBatch(\"build\", bi.SQL, err)\n\t\t\treturn &pipelineBatchResults{ctx: ctx, conn: c, err: err, closed: true}\n\t\t}\n\n\t\tif bi.sd.Name == \"\" {","sourceCodeStart":1204,"sourceCodeEnd":1240,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/conn.go#L1204-L1240","documentation":"After sending batch prepares and a Sync, the pipeline result consumed was not the expected *pgconn.PipelineSync message. The server responded out of order or with an unexpected message, indicating protocol desynchronization in the batch preprocessing pipeline.","triggerScenarios":"Thrown at conn.go:1222 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the %T value to see which message arrived instead of the Sync acknowledgment","Verify the batch did not interleave unsupported operations before Sync","Report as a bug with a reproducing batch if the server is a supported PostgreSQL version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}