{"record":{"id":"136087077eb5c5bf","repo":"googleapis/mcp-toolbox","slug":"invalid-iptype-s-must-be-one-of-public-priva","errorCode":null,"errorMessage":"invalid ipType %s. Must be one of `public`, `private`, or `psc`","messagePattern":"invalid ipType (.+?)\\. Must be one of `public`, `private`, or `psc`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/util.go","lineNumber":74,"sourceCode":"\t\t\treturn strs\n\t\t}\n\t}\n\treturn val\n}\n\n// GetCloudSQLDialOpts retrieve dial options with the right ip type and user agent for cloud sql\n// databases.\nfunc GetCloudSQLOpts(ipType, userAgent string, useIAM bool) ([]cloudsqlconn.Option, error) {\n\topts := []cloudsqlconn.Option{cloudsqlconn.WithUserAgent(userAgent)}\n\tswitch strings.ToLower(ipType) {\n\tcase \"private\":\n\t\topts = append(opts, cloudsqlconn.WithDefaultDialOptions(cloudsqlconn.WithPrivateIP()))\n\tcase \"public\":\n\t\topts = append(opts, cloudsqlconn.WithDefaultDialOptions(cloudsqlconn.WithPublicIP()))\n\tcase \"psc\":\n\t\topts = append(opts, cloudsqlconn.WithDefaultDialOptions(cloudsqlconn.WithPSC()))\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"invalid ipType %s. Must be one of `public`, `private`, or `psc`\", ipType)\n\t}\n\n\tif useIAM {\n\t\topts = append(opts, cloudsqlconn.WithIAMAuthN())\n\t}\n\treturn opts, nil\n}\n\n// GetIAMPrincipalEmailFromADC finds the email associated with ADC\nfunc GetIAMPrincipalEmailFromADC(ctx context.Context, dbType string) (string, error) {\n\t// Finds ADC and returns an HTTP client associated with it\n\tclient, err := google.DefaultClient(ctx,\n\t\t\"https://www.googleapis.com/auth/userinfo.email\")\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to call userinfo endpoint: %w\", err)\n\t}\n\n\t// Retrieve the email associated with the token","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/util.go#L56-L92","documentation":"GetCloudSQLOpts' switch on the configured ipType fell through to default: the value is not `public`, `private`, or `psc` (case-insensitive), so no Cloud SQL dial options can be built.","triggerScenarios":"Thrown at internal/sources/util.go:74 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set ipType to one of public, private, or psc in the source config","Check for typos or surrounding whitespace in the value","Omit ipType if the default behavior suffices"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}