openzipkin/zipkin · error · IllegalStateException

Missing :

Error message

Missing :

What it means

DependencyLink.Builder.build throws IllegalStateException('Missing : parent child') when build() runs without both parent and child having been set. This is the deferred counterpart to the per-field NPEs: if the builder was constructed from a source or manipulated directly, the missing fields are only detected at build time, and the message lists exactly which fields are absent.

Source

Thrown at zipkin/src/main/java/zipkin2/DependencyLink.java:96

    }

    /** @see #callCount() */
    public Builder callCount(long callCount) {
      this.callCount = callCount;
      return this;
    }

    /** @see #errorCount() */
    public Builder errorCount(long errorCount) {
      this.errorCount = errorCount;
      return this;
    }

    public DependencyLink build() {
      String missing = "";
      if (parent == null) missing += " parent";
      if (child == null) missing += " child";
      if (!missing.isEmpty()) throw new IllegalStateException("Missing :" + missing);
      return new DependencyLink(this);
    }
  }

  @Override public String toString() {
    return new String(DependencyLinkBytesEncoder.JSON_V1.encode(this), UTF_8);
  }

  // clutter below mainly due to difficulty working with Kryo which cannot handle AutoValue subclass
  // See https://github.com/openzipkin/zipkin/issues/1879
  final String parent, child;
  final long callCount, errorCount;

  DependencyLink(Builder builder) {
    parent = builder.parent;
    child = builder.child;
    callCount = builder.callCount;
    errorCount = builder.errorCount;

View on GitHub (pinned to 878ce2a1fa)

Solutions

  1. Set both parent and child before build().
  2. Validate inputs up front and skip/pad the link when a name is missing.
  3. Add a unit test asserting links built from your aggregation always have both names.

Example fix

// before
DependencyLink link = DependencyLink.newBuilder().parent("frontend").callCount(2).build();

// after
DependencyLink link = DependencyLink.newBuilder().parent("frontend").child("backend").callCount(2).build();
Defensive patterns

Strategy: validation

Validate before calling

if (parent == null || child == null) throw new IllegalStateException("link incomplete: parent=" + parent + ", child=" + child);
DependencyLink link = DependencyLink.newBuilder().parent(parent).child(child).build();

Prevention

When it happens

Trigger: Calling build() after newBuilder() with only parent(...) set (or neither field), or constructing a Builder from a DependencyLink whose fields were somehow cleared.

Common situations: Copy-paste builders that set the same field twice; conditional code that skips child(...) in an edge case; data-driven link construction where one side's key is absent from input.

Related errors


AI-assisted analysis of openzipkin/zipkin@878ce2a1fa (2026-08-14). Data as JSON: /api/errors/062d6a05ac72c3c5. Report an issue: GitHub.