{"record":{"id":"5c2b3c9f7521a13b","repo":"caddyserver/caddy","slug":"loading-fallback-encoder-module-v","errorCode":null,"errorMessage":"loading fallback encoder module: %v","messagePattern":"loading fallback encoder module: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/logging/appendencoder.go","lineNumber":90,"sourceCode":"// Provision sets up the encoder.\nfunc (fe *AppendEncoder) Provision(ctx caddy.Context) error {\n\tfe.ctx = ctx\n\tfe.repl = caddy.NewReplacer()\n\n\tif fe.WrappedRaw == nil {\n\t\t// if wrap is not specified, default to JSON\n\t\tfe.wrapped = &JSONEncoder{}\n\t\tif p, ok := fe.wrapped.(caddy.Provisioner); ok {\n\t\t\tif err := p.Provision(ctx); err != nil {\n\t\t\t\treturn fmt.Errorf(\"provisioning fallback encoder module: %v\", err)\n\t\t\t}\n\t\t}\n\t\tfe.wrappedIsDefault = true\n\t} else {\n\t\t// set up wrapped encoder\n\t\tval, err := ctx.LoadModule(fe, \"WrappedRaw\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"loading fallback encoder module: %v\", err)\n\t\t}\n\t\tfe.wrapped = val.(zapcore.Encoder)\n\t}\n\n\treturn nil\n}\n\n// ConfigureDefaultFormat will set the default format to \"console\"\n// if the writer is a terminal. If already configured, it passes\n// through the writer so a deeply nested encoder can configure\n// its own default format.\nfunc (fe *AppendEncoder) ConfigureDefaultFormat(wo caddy.WriterOpener) error {\n\tif !fe.wrappedIsDefault {\n\t\tif cfd, ok := fe.wrapped.(caddy.ConfiguresFormatterDefault); ok {\n\t\t\treturn cfd.ConfigureDefaultFormat(wo)\n\t\t}\n\t\treturn nil\n\t}","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/logging/appendencoder.go#L72-L108","documentation":"Error \"loading fallback encoder module: %v\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/logging/appendencoder.go:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the fallback encoder module name and configuration; the wrapped error identifies the problem."],"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-16T03:17:38.424Z"}