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
- Inspect both halves of the joined message — each %w branch is a distinct release error
- Use errors.Is/errors.As on the returned error to match specific constituent errors
- Fix the underlying release failures; the join itself is informational
- 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
- Ensure snapshot close and runtime release paths are idempotent
- Log both halves of joined messages — each "; "-separated part is a distinct error
- Treat release-time errors as warnings unless they cause resource leaks
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
- failed to unmount: %w
- find stale dependency bindings: %w
- remove temporary merge git repository: %w
- remove temporary octopus merge git repository: %w
- encode persisted client filesync mirror: nil mirror
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/25a9f00034abea61.
Report an issue: GitHub.