golang/go · error

unable to parse output of fossil info

Error message

unable to parse output of fossil info

What it means

fossilStatus runs `fossil info` and parses the `checkout:` line for the hash and timestamp (errFossilInfo). If the expected line/format is absent it returns this error.

Source

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

// fossilRepoName is the name go get associates with a fossil repository. In the
// real world the file can be named anything.
const fossilRepoName = ".fossil"

// vcsFossil describes how to use Fossil (fossil-scm.org)
var vcsFossil = &Cmd{
	Name: "Fossil",
	Cmd:  "fossil",
	Roots: []isVCSRoot{
		vcsFileRoot(".fslckout"),
		vcsFileRoot("_FOSSIL_"),
	},

	Scheme: []string{"https", "http"},
	Status: fossilStatus,
}

var errFossilInfo = errors.New("unable to parse output of fossil info")

func fossilStatus(vcsFossil *Cmd, rootDir string) (Status, error) {
	outb, err := vcsFossil.runOutputVerboseOnly(rootDir, "info")
	if err != nil {
		return Status{}, err
	}
	out := string(outb)

	// Expect:
	// ...
	// checkout:     91ed71f22c77be0c3e250920f47bfd4e1f9024d2 2021-09-21 12:00:00 UTC
	// ...

	// Extract revision and commit time.
	// Ensure line ends with UTC (known timezone offset).
	const prefix = "\ncheckout:"
	const suffix = " UTC"
	i := strings.Index(out, prefix)

View on GitHub (pinned to b6b368adc5)

Solutions

  1. Run `fossil info` manually in the repo and inspect the output.
  2. Ensure a checkout exists (`fossil open <repo>`).
  3. Upgrade Fossil to a supported release.
  4. Switch the module to git if possible.

Example fix

# before
$ cd /repo && go get -v .   # fossil repo, no checkout -> unable to parse

# after
$ fossil open /repo.fossil && go get -v .
Defensive patterns

Strategy: validation

Validate before calling

// Confirm fossil info is parseable before relying on it.
func fossilOk(repoDir string) error {
    out, err := exec.Command("fossil", "info").CombinedOutput()
    if err != nil { return err }
    if !bytes.Contains(out, []byte("checkout:")) {
        return errors.New("fossil info lacks checkout line")
    }
    return nil
}

Type guard

null

Try / catch

null

Prevention

When it happens

Trigger: A Fossil repository whose `fossil info` output lacks the expected checkout line — e.g. a fresh repo with no checkout, an unsupported Fossil version, or a corrupt checkout file (.fslckout/_FOSSIL_).

Common situations: Newly created Fossil repos; CI with mismatched Fossil versions; deleted/missing checkout artifacts.

Understand the failure class

Related errors


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