{"id":"648f808fab779354","repo":"jackc/pgx","slug":"unknown-authentication-type-d","errorCode":null,"errorMessage":"unknown authentication type: %d","messagePattern":"unknown authentication type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgproto3/frontend.go","lineNumber":453,"sourceCode":"\t\treturn &f.authenticationCleartextPassword, nil\n\tcase AuthTypeMD5Password:\n\t\treturn &f.authenticationMD5Password, nil\n\tcase AuthTypeSCMCreds:\n\t\treturn nil, errors.New(\"AuthTypeSCMCreds is unimplemented\")\n\tcase AuthTypeGSS:\n\t\treturn &f.authenticationGSS, nil\n\tcase AuthTypeGSSCont:\n\t\treturn &f.authenticationGSSContinue, nil\n\tcase AuthTypeSSPI:\n\t\treturn nil, errors.New(\"AuthTypeSSPI is unimplemented\")\n\tcase AuthTypeSASL:\n\t\treturn &f.authenticationSASL, nil\n\tcase AuthTypeSASLContinue:\n\t\treturn &f.authenticationSASLContinue, nil\n\tcase AuthTypeSASLFinal:\n\t\treturn &f.authenticationSASLFinal, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown authentication type: %d\", f.authType)\n\t}\n}\n\n// GetAuthType returns the authType used in the current state of the frontend.\n// See SetAuthType for more information.\nfunc (f *Frontend) GetAuthType() uint32 {\n\treturn f.authType\n}\n\nfunc (f *Frontend) ReadBufferLen() int {\n\treturn f.cr.wp - f.cr.rp\n}\n\n// SetMaxBodyLen sets the maximum length of a message body in octets.\n// If a message body exceeds this length, Receive will return an error.\n// This is useful for protecting against a corrupted server that sends\n// messages with incorrect length, which can cause memory exhaustion.\n// The default value is 0.","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgproto3/frontend.go#L435-L471","documentation":"Error \"unknown authentication type: %d\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgproto3/frontend.go:453 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}