dagger/dagger · warning

%w; %w

Error message

%w; %w

What it means

errorsJoin aggregates multiple errors from mirror release/teardown paths into a single error using fmt.Errorf("%w; %w"), joining the accumulated error with each subsequent one. It is an internal convenience so no release-time error is silently dropped; the joined error supports errors.Is/As against every constituent via the two %w verbs.

Source

Thrown at core/client_filesync_mirror.go:298

	if m.mounter != nil {
		rerr = errorsJoin(rerr, m.mounter.Unmount())
		m.mounter = nil
	}
	m.mntPath = ""
	m.sharedState = nil
	return rerr
}

func errorsJoin(errs ...error) error {
	var out error
	for _, err := range errs {
		if err == nil {
			continue
		}
		if out == nil {
			out = err
		} else {
			out = fmt.Errorf("%w; %w", out, err)
		}
	}
	return out
}

func NewEphemeralClientFilesyncMirror(drive string) *ClientFilesyncMirror {
	return &ClientFilesyncMirror{
		Drive:       drive,
		EphemeralID: identity.NewID(),
	}
}

View on GitHub (pinned to 82ba2681db)

Solutions

  1. Inspect both halves of the joined message — each %w branch is a distinct release error
  2. Use errors.Is/errors.As on the returned error to match specific constituent errors
  3. Fix the underlying release failures; the join itself is informational
  4. Check for resource-leak warnings if only one side consistently fails
Defensive patterns

Strategy: type-guard

Type guard

func splitJoinedErr(err error) []error {
    var errs []error
    if e := errors.Unwrap(err); e != nil { errs = append(errs, e) }
    return errs // use errors.Is/As across the whole chain instead
}

Try / catch

if err := mirror.OnRelease(ctx); err != nil {
    // both branches are wrapped with %w, so:
    if errors.Is(err, targetErr1) || errors.Is(err, targetErr2) { ... }
    log.Printf("release errors: %v", err)
}

Prevention

When it happens

Trigger: OnRelease or releaseRuntimeLocked returns more than one non-nil error (e.g. snapshot close fails and runtime resource release also fails), and errorsJoin combines them with "; " separators.

Common situations: Teardown of a client filesync mirror at session end where both snapshot release and runtime cleanup fail; shutdown races producing multiple independent release errors.

Related errors


AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05). Data as JSON: /api/errors/25a9f00034abea61. Report an issue: GitHub.