{"record":{"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":"The frontend received an Authentication message whose auth type code is not in the known set. The %d is the unrecognized code. SCMCreds and SSPI are explicitly unimplemented and also fail here or with their own errors.","triggerScenarios":"Thrown at pgproto3/frontend.go:453 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the server is running a supported PostgreSQL version","Check for proxies or poolers with non-standard auth injection","Note SSPI and SCMCreds are unimplemented in pgx","Report if a modern PostgreSQL version sends this code"],"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"}