{"record":{"id":"bc13aec8c427ae23","repo":"googleapis/mcp-toolbox","slug":"unable-to-parse-config-file-at-q-w","errorCode":null,"errorMessage":"unable to parse config file at %q: %w","messagePattern":"unable to parse config file at %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/internal/config.go","lineNumber":516,"sourceCode":"\t\treturn Config{}, fmt.Errorf(\"multiple authServices with mcpEnabled=true detected: %s. Only one MCP authorization server is currently supported\", strings.Join(mcpEnabledAuthServers, \", \"))\n\t}\n\n\treturn merged, nil\n}\n\n// LoadAndMergeConfigs loads multiple YAML files and merges them\nfunc (p *ConfigParser) LoadAndMergeConfigs(ctx context.Context, filePaths []string) (Config, error) {\n\tvar configs []Config\n\n\tfor _, filePath := range filePaths {\n\t\tbuf, err := os.ReadFile(filePath)\n\t\tif err != nil {\n\t\t\treturn Config{}, fmt.Errorf(\"unable to read config file at %q: %w\", filePath, err)\n\t\t}\n\n\t\tconfig, err := p.ParseConfig(ctx, buf)\n\t\tif err != nil {\n\t\t\treturn Config{}, fmt.Errorf(\"unable to parse config file at %q: %w\", filePath, err)\n\t\t}\n\n\t\tconfigs = append(configs, config)\n\t}\n\tif len(configs) == 0 {\n\t\treturn Config{}, fmt.Errorf(\"no YAML files found\")\n\t}\n\tif len(configs) > 1 {\n\t\tmergedFile, err := mergeConfigs(configs...)\n\t\tif err != nil {\n\t\t\treturn Config{}, fmt.Errorf(\"unable to merge config files: %w\", err)\n\t\t}\n\t\treturn mergedFile, nil\n\t}\n\treturn configs[0], nil\n}\n\n// GetPathsFromConfigFolder loads all YAML files from a directory and merges them","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/cmd/internal/config.go#L498-L534","documentation":"After reading a config file, LoadAndMergeConfigs calls ParseConfig. Any parse/validation failure (bad YAML syntax, unknown kind, missing required fields, failed source initialization) is wrapped with the file path so the offending file is identified.","triggerScenarios":"ParseConfig returns an error for a file's bytes: invalid YAML syntax, schema validation failure (wrong/missing fields), unknown source/tool kind, or an error initializing a source.","commonSituations":"Indentation errors in hand-edited YAML; using a kind name that doesn't exist (typo or old version); missing required fields like uri or kind; config written for a newer toolbox version.","solutions":["Validate the YAML syntax of the flagged file (yamllint or an editor linter)","Check that every kind value is supported by your toolbox version","Fill in required fields for the failing resource and re-run"],"exampleFix":"// before\nsources:\n  mypg:\n    kind: postgress   # typo\n// after\nsources:\n  mypg:\n    kind: postgres","handlingStrategy":"validation","validationCode":"var probe yaml.MapSlice\nif err := yaml.Unmarshal(data, &probe); err != nil {\n  return fmt.Errorf(\"invalid YAML: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"cfg, err := parser.LoadAndMergeConfigs(ctx, files)\nif err != nil {\n  if strings.Contains(err.Error(), \"unable to parse config file\") {\n    // file path is in the message; run yamllint on that file\n  }\n  return err\n}","preventionTips":["Lint YAML syntax in CI before deploying configs","Verify kind values against the toolbox version you run","Keep required fields (kind, uri/description) present for every resource"],"tags":["yaml","config-parsing","validation"],"backgroundTag":"config-parse-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"}