golang/go · error

unable to parse output of svn info: %v

Error message

unable to parse output of svn info: %v

What it means

For Subversion repositories, the go tool runs `svn info --show-item last-changed-date` and parses the result as RFC3339. If the date string doesn't match the RFC3339 layout, parsing fails with the underlying time.Parse error wrapped for context.

Source

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

	Scheme:  []string{"https", "http", "svn", "svn+ssh"},
	PingCmd: "info -- {scheme}://{repo}",
	Status:  svnStatus,
}

func svnStatus(vcsSvn *Cmd, rootDir string) (Status, error) {
	out, err := vcsSvn.runOutputVerboseOnly(rootDir, "info --show-item last-changed-revision")
	if err != nil {
		return Status{}, err
	}
	rev := strings.TrimSpace(string(out))

	out, err = vcsSvn.runOutputVerboseOnly(rootDir, "info --show-item last-changed-date")
	if err != nil {
		return Status{}, err
	}
	commitTime, err := time.Parse(time.RFC3339, strings.TrimSpace(string(out)))
	if err != nil {
		return Status{}, fmt.Errorf("unable to parse output of svn info: %v", err)
	}

	out, err = vcsSvn.runOutputVerboseOnly(rootDir, "status")
	if err != nil {
		return Status{}, err
	}
	uncommitted := len(out) > 0

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

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

View on GitHub (pinned to b6b368adc5)

Solutions

  1. Run `svn info --show-item last-changed-date` manually to inspect the actual output
  2. Ensure svn is a reasonably modern version (1.9+) that supports --show-item
  3. Set LC_ALL=C or LC_TIME=C to force consistent date formatting
  4. Re-checkout the SVN working copy if metadata is corrupted

Example fix

# before: locale affects svn date output
export LC_TIME=de_DE.UTF-8
go get ./...

# after: force C locale for consistent formatting
export LC_ALL=C
go get ./...
Defensive patterns

Strategy: try-catch

Validate before calling

# Verify svn date output is parseable as RFC3339
DATE=$(svn info --show-item last-changed-revision 2>/dev/null)
if [ $? -ne 0 ]; then echo 'svn not available or repo not SVN'; fi
# Force neutral locale for consistent output
export LC_ALL=C

Try / catch

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

Prevention

When it happens

Trigger: An SVN repository where `svn info --show-item last-changed-date` returns output that isn't valid RFC3339 — different SVN version, locale-specific date formatting, or unexpected svn output (error text, empty string).

Common situations: Older SVN client with different date output format; non-English locale affecting svn output; SVN server configuration returning unusual date formats; svn 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/eee78e760e3bbd18. Report an issue: GitHub.