Skip to content

Dry run using validate command is unable to detect Cycle in the pipeline #12535

@sudiptob2

Description

@sudiptob2

Component(s)

connector/x

What happened?

Describe the bug

Dry run using validate command is unable to detect cycle in the pipeline.

Steps to reproduce

Invalid config

receivers:
  otlp:
    protocols:
      grpc:

exporters:
  debug:

connectors:
  forward:

service:
  pipelines:
    traces/in:
      receivers: [forward]
      processors: [ ]
      exporters: [forward]
    traces/out:
      receivers: [forward]
      processors: [ ]
      exporters: [forward]

This config.yaml passes validation

$ docker run -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.120.0 validate --config=/etc/otelcol-contrib/config.yaml
$ echo $?
0

However upon using this configuration, collector fails to start.

$ docker run -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.120.0 --config=/etc/otelcol-contrib/config.yaml

2025-03-03T17:05:07.121Z        info    [email protected]/service.go:193 Setting up own telemetry...
Error: failed to build pipelines: cycle detected: connector "forward" (traces to traces) -> connector "forward" (traces to traces)
2025/03/03 17:05:07 collector server run finished with error: failed to build pipelines: cycle detected: connector "forward" (traces to traces) -> connector "forward" (traces to traces)

$ echo $?
1

What did you expect to see?

I expect the validator to return an error.

What did you see instead?

Validation passed with no error.

Collector version

0.120.0

Environment information

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      grpc:

exporters:
  debug:

connectors:
  forward:

service:
  pipelines:
    traces/in:
      receivers: [forward]
      processors: [ ]
      exporters: [forward]
    traces/out:
      receivers: [forward]
      processors: [ ]
      exporters: [forward]

Log output

2025-03-03T17:05:07.121Z        info    [email protected]/service.go:193 Setting up own telemetry...
Error: failed to build pipelines: cycle detected: connector "forward" (traces to traces) -> connector "forward" (traces to traces)
2025/03/03 17:05:07 collector server run finished with error: failed to build pipelines: cycle detected: connector "forward" (traces to traces) -> connector "forward" (traces to traces)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions