{"record":{"id":"4081374b553e32be","repo":"XTLS/Xray-core","slug":"failed-to-parse-toml-config","errorCode":null,"errorMessage":"failed to parse toml config","messagePattern":"failed to parse toml config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/serial/loader.go","lineNumber":135,"sourceCode":"\t}\n\n\tjsonFile, err := json.Marshal(&configMap)\n\tif err != nil {\n\t\treturn nil, errors.New(\"failed to convert map to json\").Base(err)\n\t}\n\n\treturn DecodeJSONConfig(bytes.NewReader(jsonFile))\n}\n\nfunc LoadTOMLConfig(reader io.Reader) (*core.Config, error) {\n\ttomlConfig, err := DecodeTOMLConfig(reader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpbConfig, err := tomlConfig.Build()\n\tif err != nil {\n\t\treturn nil, errors.New(\"failed to parse toml config\").Base(err)\n\t}\n\n\treturn pbConfig, nil\n}\n\n// DecodeYAMLConfig reads from reader and decode the config into *conf.Config\n// using github.com/ghodss/yaml to convert yaml to json.\nfunc DecodeYAMLConfig(reader io.Reader) (*conf.Config, error) {\n\tyamlFile, err := io.ReadAll(reader)\n\tif err != nil {\n\t\treturn nil, errors.New(\"failed to read config file\").Base(err)\n\t}\n\n\tjsonFile, err := yaml.YAMLToJSON(yamlFile)\n\tif err != nil {\n\t\treturn nil, errors.New(\"failed to convert yaml to json\").Base(err)\n\t}\n","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/serial/loader.go#L117-L153","documentation":"Error \"failed to parse toml config\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at infra/conf/serial/loader.go:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}