XTLS/Xray-core · error
Unable to load config
Error message
Unable to load config
What it means
Catch-all in LoadConfig when the input is neither cmdarg.Arg nor io.Reader — an unsupported input type was passed to the config loading entry point. Indicates a programming error in the caller rather than a user config problem. Logged at Warning.
Solutions
- Pass a file list (cmdarg.Arg), an io.Reader, or a supported input type
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at core/config.go:159 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15).
Data as JSON: /api/errors/78a82cdd190478c4.
Report an issue: GitHub.
Appendix: source
Thrown at core/config.go:159
if hasProtobuf {
if len(v) == 1 {
return configLoaderByName["protobuf"].Loader(v)
} else {
return nil, errors.New("Only one protobuf config file is allowed").AtWarning()
}
}
// to avoid import cycle
return ConfigBuilderForFiles(files)
case io.Reader:
if f, found := configLoaderByName[formatName]; found {
return f.Loader(v)
} else {
return nil, errors.New("Unable to load config in", formatName).AtWarning()
}
}
return nil, errors.New("Unable to load config").AtWarning()
}
func loadProtobufConfig(data []byte) (*Config, error) {
config := new(Config)
if err := proto.Unmarshal(data, config); err != nil {
return nil, err
}
return config, nil
}
func init() {
common.Must(RegisterConfigLoader(&ConfigFormat{
Name: "Protobuf",
Extension: []string{"pb"},
Loader: func(input interface{}) (*Config, error) {
switch v := input.(type) {
case cmdarg.Arg:
r, err := confloader.LoadConfig(v[0])View on GitHub (pinned to 7d214f8b09)