openzipkin/zipkin · error · NullPointerException

child == null

Error message

child == null

What it means

DependencyLink.Builder.child throws NullPointerException when the child service name is null. Symmetric with parent(): the child endpoint of the dependency edge is mandatory, and the builder fails fast rather than producing a half-built link that build() would reject anyway with 'Missing : child'.

Source

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

    }

    Builder(DependencyLink source) {
      this.parent = source.parent;
      this.child = source.child;
      this.callCount = source.callCount;
      this.errorCount = source.errorCount;
    }

    /** @see #parent() */
    public Builder parent(String parent) {
      if (parent == null) throw new NullPointerException("parent == null");
      this.parent = parent.toLowerCase(Locale.ROOT);
      return this;
    }

    /** @see #child() */
    public Builder child(String child) {
      if (child == null) throw new NullPointerException("child == null");
      this.child = child.toLowerCase(Locale.ROOT);
      return this;
    }

    /** @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 = "";

View on GitHub (pinned to 878ce2a1fa)

Solutions

  1. Skip the link when the child name cannot be determined.
  2. Ensure both parent and child names are extracted before building: if (parent != null && child != null) buildLink(...).
  3. Fix span ingestion so localEndpoint.serviceName is populated on spans you aggregate links from.

Example fix

// before
builder.parent("frontend").child(null);

// after
builder.parent("frontend").child("backend");
Defensive patterns

Strategy: validation

Validate before calling

if (parentName == null || childName == null) return;
builder.parent(parentName).child(childName);

Prevention

When it happens

Trigger: Calling DependencyLink.newBuilder().child(null), e.g. from Span-based link aggregation where the client span's serviceName is absent.

Common situations: Instrumentation that omits localEndpoint on the child side; parsing third-party trace data with missing endpoint names; copy-paste where parent is set twice instead of parent+child.

Related errors


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