{"record":{"id":"47b947a5d762be18","repo":"caddyserver/caddy","slug":"unexpected-type-from-servers-global-options-t","errorCode":null,"errorMessage":"unexpected type from 'servers' global options: %T","messagePattern":"unexpected type from 'servers' global options: %T","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"caddyconfig/httpcaddyfile/httptype.go","lineNumber":403,"sourceCode":"\t\t\ttkn := segment[0]\n\t\t\treturn nil, fmt.Errorf(\"%s:%d: unrecognized global option: %s\", tkn.File, tkn.Line, opt)\n\t\t}\n\n\t\tval, err = optFunc(disp, options[opt])\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parsing caddyfile tokens for '%s': %v\", opt, err)\n\t\t}\n\n\t\t// As a special case, fold multiple \"servers\" options together\n\t\t// in an array instead of overwriting a possible existing value\n\t\tif opt == \"servers\" {\n\t\t\texistingOpts, ok := options[opt].([]serverOptions)\n\t\t\tif !ok {\n\t\t\t\texistingOpts = []serverOptions{}\n\t\t\t}\n\t\t\tserverOpts, ok := val.(serverOptions)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"unexpected type from 'servers' global options: %T\", val)\n\t\t\t}\n\t\t\toptions[opt] = append(existingOpts, serverOpts)\n\t\t\tcontinue\n\t\t}\n\t\t// Additionally, fold multiple \"log\" options together into an\n\t\t// array so that multiple loggers can be configured.\n\t\tif opt == \"log\" {\n\t\t\texistingOpts, ok := options[opt].([]ConfigValue)\n\t\t\tif !ok {\n\t\t\t\texistingOpts = []ConfigValue{}\n\t\t\t}\n\t\t\tlogOpts, ok := val.([]ConfigValue)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"unexpected type from 'log' global options: %T\", val)\n\t\t\t}\n\t\t\toptions[opt] = append(existingOpts, logOpts...)\n\t\t\tcontinue\n\t\t}","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/caddyconfig/httpcaddyfile/httptype.go#L385-L421","documentation":"Error \"unexpected type from 'servers' global options: %T\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at caddyconfig/httpcaddyfile/httptype.go:403 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is an internal type mismatch; report it with your Caddyfile. As a workaround, simplify or remove custom 'servers' global option parsing code."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}