chenhg5/cc-connect · error

log backups: empty value

Error message

log backups: empty value

What it means

ParseLogBackups input guard: the log_backups value is empty after trimming, so no backup count can be derived. The minimum accepted is 1 because zero backups would discard the previous log on every rotation, destroying the post-mortem trail.

Source

Thrown at daemon/logbackups.go:26

// ParseLogBackups converts a string into a positive integer count of log
// backups to retain when the rotating writer rotates the active log file.
// Unlike ParseLogSize, no unit suffix is accepted — a backup count is
// already an integer in any sane unit. Whitespace is trimmed.
//
// Returns an error if the input is empty, non-integer, or not >= 1. The
// minimum is 1 (one backup, the legacy behaviour); zero would mean
// "discard the previous log on every rotation", which loses the entire
// post-mortem trail at the moment something goes wrong.
//
// A typical rotation policy with N=3 and maxSize=10MB keeps cc-connect.log
// plus cc-connect.log.1 / .2 / .3 on disk, so the maximum retained footprint
// is ≈ 4 × maxSize.
func ParseLogBackups(s string) (int, error) {
	orig := s
	s = strings.TrimSpace(s)
	if s == "" {
		return 0, fmt.Errorf("log backups: empty value")
	}
	n, err := strconv.Atoi(s)
	if err != nil {
		return 0, fmt.Errorf("log backups %q: %w", orig, err)
	}
	if n < 1 {
		return 0, fmt.Errorf("log backups %q: must be >= 1 (got %d)", orig, n)
	}
	return n, nil
}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Set log_backups to an integer >= 1 (no unit suffix accepted)
  2. Remove the key to use the default backup count
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at daemon/logbackups.go:26 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/8680dfb71005b50e. Report an issue: GitHub.