{"id":"393e0fbc500066cf","repo":"jackc/pgx","slug":"unknown-startup-message-code-d","errorCode":null,"errorMessage":"unknown startup message code: %d","messagePattern":"unknown startup message code: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgproto3/backend.go","lineNumber":165,"sourceCode":"\t\terr = b.sslRequest.Decode(buf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &b.sslRequest, nil\n\tcase cancelRequestCode:\n\t\terr = b.cancelRequest.Decode(buf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &b.cancelRequest, nil\n\tcase gssEncReqNumber:\n\t\terr = b.gssEncRequest.Decode(buf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &b.gssEncRequest, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown startup message code: %d\", code)\n\t}\n}\n\n// Receive receives a message from the frontend. The returned message is only valid until the next call to Receive.\nfunc (b *Backend) Receive() (FrontendMessage, error) {\n\tif !b.partialMsg {\n\t\theader, err := b.cr.Next(5)\n\t\tif err != nil {\n\t\t\treturn nil, translateEOFtoErrUnexpectedEOF(err)\n\t\t}\n\n\t\tb.msgType = header[0]\n\n\t\tmsgLength := int(int32(binary.BigEndian.Uint32(header[1:])))\n\t\tif msgLength < 4 {\n\t\t\treturn nil, fmt.Errorf(\"invalid message length: %d\", msgLength)\n\t\t}\n","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgproto3/backend.go#L147-L183","documentation":"Error \"unknown startup message code: %d\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgproto3/backend.go:165 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}