GoogleContainerTools/skaffold · error

survey config field not found in config struct

Error message

survey config field %q not found in config struct %s

What it means

Internal guard in surveyStruct: the survey field (referenced by surveyFieldName) is missing from the SurveyConfig reflect.Type while building the config struct index for survey-related `skaffold config set` operations. Indicates a version mismatch between the compiled schema and the reflection code, not user input error.

Solutions

  1. Upgrade skaffold to the latest release to ensure schema and code are in sync
  2. Reinstall the skaffold binary in case of a corrupted or mixed-version installation
  3. Report to skaffold maintainers if it persists on the latest version
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at cmd/skaffold/app/cmd/config/set.go:139 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at cmd/skaffold/app/cmd/config/set.go:139

	if survey {
		if cfg.Survey == nil {
			cfg.Survey = &config.SurveyConfig{
				UserSurveys: []*config.UserSurvey{},
			}
		}
		return surveyStruct(cfg.Survey, t)
	}
	return &cfgStruct{
		value: reflect.Indirect(reflect.ValueOf(cfg)),
		rType: t,
		idx:   []int{},
	}, nil
}

func surveyStruct(s *config.SurveyConfig, t reflect.Type) (*cfgStruct, error) {
	field, ok := t.FieldByName(surveyFieldName)
	if !ok {
		return nil, fmt.Errorf("survey config field %q not found in config struct %s", surveyFieldName, t.Name())
	}
	rType := reflect.TypeOf(*s)
	if isUserSurvey() {
		return userSurveyStruct(&config.UserSurvey{}, rType, field.Index)
	}
	return &cfgStruct{
		value: reflect.Indirect(reflect.ValueOf(s)),
		rType: rType,
		idx:   field.Index,
	}, nil
}

func userSurveyStruct(as *config.UserSurvey, t reflect.Type, idx []int) (*cfgStruct, error) {
	field, ok := t.FieldByName(userSurveysFieldName)
	if !ok {
		return nil, fmt.Errorf("survey config field %q not found in config struct %s", userSurveysFieldName, t.Name())
	}
	return &cfgStruct{

View on GitHub (pinned to a1189de023)