{"record":{"id":"719836fc22c46297","repo":"googleapis/mcp-toolbox","slug":"iptype-invalid-must-be-one-of-public-private","errorCode":null,"errorMessage":"ipType invalid: must be one of \"public\", \"private\", or \"psc\"","messagePattern":"ipType invalid: must be one of \"public\", \"private\", or \"psc\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/ip_type.go","lineNumber":42,"sourceCode":"\nfunc (i *IPType) String() string {\n\tif string(*i) != \"\" {\n\t\treturn strings.ToLower(string(*i))\n\t}\n\treturn \"public\"\n}\n\nfunc (i *IPType) UnmarshalYAML(ctx context.Context, unmarshal func(interface{}) error) error {\n\tvar ipType string\n\tif err := unmarshal(&ipType); err != nil {\n\t\treturn err\n\t}\n\tswitch strings.ToLower(ipType) {\n\tcase \"private\", \"public\", \"psc\":\n\t\t*i = IPType(strings.ToLower(ipType))\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(`ipType invalid: must be one of \"public\", \"private\", or \"psc\"`)\n\t}\n}\n","sourceCodeStart":24,"sourceCodeEnd":45,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/ip_type.go#L24-L45","documentation":"IPType.UnmarshalYAML validates the YAML string against the allowed values \"public\", \"private\", or \"psc\" (case-insensitive). Any other string fails unmarshaling with this error. It guards the Cloud SQL connection ipType config field from invalid values.","triggerScenarios":"A toolbox YAML config where a source's ipType field is set to something other than public/private/psc, e.g. ipType: internal or a typo like ipType: privte.","commonSituations":"Typo in config; copying a config from an older/other product using different ipType vocabulary; setting PSC type where it isn't supported in that spelling (e.g. \"PSC\" works, \"psc-\" doesn't).","solutions":["Set ipType to exactly one of: public, private, or psc (any casing is accepted).","Remove the ipType field to use the default instead of an invalid value.","Re-run the toolbox after fixing the YAML and watch for a clean startup."],"exampleFix":"# before\nsources:\n  my-cloud-sql-pg:\n    kind: cloud-sql-postgres\n    ipType: internal\n# after\nsources:\n  my-cloud-sql-pg:\n    kind: cloud-sql-postgres\n    ipType: private","handlingStrategy":"validation","validationCode":"function validateIpType(v) {\n  if (v == null) return true; // optional\n  return ['public', 'private', 'psc'].includes(String(v).toLowerCase());\n}\n// run before applying the YAML config\nif (!validateIpType(cfg.sources['my-cloud-sql-pg'].ipType)) throw new Error('ipType must be public, private, or psc');","typeGuard":null,"tryCatchPattern":"try {\n  toolbox.start(configYaml);\n} catch (err) {\n  if (String(err).includes('ipType invalid')) {\n    console.error('Fix the ipType field in YAML: allowed values are public, private, psc.');\n  } else throw err;\n}","preventionTips":["Keep a schema/lint check on toolbox YAML configs in CI.","Only copy ipType values from the current official docs for the Cloud SQL source.","Remember matching is case-insensitive but the vocabulary is fixed to three values."],"tags":["config","yaml","validation"],"backgroundTag":"schema-validation-failed","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"}