{"record":{"id":"7fded76d61e83a85","repo":"XTLS/Xray-core","slug":"failed-to-parse-remote-json-config","errorCode":null,"errorMessage":"failed to parse remote JSON config","messagePattern":"failed to parse remote JSON config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/serial/loader.go","lineNumber":87,"sourceCode":"\t\treturn nil, errors.New(\"failed to read config file\").Base(err)\n\t}\n\n\treturn jsonConfig, nil\n}\n\n// DecodeJSONConfigStrict reads standard RFC 8259 JSON without comment-stripping.\n// Used for remote sources (http/https/http+unix) where the payload is produced by\n// automated systems and cannot contain JSON5/JSONC extensions. Avoids the\n// byte-by-byte comment stripper and TeeReader, which are significant overhead on\n// large configs.\nfunc DecodeJSONConfigStrict(reader io.Reader) (*conf.Config, error) {\n\tdata, err := io.ReadAll(reader)\n\tif err != nil {\n\t\treturn nil, errors.New(\"failed to read config file\").Base(err)\n\t}\n\tjsonConfig := &conf.Config{}\n\tif err := json.Unmarshal(data, jsonConfig); err != nil {\n\t\treturn nil, errors.New(\"failed to parse remote JSON config\").Base(err)\n\t}\n\treturn jsonConfig, nil\n}\n\nfunc LoadJSONConfig(reader io.Reader) (*core.Config, error) {\n\tjsonConfig, err := DecodeJSONConfig(reader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpbConfig, err := jsonConfig.Build()\n\tif err != nil {\n\t\treturn nil, errors.New(\"failed to parse json config\").Base(err)\n\t}\n\n\treturn pbConfig, nil\n}\n","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/serial/loader.go#L69-L105","documentation":"Error \"failed to parse remote JSON config\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at infra/conf/serial/loader.go:87 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"}