{"id":"919f52a8d788a5cb","repo":"jackc/pgx","slug":"unable-to-find-service-v","errorCode":null,"errorMessage":"unable to find service: %v","messagePattern":"unable to find service: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgconn/config.go","lineNumber":793,"sourceCode":"\n\t\tif key == \"user\" && val == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tsettings[key] = val\n\t}\n\n\treturn settings, nil\n}\n\nfunc parseServiceSettings(servicefilePath, serviceName string) (map[string]string, error) {\n\tservicefile, err := pgservicefile.ReadServicefile(servicefilePath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read service file: %v\", servicefilePath)\n\t}\n\n\tservice, err := servicefile.GetService(serviceName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to find service: %v\", serviceName)\n\t}\n\n\tsettings := make(map[string]string, len(service.Settings))\n\tfor k, v := range service.Settings {\n\t\tsettings[canonicalConnStringKey(k)] = v\n\t}\n\n\treturn settings, nil\n}\n\n// configTLS uses libpq's TLS parameters to construct  []*tls.Config. It is\n// necessary to allow returning multiple TLS configs as sslmode \"allow\" and\n// \"prefer\" allow fallback.\nfunc configTLS(settings map[string]string, thisHost string, parseConfigOptions ParseConfigOptions) ([]*tls.Config, error) {\n\thost := thisHost\n\tsslmode := settings[\"sslmode\"]\n\tsslrootcert := settings[\"sslrootcert\"]\n\tsslcert := settings[\"sslcert\"]","sourceCodeStart":775,"sourceCodeEnd":811,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgconn/config.go#L775-L811","documentation":"Error \"unable to find service: %v\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgconn/config.go:793 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}