Skip to content

Handle failures

Every failure below is a sentinel you can match with errors.Is. Match the sentinel, not the message text — messages are written for humans and change.

No build for this platform

if errors.Is(err, onnxruntime.ErrNoPlatformBuild) {
    // fall back to a runtime the operator installed
}

The channel publishes nothing for this GOOS/GOARCH at this version. Usually real rather than theoretical: upstream dropped macOS Intel between 1.23.0 and 1.26.0.

The remedy is an explicit path — see point at a runtime you already have. The error says so, because an error a reader cannot act on is only half an error.

The library was not in the archive

if errors.Is(err, onnxruntime.ErrNotInArchive) { ... }

The bytes verified against a signed manifest, so this is not corruption in transit — it is a published archive whose layout is not what was expected. Treat it as a channel problem and report it with the version; the message names the library it looked for so a publisher can compare.

The library is too large

if errors.Is(err, onnxruntime.ErrOversizeLibrary) { ... }

The decompressed size exceeded the bound. Compressed length is verified before extraction, so this bounds the decompressed stream, which is a different quantity. See limits and defaults.

Errors from the layer below

Anything reported by go/artifacts is wrapped, not swallowed, so its sentinels still match:

if errors.Is(err, artifacts.ErrWithdrawn) {
    // this version was withdrawn — do not retry, upgrade
}
if errors.Is(err, artifacts.ErrStaleIndex) {
    // the signed index is too old to trust; a retry may well succeed
}

The wrapping adds the version and platform, because "not found" without them sends the reader looking in the wrong place.

Failures leave nothing behind

A failed extraction removes its temporary file, so a later resolve never finds a half-written library and hands it to the loader. There is no partial state to clean up and no cache to clear before retrying.