GoogleContainerTools/skaffold · error

unknown panic

Error message

unknown panic

What it means

UpgradeToLatestUTF8Pipelines recovers from panics raised inside per-pipeline upgraders so one bad pipeline doesn't crash the process. If the recovered value r is neither a string nor an error (e.g. a panic value like an int or a custom struct), the code cannot classify it and throws this generic error.

Solutions

  1. Inspect which pipeline upgrader panics and fix it to panic with an error or string.
  2. Update skaffold to a version where the offending upgrade panic is fixed.
  3. Work around by manually editing skaffold.yaml to a schema version that upgrades cleanly, then rerun the upgrade.

Example fix

// before
panic(42) // recovered as "unknown panic"
// after
panic(fmt.Errorf("cannot upgrade pipeline %d: %v", i, reason))
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure upgrader implementations only panic with error/string values; audit custom upgraders before use.

Type guard

switch v := r.(type) { case error: ...; case string: ...; default: /* unknown panic */ }

Try / catch

cfg, err := util.UpgradeToLatestUTF8Pipelines(old)
if err != nil {
    if err.Error() == "unknown panic" {
        log.Printf("upgrader panicked with non-error value; report bug")
    }
    return err
}

Prevention

When it happens

Trigger: A pipelineUpgrader (or code it calls) panics with a non-string, non-error value while upgrading an old schema config's pipelines to latest.

Common situations: Schema upgrade code panicking via index-out-of-range or a panic(err/nil) with an unusual payload during `skaffold fix` on an old skaffold.yaml.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/43062e41243c52e0. Report an issue: GitHub.

Appendix: source

Thrown at pkg/skaffold/schema/util/upgrade_pipelines.go:40

	"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
	}

	return upgrader.profiles()
}

func (u *pipelineUpgrader) mainPipeline() error {

View on GitHub (pinned to a1189de023)