ipfs/kubo · warning
could not find a non dev version
Error message
could not find a non dev version
What it means
LatestDistVersion iterates the available versions of a distribution (from DistVersions) and returns the first one that is not a -dev pre-release; if the scan ends without finding any non-dev version it returns this error. It means every version published for that distribution is a dev build (or the list was empty/unparseable).
Source
Thrown at repo/fsrepo/migrations/versions.go:36
// LatestDistVersion returns the latest version, of the specified distribution,
// that is available on the distribution site.
func LatestDistVersion(ctx context.Context, fetcher Fetcher, dist string, stableOnly bool) (string, error) {
vs, err := DistVersions(ctx, fetcher, dist, false)
if err != nil {
return "", err
}
for i := len(vs) - 1; i >= 0; i-- {
ver := vs[i]
if stableOnly && strings.Contains(ver, "-rc") {
continue
}
if strings.Contains(ver, "-dev") {
continue
}
return ver, nil
}
return "", errors.New("could not find a non dev version")
}
// DistVersions returns all versions of the specified distribution, that are
// available on the distriburion site. List is in ascending order, unless
// sortDesc is true.
func DistVersions(ctx context.Context, fetcher Fetcher, dist string, sortDesc bool) ([]string, error) {
versionBytes, err := fetcher.Fetch(ctx, path.Join(dist, distVersions))
if err != nil {
return nil, err
}
prefix := "v"
var vers []semver.Version
scan := bufio.NewScanner(bytes.NewReader(versionBytes))
for scan.Scan() {
ver, err := semver.Make(strings.TrimLeft(scan.Text(), prefix))
if err != nil {View on GitHub (pinned to 329838acdf)
Solutions
- Verify the distribution name and fetch endpoint are correct (official dists publish stable releases).
- Use DistVersions to list what is actually available and pin a known stable version explicitly instead of LatestDistVersion.
- If you intentionally want a dev build, install that version directly rather than via latest-version lookup.
- Inspect the dist site's responses to confirm the version list is being served correctly.
Defensive patterns
Strategy: fallback
Validate before calling
vers, err := migrations.DistVersions(ctx, fetcher, dist, true)
if err != nil { return err }
hasStable := false
for _, v := range vers {
if !strings.Contains(v, "-dev") { hasStable = true; break }
}
if !hasStable {
return fmt.Errorf("dist %s has no stable releases; available: %v", dist, vers)
} Try / catch
ver, err := migrations.LatestDistVersion(ctx, fetcher, dist)
if err != nil {
if err.Error() == "could not find a non dev version" {
// fall back to a pinned known-good version
ver = fallbackVersion
} else {
return err
}
} Prevention
- Pin explicit stable versions in scripts instead of resolving latest.
- Validate dist names and endpoints before querying versions.
- List DistVersions first and assert at least one non-dev version exists.
When it happens
Trigger: Calling LatestDistVersion for a dist name where all listed versions contain "-dev" — e.g. a typo'd or experimental dist name, a dist whose only published tags are dev builds, or a fetcher returning an empty/degenerate version list so the loop body never yields a stable version.
Common situations: Pointing ipfs-update at a custom/unofficial dist endpoint that only publishes -dev builds, asking for the latest version of a brand-new dist before its first stable release, or an intercepted/corrupted response yielding only malformed versions.
Related errors
- no local swarm address for migration node
- could not connect to migration peer %q: %s
- downgrade not allowed from %d to %d
- could not read versions: %w
- cannot get migrations from unknown fetcher type
AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03).
Data as JSON: /api/errors/f523b28b0cb43c8b.
Report an issue: GitHub.