tsenart/vegeta · warning

strings.Join(errs, "; ")

Error message

strings.Join(errs, "; ")

What it means

Close aggregates errors from closing every writer in the multiwriter; if any individual Close fails, it joins all messages with "; " into a single error. It indicates that one or more output sinks (e.g. report files) could not be closed/flushed.

Source

Thrown at file.go:58

		decs = append(decs, dec)
		closer = append(closer, rc)
	}
	return vegeta.NewRoundRobinDecoder(decs...), closer, nil
}

type multiCloser []io.Closer

func (mc multiCloser) Close() error {
	var errs []string
	for _, c := range mc {
		if err := c.Close(); err != nil {
			errs = append(errs, err.Error())
		}
	}

	if len(errs) > 0 {
		return errors.New(strings.Join(errs, "; "))
	}

	return nil
}

View on GitHub (pinned to cf58112690)

Solutions

  1. Inspect the joined message to find which writer(s) failed, then fix that sink (permissions, disk space, path).
  2. Ensure the output directory/file is writable before running the attack.
  3. Handle Close errors in your own wrapper writers so the aggregate is meaningful.

Example fix

// before
f, _ := os.Create("/ro/report.bin")
// after
f, err := os.Create("/tmp/report.bin")
if err != nil { log.Fatal(err) }
Defensive patterns

Strategy: try-catch

Validate before calling

for _, w := range writers {
    if f, ok := w.(*os.File); ok {
        if _, err := f.Stat(); err != nil { return err }
    }
}

Try / catch

if err := closers.Close(); err != nil {
    for _, part := range strings.Split(err.Error(), "; ") {
        log.Printf("close failure: %s", part)
    }
}

Prevention

When it happens

Trigger: Closing a MultiCloser (used by attack output handling and writeReport) where any underlying writer's Close returns an error, e.g. an unwritable file, disk full, or an HTTP body close failure.

Common situations: Report output file on a full disk or read-only filesystem; closing a network writer whose peer already closed; double-closing a writer.

Related errors


AI-assisted analysis of tsenart/vegeta@cf58112690 (2026-08-31). Data as JSON: /api/errors/76d47b246ad6167d. Report an issue: GitHub.