SigNoz/signoz · error
ErrCodeInvalidCollectorConfig
ErrCodeInvalidCollectorConfig
Error message
failed to unmarshal collector config for pipeline wiring
What it means
wireSpanMapperIntoTracesPipeline parses the collector config YAML to append the span-mapper processor to the traces pipeline; it deliberately errors if the config has no traces pipeline rather than silently passing spans through. The unmarshal failure at line 140 means the config YAML itself is unparseable.
Source
Thrown at pkg/types/spantypes/spanmappersimulator.go:140
Resource: resourceAttrs,
})
}
}
}
}
return result
}
// wireSpanMapperIntoTracesPipeline appends "signozspanmapper" to
// service.pipelines.traces.processors so the processor defined by
// GenerateCollectorConfigWithSpanMapperProcessor actually runs against the
// traces flowing through the simulator. Idempotent: skips appending if the
// processor name is already present. Errors if the config has no traces
// pipeline, since the simulation would otherwise silently pass spans through.
func wireSpanMapperIntoTracesPipeline(confYaml []byte) ([]byte, error) {
var conf map[string]any
if err := yaml.Unmarshal(confYaml, &conf); err != nil {
return nil, errors.Wrapf(err, errors.TypeInvalidInput, ErrCodeInvalidCollectorConfig, "failed to unmarshal collector config for pipeline wiring")
}
// Failed assertions yield nil, and indexing a nil map is safe,
// so any missing/mistyped level surfaces as traces == nil below.
service, _ := conf["service"].(map[string]any)
pipelines, _ := service["pipelines"].(map[string]any)
traces, _ := pipelines["traces"].(map[string]any)
if traces == nil {
return nil, errors.Newf(errors.TypeInternal, ErrCodeBuildMappingProcessorConfig, "collector config has no service.pipelines.traces pipeline to wire %q into", ProcessorName)
}
procs, _ := traces["processors"].([]any)
for _, p := range procs {
if name, ok := p.(string); ok && name == ProcessorName {
return confYaml, nil
}
}
traces["processors"] = append(procs, ProcessorName)
View on GitHub (pinned to 5069bf80b0)
Solutions
- Validate the config YAML before simulation (yamllint or a dry yaml.Unmarshal)
- Ensure the top level is a mapping with service.pipelines.traces defined so wiring can proceed
- Fix tabs/duplicate keys and re-run the simulator
Defensive patterns
Strategy: validation
Validate before calling
var conf map[string]any
if err := yaml.Unmarshal(confYaml, &conf); err != nil { return err }
if _, ok := conf["service"]; !ok { /* simulator will reject: no traces pipeline */ } Prevention
- Validate YAML before running the simulator
- Ensure service.pipelines.traces exists in test fixtures
When it happens
Trigger: Running the span-mapper simulator on a config that is invalid YAML. Note the subsequent behavior: if YAML is valid but service.pipelines.traces is missing or mistyped, the code lets traces be nil and returns an error elsewhere (by design) — line 140 fires only for genuine YAML syntax/type errors.
Common situations: Feeding templated or user-provided configs into the simulator without validation; configs using tabs, duplicate keys, or a top-level sequence; configs serialized with yaml v2 tags incompatible with the v3 unmarshal used here.
Related errors
- ErrCodeInvalidCollectorConfig
- ErrCodeInvalidCollectorConfig
- CodeInvalidInput
- failed to read the stored config correctly
AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28).
Data as JSON: /api/errors/36479516ee2b8c22.
Report an issue: GitHub.