golang/go · error

unable to parse output of fossil info: %v

Error message

unable to parse output of fossil info: %v

What it means

For Fossil repositories, the go tool parses the checkout info line for a revision hash and a commit timestamp in Go's DateTime layout (2006-01-02 15:04:05). If the timestamp portion doesn't match that format, this error fires, wrapping the predefined errFossilInfo sentinel.

Source

Thrown at src/cmd/go/internal/vcs/vcs.go:358

	if i < 0 {
		return Status{}, errFossilInfo
	}
	checkout := out[i+len(prefix):]
	i = strings.Index(checkout, suffix)
	if i < 0 {
		return Status{}, errFossilInfo
	}
	checkout = strings.TrimSpace(checkout[:i])

	i = strings.IndexByte(checkout, ' ')
	if i < 0 {
		return Status{}, errFossilInfo
	}
	rev := checkout[:i]

	commitTime, err := time.ParseInLocation(time.DateTime, checkout[i+1:], time.UTC)
	if err != nil {
		return Status{}, fmt.Errorf("%v: %v", errFossilInfo, err)
	}

	// Also look for untracked changes.
	outb, err = vcsFossil.runOutputVerboseOnly(rootDir, "changes --differ")
	if err != nil {
		return Status{}, err
	}
	uncommitted := len(outb) > 0

	return Status{
		Revision:    rev,
		CommitTime:  commitTime,
		Uncommitted: uncommitted,
	}, nil
}

func (v *Cmd) String() string {
	return v.Name

View on GitHub (pinned to b6b368adc5)

Solutions

  1. Run `fossil info` manually to inspect the checkout line format
  2. Ensure Fossil is a modern version with standard output format
  3. Set LC_ALL=C to force consistent date/time formatting
  4. Rebuild/reopen the Fossil checkout if metadata is corrupted

Example fix

# before: locale interferes with fossil date output
export LC_TIME=fr_FR.UTF-8
go get ./...

# after: neutral locale
export LC_ALL=C
go get ./...
Defensive patterns

Strategy: try-catch

Validate before calling

# Verify fossil info output format
fossil info 2>/dev/null | head -5
# Ensure neutral locale
export LC_ALL=C

Try / catch

# Retry with neutral locale on Fossil parse failure
if ! go get ./... 2>&1 | grep -q 'unable to parse output of fossil info'; then
  echo 'ok'
else
  LC_ALL=C go get ./...
fi

Prevention

When it happens

Trigger: A Fossil repository where `fossil info` returns a checkout line whose date portion doesn't match the expected DateTime layout — different Fossil version, locale-specific formatting, or unexpected output.

Common situations: Different Fossil version producing altered output format; non-English locale; corrupted Fossil checkout metadata; Fossil not installed or broken.

Understand the failure class

Related errors


AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12). Data as JSON: /api/errors/2c49d2a78714a4e3. Report an issue: GitHub.