GoogleContainerTools/skaffold · error
upgrading pipelines failed: %s
Error message
upgrading pipelines failed: %s
What it means
UpgradePipelines converts a skaffold config to the next schema version by upgrading the main pipeline and each profile pipeline. It wraps the whole upgrade in a recover() so a panic inside any versioned Upgrade() (e.g. Go nil-dereference on a malformed config) becomes a controlled error. This message is produced when the recovered panic value is a plain string; error panics are passed through and anything else becomes 'unknown panic'.
Source
Thrown at pkg/skaffold/schema/util/upgrade_pipelines.go:36
import (
"errors"
"fmt"
"reflect"
)
type pipelineUpgrader struct {
oldConfig reflect.Value
newConfig reflect.Value
upgrade func(o, n interface{}) error
}
func UpgradePipelines(oldConfig, newConfig interface{}, upgrade func(o, n interface{}) error) (err error) {
defer func() {
if r := recover(); r != nil {
switch x := r.(type) {
case string:
err = fmt.Errorf("upgrading pipelines failed: %s", x)
case error:
err = x
default:
err = errors.New("unknown panic")
}
}
}()
upgrader := pipelineUpgrader{
oldConfig: reflect.Indirect(reflect.ValueOf(oldConfig)),
newConfig: reflect.Indirect(reflect.ValueOf(newConfig)),
upgrade: upgrade,
}
if err := upgrader.mainPipeline(); err != nil {
return err
}
View on GitHub (pinned to a1189de023)
Solutions
- Read the recovered string message to find which pipeline field panicked, then fix or prune that section of the source config
- Add nil guards in the custom upgrade function so it cannot panic on partially-populated configs
- Validate/repair the source config with skaffold's validation before upgrading
Defensive patterns
Strategy: try-catch
Validate before calling
if err := config.Validate(); err != nil { return err } // pre-validate before upgrade Try / catch
if err := util.UpgradePipelines(old, new, upgradeFn); err != nil {
var target *schema.UnsupportedFieldError
if errors.As(err, &target) { /* handle */ }
return fmt.Errorf("pipeline upgrade failed: %w", err)
} Prevention
- Pre-validate configs before upgrading
- Write upgrade functions that nil-check all pointer/map fields
- Avoid panic(string) in upgrade code; return errors instead
When it happens
Trigger: Calling UpgradePipelines(oldConfig, newConfig, upgrade) where the upgrade function panics with panic("some string") — typically a nil map/pointer access or an explicit string panic inside a versioned schema Upgrade().
Common situations: Upgrading configs with missing sections (nil Build/Deploy pointers) that a versioned Upgrade method dereferences without nil checks; third-party or older schema code that panics on unexpected field shapes.
Related errors
- upgrading main pipeline: %w
- lengths of old and new profiles differ
- upgrading pipeline of profile %d: %w
- there's no version to upgrade from "latest"
- unknown panic
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/a6069ce5e005cd0f.
Report an issue: GitHub.