GoogleContainerTools/skaffold · error

strings.Join(messages, " | ")

Error message

strings.Join(messages, " | ")

What it means

MakeFilePathsAbsolute walks a skaffold config and rewrites relative file paths to be absolute against the config's base directory. When that per-field rewriting produces multiple errors, it does not return them individually; instead it aggregates all messages joined with " | " into a single error. This message is literally the joined list of underlying validation/rewrite failures.

Source

Thrown at pkg/skaffold/tags/paths.go:41

	"path/filepath"
	"reflect"
	"slices"
	"strings"

	"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/output/log"
)

// MakeFilePathsAbsolute recursively sets all fields marked with the tag `filepath` to absolute paths
func MakeFilePathsAbsolute(s interface{}, base string) error {
	errs := makeFilePathsAbsolute(s, base)
	if len(errs) == 0 {
		return nil
	}
	var messages []string
	for _, err := range errs {
		messages = append(messages, err.Error())
	}
	return errors.New(strings.Join(messages, " | "))
}

func makeFilePathsAbsolute(config interface{}, base string) []error {
	if config == nil {
		return nil
	}
	parentStruct := reflect.Indirect(reflect.ValueOf(config))

	switch parentStruct.Kind() {
	case reflect.Struct:
		t := parentStruct.Type()
		var errs []error
		for i := 0; i < t.NumField(); i++ {
			f := t.Field(i)
			v := parentStruct.Field(i)
			if !v.CanInterface() {
				return errs
			}

View on GitHub (pinned to a1189de023)

Solutions

  1. Parse the joined message: each " | "-separated segment is an individual error to fix.
  2. Fix each referenced path in skaffold.yaml (make sure files/dirs exist relative to the skaffold.yaml location).
  3. Run from the directory containing skaffold.yaml, or ensure base path resolution matches your working directory.
  4. Validate the config with `skaffold config` linting or `skaffold render` to surface remaining path issues one at a time.

Example fix

// before
return errors.New(strings.Join(messages, " | "))
// after (caller handling)
for _, part := range strings.Split(err.Error(), " | ") {
    log.Printf("config path issue: %s", part)
}
Defensive patterns

Strategy: try-catch

Validate before calling

const files = collectConfigPaths(cfg);
for (const f of files) {
  if (f && !fs.existsSync(path.resolve(configDir, f))) console.warn('path missing:', f);
}

Try / catch

try {
  makeFilePathsAbsolute(cfg, baseDir);
} catch (e) {
  const issues = e.message.split(' | ');
  issues.forEach(msg => console.error('config path error:', msg));
}

Prevention

When it happens

Trigger: A skaffold config contains multiple invalid path fields (e.g. two dockerfiles or manifests with nil/invalid contexts), so makeFilePathsAbsolute returns several errors which get joined; callers like processEachConfig surface them as one string.

Common situations: Configs with several artifacts each having path problems; empty config sections that yield nil errors elsewhere but path failures here; hand-edited skaffold.yaml with several wrong relative paths at once.

Related errors


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