{"id":"83835967982c9a1f","repo":"jackc/pgx","slug":"pipeline-s-received-unexpected-message-type-t","errorCode":null,"errorMessage":"pipeline: %s: received unexpected message type %T","messagePattern":"pipeline: (.+?): received unexpected message type %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgconn/pgconn.go","lineNumber":2934,"sourceCode":"\tfor {\n\t\tmsg, err := p.conn.receiveMessage()\n\t\tif err != nil {\n\t\t\tp.err = err\n\t\t\tp.conn.asyncClose()\n\t\t\treturn nil, normalizeTimeoutError(p.ctx, err)\n\t\t}\n\n\t\tswitch msg := msg.(type) {\n\t\tcase *pgproto3.ParameterStatus, *pgproto3.NoticeResponse, *pgproto3.NotificationResponse:\n\t\t\t// Filter these message types out in pipeline mode. The normal processing is handled by PgConn.receiveMessage.\n\t\tdefault:\n\t\t\treturn msg, nil\n\t\t}\n\t}\n}\n\nfunc (p *Pipeline) handleUnexpectedMessage(errStr string, msg pgproto3.BackendMessage) error {\n\tp.err = fmt.Errorf(\"pipeline: %s: received unexpected message type %T\", errStr, msg)\n\tp.conn.asyncClose()\n\treturn p.err\n}\n\n// Close closes the pipeline and returns the connection to normal mode.\nfunc (p *Pipeline) Close() error {\n\tif p.closed {\n\t\treturn p.err\n\t}\n\n\tp.closed = true\n\n\tif p.state.PendingSync() {\n\t\tp.conn.asyncClose()\n\t\tp.err = errors.New(\"pipeline has unsynced requests\")\n\t\tp.conn.contextWatcher.Unwatch()\n\t\tp.conn.unlock()\n","sourceCodeStart":2916,"sourceCodeEnd":2952,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgconn/pgconn.go#L2916-L2952","documentation":"Error \"pipeline: %s: received unexpected message type %T\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgconn/pgconn.go:2934 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","schemaVersion":2}